From 2dc2c9d76d83259fced176936898b9be09bda642 Mon Sep 17 00:00:00 2001 From: Shruti78 Date: Sat, 18 May 2024 00:34:45 +0530 Subject: [PATCH] Shruti Commit --- app/.flutter-plugins-dependencies | 2 +- app/lib/main.dart | 2 + app/lib/screens/discussion/comments.dart | 8 ++ app/lib/screens/discussion/discussion.dart | 93 ++++++++++++++++++++++ app/lib/screens/landing_screen/drawer.dart | 8 ++ 5 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 app/lib/screens/discussion/comments.dart create mode 100644 app/lib/screens/discussion/discussion.dart diff --git a/app/.flutter-plugins-dependencies b/app/.flutter-plugins-dependencies index 35e748c..ab5d7b1 100644 --- a/app/.flutter-plugins-dependencies +++ b/app/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_local_notifications","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/flutter_local_notifications-17.1.1/","native_build":true,"dependencies":[]},{"name":"flutter_pdfview","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/flutter_pdfview-1.3.2/","native_build":true,"dependencies":[]},{"name":"open_file","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/open_file-3.3.2/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.4/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_local_notifications","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/flutter_local_notifications-17.1.1/","native_build":true,"dependencies":[]},{"name":"flutter_pdfview","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/flutter_pdfview-1.3.2/","native_build":true,"dependencies":[]},{"name":"open_file","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/open_file-3.3.2/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.5/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_local_notifications","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/flutter_local_notifications-17.1.1/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"url_launcher_linux","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"permission_handler_windows","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_windows","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"permission_handler_html","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.1/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/yashshukla/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.1/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_local_notifications","dependencies":[]},{"name":"flutter_pdfview","dependencies":[]},{"name":"open_file","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_html","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_html","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2024-05-02 11:33:01.206945","version":"3.19.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_local_notifications","path":"/home/shruti/.pub-cache/hosted/pub.dev/flutter_local_notifications-17.1.2/","native_build":true,"dependencies":[]},{"name":"flutter_pdfview","path":"/home/shruti/.pub-cache/hosted/pub.dev/flutter_pdfview-1.3.2/","native_build":true,"dependencies":[]},{"name":"open_file","path":"/home/shruti/.pub-cache/hosted/pub.dev/open_file-3.3.2/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/home/shruti/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"/home/shruti/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.4/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/shruti/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/home/shruti/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.0/","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_local_notifications","path":"/home/shruti/.pub-cache/hosted/pub.dev/flutter_local_notifications-17.1.2/","native_build":true,"dependencies":[]},{"name":"flutter_pdfview","path":"/home/shruti/.pub-cache/hosted/pub.dev/flutter_pdfview-1.3.2/","native_build":true,"dependencies":[]},{"name":"open_file","path":"/home/shruti/.pub-cache/hosted/pub.dev/open_file-3.3.2/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/home/shruti/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"/home/shruti/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.6/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/shruti/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/home/shruti/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_local_notifications","path":"/home/shruti/.pub-cache/hosted/pub.dev/flutter_local_notifications-17.1.2/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/home/shruti/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/home/shruti/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/home/shruti/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/home/shruti/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"url_launcher_linux","path":"/home/shruti/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/home/shruti/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"permission_handler_windows","path":"/home/shruti/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_windows","path":"/home/shruti/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"permission_handler_html","path":"/home/shruti/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.1/","dependencies":[]},{"name":"url_launcher_web","path":"/home/shruti/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.1/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_local_notifications","dependencies":[]},{"name":"flutter_pdfview","dependencies":[]},{"name":"open_file","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_html","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_html","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2024-05-18 00:31:04.220226","version":"3.19.3"} \ No newline at end of file diff --git a/app/lib/main.dart b/app/lib/main.dart index 7c56f2e..ce43a90 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -1,3 +1,4 @@ +import 'package:examtime/screens/discussion/discussion.dart'; import 'package:examtime/screens/request_notes/request.dart'; import 'package:flutter/material.dart'; import 'package:examtime/screens/landing_screen/dashboard.dart'; @@ -30,6 +31,7 @@ class MyApp extends StatelessWidget { ProfileScreen.routeName: (context) => ProfileScreen(), LikedNotesPage.routeName: (context) => LikedNotesPage(), RequestNotesPage.routeName: (context) => RequestNotesPage(), + DiscussionPage.routeName: (context) => DiscussionPage(), }, ); } diff --git a/app/lib/screens/discussion/comments.dart b/app/lib/screens/discussion/comments.dart new file mode 100644 index 0000000..dfa43d1 --- /dev/null +++ b/app/lib/screens/discussion/comments.dart @@ -0,0 +1,8 @@ +// comment.dart +class Comment { + String username; + String content; + DateTime timestamp; + + Comment({required this.username, required this.content, required this.timestamp}); +} diff --git a/app/lib/screens/discussion/discussion.dart b/app/lib/screens/discussion/discussion.dart new file mode 100644 index 0000000..69c66d3 --- /dev/null +++ b/app/lib/screens/discussion/discussion.dart @@ -0,0 +1,93 @@ +// discussion_page.dart +import 'package:flutter/material.dart'; + +import 'comments.dart'; + +class DiscussionPage extends StatefulWidget { + static const String routeName = '/disscussion'; + + @override + _DiscussionPageState createState() => _DiscussionPageState(); +} + +class _DiscussionPageState extends State { + List comments = []; + final TextEditingController _commentController = TextEditingController(); + final TextEditingController _usernameController = TextEditingController(); + + void _addComment() { + final username = _usernameController.text; + final content = _commentController.text; + + if (username.isNotEmpty && content.isNotEmpty) { + setState(() { + comments.add(Comment( + username: username, + content: content, + timestamp: DateTime.now(), + )); + }); + + _usernameController.clear(); + _commentController.clear(); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Discussion'), + ), + body: Column( + children: [ + Expanded( + child: ListView.builder( + itemCount: comments.length, + itemBuilder: (context, index) { + final comment = comments[index]; + return ListTile( + title: Text(comment.username), + subtitle: Text(comment.content), + trailing: Text( + "${comment.timestamp.hour}:${comment.timestamp.minute}", + style: TextStyle(fontSize: 12), + ), + ); + }, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Expanded( + child: TextField( + controller: _usernameController, + decoration: InputDecoration( + labelText: 'Username', + ), + ), + ), + SizedBox(width: 8), + Expanded( + flex: 2, + child: TextField( + controller: _commentController, + decoration: InputDecoration( + labelText: 'Discuss here', + ), + ), + ), + IconButton( + icon: Icon(Icons.send), + onPressed: _addComment, + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/app/lib/screens/landing_screen/drawer.dart b/app/lib/screens/landing_screen/drawer.dart index 624ef71..37c7471 100644 --- a/app/lib/screens/landing_screen/drawer.dart +++ b/app/lib/screens/landing_screen/drawer.dart @@ -1,3 +1,4 @@ +import 'package:examtime/screens/discussion/discussion.dart'; import 'package:flutter/material.dart'; import 'package:examtime/screens/profile/profile.dart'; @@ -80,6 +81,13 @@ class AppDrawer extends StatelessWidget { Navigator.pushNamed(context, LoginPage.routeName); }, ), + ListTile( + leading: Icon(Icons.forum), + title: Text('Discuss'), + onTap: () { + Navigator.pushNamed(context, DiscussionPage.routeName); + }, + ), ], ), );