From 78f725235e6460f9e0e75f4efe758977d641e203 Mon Sep 17 00:00:00 2001 From: Nishant Shingate Date: Tue, 17 Oct 2023 19:35:19 +0530 Subject: [PATCH 1/5] Updated dependency --- pubspec.lock | 86 +++++++++++++++++++--------------------------------- pubspec.yaml | 8 ++--- 2 files changed, 35 insertions(+), 59 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 2a0388fbbf..85fcb4c233 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -45,26 +45,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" - charts_common: - dependency: transitive - description: - name: charts_common - sha256: "7b8922f9b0d9b134122756a787dab1c3946ae4f3fc5022ff323ba0014998ea02" - url: "https://pub.dev" - source: hosted - version: "0.12.0" - charts_flutter: - dependency: "direct main" - description: - name: charts_flutter - sha256: "4172c3f4b85322fdffe1896ffbed79ae4689ae72cb6fe6690dcaaea620a9c558" - url: "https://pub.dev" - source: hosted - version: "0.12.0" + version: "1.3.0" checked_yaml: dependency: transitive description: @@ -117,10 +101,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.2" convert: dependency: transitive description: @@ -153,14 +137,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" - date_time_picker: - dependency: "direct main" - description: - name: date_time_picker - sha256: "6923c568bcb67a66ab7e083708d0adbcae8214b41bb84d49febc17e89e06fc4a" - url: "https://pub.dev" - source: hosted - version: "2.1.0" dbus: dependency: transitive description: @@ -609,10 +585,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.1" introduction_screen: dependency: "direct main" description: @@ -653,38 +629,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.6" - logging: - dependency: transitive - description: - name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.dev" - source: hosted - version: "1.2.0" matcher: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" mime: dependency: transitive description: @@ -713,10 +681,10 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" path_parsing: dependency: transitive description: @@ -918,10 +886,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -950,10 +918,10 @@ packages: dependency: "direct main" description: name: table_calendar - sha256: "7f1270313c0cdb245b583ed8518982c01d4a7e95869b3c30abcbae3b642c45d0" + sha256: "1e3521a3e6d3fc7f645a58b135ab663d458ab12504f1ea7f9b4b81d47086c478" url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.9" term_glyph: dependency: transitive description: @@ -966,10 +934,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.6.0" timezone: dependency: transitive description: @@ -1090,6 +1058,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" win32: dependency: transitive description: @@ -1123,5 +1099,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=2.19.0 <3.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.7.0-0" diff --git a/pubspec.yaml b/pubspec.yaml index 67c96c9360..14d1a860d9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,13 +6,13 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" dependencies: flutter: sdk: flutter - intl: ^0.17.0 + intl: ^0.18.1 provider: fluttertoast: flutter_svg: @@ -25,7 +25,7 @@ dependencies: url_launcher: firebase_storage: path_provider: - date_time_picker: + # date_time_picker: table_calendar: flutter_login_facebook: flutter_icons_null_safety: @@ -34,7 +34,7 @@ dependencies: introduction_screen: is_first_run: shared_preferences: - charts_flutter: + # charts_flutter: share_plus: flutter_share: settings_ui: From 2342f845cc860a767d1db26b66a9e4f978d1eeb3 Mon Sep 17 00:00:00 2001 From: Nishant Shingate Date: Tue, 17 Oct 2023 19:54:15 +0530 Subject: [PATCH 2/5] Updated localization by adding null check --- lib/screens/alert_screen.dart | 9 +- lib/screens/favourites_screen.dart | 72 ++++--- lib/screens/home_screen.dart | 106 +++++----- lib/screens/homework_screen.dart | 9 +- lib/screens/profile_screen.dart | 223 +++++++++++---------- lib/screens/settings_screen.dart | 309 ++++++++++++++++------------- lib/widgets/header.dart | 19 +- lib/widgets/recents_alerts.dart | 80 ++++---- 8 files changed, 446 insertions(+), 381 deletions(-) diff --git a/lib/screens/alert_screen.dart b/lib/screens/alert_screen.dart index 9bbd635a6d..3283a07c70 100644 --- a/lib/screens/alert_screen.dart +++ b/lib/screens/alert_screen.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:friday/widgets/recents_alerts.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:friday/widgets/recents_alerts.dart'; class AlertScreen extends StatefulWidget { @override @@ -11,14 +11,15 @@ class _AlertScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8), + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), body: SafeArea( child: SingleChildScrollView( child: Column( children: [ SizedBox(height: 30.0), Text( - AppLocalizations.of(context).recentalerts, + AppLocalizations.of(context)?.recentalerts ?? "", style: TextStyle( color: Colors.white, fontSize: 30.0, @@ -44,4 +45,4 @@ class _AlertScreenState extends State { ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/favourites_screen.dart b/lib/screens/favourites_screen.dart index f4537ca1f9..a3d8c6ee12 100644 --- a/lib/screens/favourites_screen.dart +++ b/lib/screens/favourites_screen.dart @@ -1,14 +1,13 @@ import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_icons_null_safety/flutter_icons_null_safety.dart'; import 'package:intl/intl.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + import '../constants.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import '../models/alert.dart'; import '../widgets/countdown_painter.dart'; - class FavouritesScreen extends StatefulWidget { const FavouritesScreen({Key? key}) : super(key: key); @@ -27,35 +26,50 @@ class _FavouritesScreenState extends State { initpref(); super.initState(); } + @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(elevation: 0,backgroundColor: Colors.transparent ,leading: IconButton( - icon: Icon(Icons.arrow_back_rounded, color: Colors.white,), - onPressed: (){ - Navigator.pop(context); - }, - ),), - backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8), + appBar: AppBar( + elevation: 0, + backgroundColor: Colors.transparent, + leading: IconButton( + icon: Icon( + Icons.arrow_back_rounded, + color: Colors.white, + ), + onPressed: () { + Navigator.pop(context); + }, + ), + ), + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), body: SafeArea( child: SingleChildScrollView( child: Column( children: [ - SizedBox(height: 30.0), Text( - AppLocalizations.of(context).favourites, + AppLocalizations.of(context)?.favourites ?? "", style: TextStyle( color: Colors.white, fontSize: 30.0, fontWeight: FontWeight.bold, ), ), - SizedBox(height: 10,), - Center(child: TextButton(onPressed: () { - removeall(); - }, - child: Text(AppLocalizations.of(context).clearallfavourites)),), + SizedBox( + height: 10, + ), + Center( + child: TextButton( + onPressed: () { + removeall(); + }, + child: Text( + AppLocalizations.of(context)?.clearallfavourites ?? + "")), + ), SizedBox(height: 30.0), Container( padding: EdgeInsets.all(35.0), @@ -73,11 +87,11 @@ class _FavouritesScreenState extends State { itemCount: favlist.length, itemBuilder: (BuildContext context, int index) { Alert alert = favlist[index]; - int hoursLeft = DateTime.now().difference(favlist[index].time).inHours; + int hoursLeft = + DateTime.now().difference(favlist[index].time).inHours; hoursLeft = hoursLeft < 0 ? -hoursLeft : 0; double percent = hoursLeft / 48; - return Row( children: [ Container( @@ -121,7 +135,9 @@ class _FavouritesScreenState extends State { children: [ Icon( AntDesign.clockcircle, - color: Theme.of(context).colorScheme.secondary, + color: Theme.of(context) + .colorScheme + .secondary, size: 17.0, ), SizedBox(width: 10.0), @@ -132,7 +148,6 @@ class _FavouritesScreenState extends State { fontSize: 15.0, ), ), - ], ), SizedBox(height: 10.0), @@ -140,7 +155,9 @@ class _FavouritesScreenState extends State { children: [ Icon( Icons.receipt, - color: Theme.of(context).colorScheme.secondary, + color: Theme.of(context) + .colorScheme + .secondary, size: 17.0, ), SizedBox(width: 10.0), @@ -153,7 +170,6 @@ class _FavouritesScreenState extends State { ), ], ), - ], ), Positioned( @@ -168,7 +184,8 @@ class _FavouritesScreenState extends State { child: Padding( padding: EdgeInsets.all(20.0), child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, children: [ Text( "$hoursLeft", @@ -204,17 +221,18 @@ class _FavouritesScreenState extends State { ), ); } + _getColor(BuildContext context, double percent) { if (percent >= 0.4) return Theme.of(context).colorScheme.secondary; return kHourColor; } - void initpref() async{ + void initpref() async { preferences = await SharedPreferences.getInstance(); var x = await preferences.getStringList('favbool')!; var t = x.length; - for(var i = 0; i < t; i++) { + for (var i = 0; i < t; i++) { if (x[i] == 'true') { favlist.add(recentAlerts[i]); } @@ -224,7 +242,6 @@ class _FavouritesScreenState extends State { }); print('yehaibe\n'); print(favlist); - } void removeall() async { @@ -236,4 +253,3 @@ class _FavouritesScreenState extends State { }); } } - diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 6647350c5f..3e41915bdb 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -1,17 +1,18 @@ +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_icons_null_safety/flutter_icons_null_safety.dart'; +import 'package:friday/constants.dart'; import 'package:friday/models/alert.dart'; import 'package:friday/models/homework.dart'; import 'package:friday/screens/favourites_screen.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:friday/widgets/countdown_painter.dart'; -import 'package:flutter/material.dart'; -import 'package:friday/constants.dart'; import 'package:friday/widgets/header.dart'; import 'package:friday/widgets/recents_alerts.dart'; import 'package:friday/widgets/recents_homeworks.dart'; import 'package:intl/intl.dart'; -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/services.dart' show rootBundle; + import 'chat_screen.dart'; class HomeScreen extends StatefulWidget { @@ -54,15 +55,10 @@ class _HomeScreenState extends State with WidgetsBindingObserver { } } - - - Future> fetchAssignmentData() async { String fileData = await rootBundle.loadString('assets/assignment_data.txt'); - List assignmentDataList = fileData - .split('\n') - .map((line) { + List assignmentDataList = fileData.split('\n').map((line) { List values = line.split(','); DateTime date = DateTime.parse(values[0]); double score = double.parse(values[1]); @@ -70,8 +66,7 @@ class _HomeScreenState extends State with WidgetsBindingObserver { String subject = values[3]; Duration timeSpent = Duration(hours: int.parse(values[4])); return AssignmentData(date, score, assignmentNumber, subject, timeSpent); - }) - .toList(); + }).toList(); return assignmentDataList; } @@ -79,7 +74,8 @@ class _HomeScreenState extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8), + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), floatingActionButton: FloatingActionButton( onPressed: () { Navigator.push( @@ -94,7 +90,6 @@ class _HomeScreenState extends State with WidgetsBindingObserver { body: ListView( children: [ Header(), - Padding( padding: EdgeInsets.symmetric(horizontal: 30.0), child: GestureDetector( @@ -113,7 +108,7 @@ class _HomeScreenState extends State with WidgetsBindingObserver { border: InputBorder.none, fillColor: Theme.of(context).primaryColor, filled: true, - hintText: AppLocalizations.of(context).search, + hintText: AppLocalizations.of(context)?.search ?? "", hintStyle: TextStyle(color: kTextColor), prefixIcon: Icon(Icons.search, color: kTextColor, size: 26.0), enabledBorder: OutlineInputBorder( @@ -121,16 +116,29 @@ class _HomeScreenState extends State with WidgetsBindingObserver { ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(30.0), - borderSide: BorderSide(width: 1, color: Colors.grey.shade600), + borderSide: + BorderSide(width: 1, color: Colors.grey.shade600), ), ), ), ), ), - SizedBox(height: 10,), - Center(child: TextButton(onPressed: () { - Navigator.of(context).push(MaterialPageRoute(builder: (context) => FavouritesScreen())); - },child: Text( AppLocalizations.of(context).seefavourites, style: TextStyle(color: Theme.of(context).colorScheme.secondary),),),), + SizedBox( + height: 10, + ), + Center( + child: TextButton( + onPressed: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => FavouritesScreen())); + }, + child: Text( + AppLocalizations.of(context)?.seefavourites ?? "", + style: + TextStyle(color: Theme.of(context).colorScheme.secondary), + ), + ), + ), SizedBox(height: 15.0), Container( padding: EdgeInsets.all(35.0), @@ -145,7 +153,7 @@ class _HomeScreenState extends State with WidgetsBindingObserver { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - AppLocalizations.of(context).recentalerts, + AppLocalizations.of(context)?.recentalerts ?? "", style: TextStyle( color: Colors.white, fontSize: 20.0, @@ -156,7 +164,7 @@ class _HomeScreenState extends State with WidgetsBindingObserver { RecentsAlerts(), Center( child: Text( - AppLocalizations.of(context).viewall, + AppLocalizations.of(context)?.viewall ?? "", style: TextStyle( color: Theme.of(context).colorScheme.secondary, fontSize: 15.0), @@ -164,7 +172,7 @@ class _HomeScreenState extends State with WidgetsBindingObserver { ), SizedBox(height: 20.0), Text( - AppLocalizations.of(context).recenthomework, + AppLocalizations.of(context)?.recenthomework ?? "", style: TextStyle( color: Colors.white, fontSize: 20.0, @@ -208,8 +216,8 @@ class DataSearch extends SearchDelegate { @override ThemeData appBarTheme(BuildContext context) { return Theme.of(context).copyWith( - scaffoldBackgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8), - + scaffoldBackgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), appBarTheme: AppBarTheme( backgroundColor: Colors.black, titleTextStyle: TextStyle(color: kTextColor), @@ -252,18 +260,21 @@ class DataSearch extends SearchDelegate { final List suggestionList = query.isEmpty ? recentAlerts : recentAlerts - .where((p) => p.title.toLowerCase().contains(query.toLowerCase())) - .toList(); + .where((p) => p.title.toLowerCase().contains(query.toLowerCase())) + .toList(); if (query.isEmpty) { return Center( - child: Text('Search for the notes here', style: TextStyle(color: Colors.white),), + child: Text( + 'Search for the notes here', + style: TextStyle(color: Colors.white), + ), ); } return SingleChildScrollView( - - child: Padding( - padding: EdgeInsets.all(8.0), - child: Container(child: Column( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( children: [ Column( children: [ @@ -382,7 +393,7 @@ class DataSearch extends SearchDelegate { padding: EdgeInsets.all(20.0), child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, children: [ Text( "$hoursLeft", @@ -476,13 +487,13 @@ class DataSearch extends SearchDelegate { ), child: Row( crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Container( width: 100, @@ -555,9 +566,10 @@ class DataSearch extends SearchDelegate { style: ElevatedButton.styleFrom( shape: CircleBorder( side: BorderSide(color: Theme.of(context).colorScheme.secondary), - ), backgroundColor: homework.isDone - ? Theme.of(context).colorScheme.secondary - : Colors.transparent, + ), + backgroundColor: homework.isDone + ? Theme.of(context).colorScheme.secondary + : Colors.transparent, ), child: homework.isDone ? Icon(Icons.check, color: Colors.white) : null, ); @@ -622,10 +634,10 @@ class AssignmentData { final Duration timeSpent; AssignmentData( - this.date, - this.score, - this.assignmentNumber, - this.subject, - this.timeSpent, - ); -} \ No newline at end of file + this.date, + this.score, + this.assignmentNumber, + this.subject, + this.timeSpent, + ); +} diff --git a/lib/screens/homework_screen.dart b/lib/screens/homework_screen.dart index 5f59256d2f..e92a1d6eb3 100644 --- a/lib/screens/homework_screen.dart +++ b/lib/screens/homework_screen.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:friday/widgets/recents_homeworks.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:friday/widgets/recents_homeworks.dart'; class HomeworkScreen extends StatefulWidget { @override @@ -11,14 +11,15 @@ class _HomeworkScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8), + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), body: SafeArea( child: SingleChildScrollView( child: Column( children: [ SizedBox(height: 30.0), Text( - AppLocalizations.of(context).recenthomework, + AppLocalizations.of(context)?.recenthomework ?? "", style: TextStyle( color: Colors.white, fontSize: 30.0, @@ -44,4 +45,4 @@ class _HomeworkScreenState extends State { ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/profile_screen.dart b/lib/screens/profile_screen.dart index 87020fd137..2e2238a7ca 100644 --- a/lib/screens/profile_screen.dart +++ b/lib/screens/profile_screen.dart @@ -1,23 +1,21 @@ import 'dart:io'; +import 'package:firebase_storage/firebase_storage.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_share/flutter_share.dart'; import 'package:friday/constants.dart'; import 'package:friday/models/users.dart'; import 'package:friday/screens/onboarding_page.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:friday/screens/settings_screen.dart'; import 'package:friday/services/authentication.dart'; import 'package:friday/services/facebookAuthentication.dart'; import 'package:friday/services/googleAuthentication.dart'; +import 'package:friday/services/user_db_services.dart'; import 'package:friday/services/user_info_services.dart'; import 'package:friday/utils/bottom_navbar_tabs.dart'; -import 'package:firebase_storage/firebase_storage.dart'; -import 'package:flutter/material.dart'; import 'package:image_picker/image_picker.dart'; -import 'package:provider/provider.dart'; -import 'package:share_plus/share_plus.dart'; import 'package:path/path.dart' as Path; -import 'package:friday/services/user_db_services.dart'; +import 'package:provider/provider.dart'; class ProfileScreen extends StatefulWidget { @override @@ -46,20 +44,21 @@ class _ProfileScreenState extends State { uploadPictures(File image) async { // uploads picture(s) to storage and return it's URL final Reference ref = - _storageReference.child('${Path.basename(image.path)}}'); + _storageReference.child('${Path.basename(image.path)}}'); final UploadTask uploadTask = ref.putFile(image); - String pictureUrl = await uploadTask.then((taskSnapshot) async { - return await taskSnapshot.ref.getDownloadURL(); - }, + String pictureUrl = await uploadTask.then( + (taskSnapshot) async { + return await taskSnapshot.ref.getDownloadURL(); + }, ); // UploadTaskSnapshot uploadTaskSnapshot = await uploadTask.future; // String pictureUrl = uploadTaskSnapshot.downloadUrl.toString(); final userInfoProvider = - Provider.of(context, listen: false); + Provider.of(context, listen: false); Users? currentUser = userInfoProvider.user; currentUser?.profilePictureUrl = pictureUrl; @@ -73,7 +72,8 @@ class _ProfileScreenState extends State { bool visibilityFields = false; void submitProfile() async { - final userInfoProvider = Provider.of(context, listen: false); + final userInfoProvider = + Provider.of(context, listen: false); Users? currentUser = userInfoProvider.user; currentUser?.bio = bio; userInfoProvider.setUser(currentUser!); @@ -89,34 +89,40 @@ class _ProfileScreenState extends State { void shareapp() async { await FlutterShare.share( title: 'Friday: Your personal class assistant!', - text: 'Check out Friday: Your Personal Class Manager Assistant, It\'ll never let you miss another assignment deadline or upcoming test. Download from play store : https://play.google.com/store/apps/details?id=com.avinashkranjan.friday', - linkUrl: 'https://play.google.com/store/apps/details?id=com.avinashkranjan.friday', + text: + 'Check out Friday: Your Personal Class Manager Assistant, It\'ll never let you miss another assignment deadline or upcoming test. Download from play store : https://play.google.com/store/apps/details?id=com.avinashkranjan.friday', + linkUrl: + 'https://play.google.com/store/apps/details?id=com.avinashkranjan.friday', chooserTitle: 'Friday!'); } + @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(elevation: 0,backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8),actions: [ - PopupMenuButton( - onSelected: (s) async { - }, - itemBuilder: (BuildContext context) { - return {'Share App'}.map((String choice) { - return PopupMenuItem( - value: choice, - child: Text(choice), - onTap: () { + appBar: AppBar( + elevation: 0, + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), + actions: [ + PopupMenuButton( + onSelected: (s) async {}, + itemBuilder: (BuildContext context) { + return {'Share App'}.map((String choice) { + return PopupMenuItem( + value: choice, + child: Text(choice), + onTap: () { shareapp(); - - }, - ); - }).toList(); - }, - ), - ], - - centerTitle: true,), - backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8), + }, + ); + }).toList(); + }, + ), + ], + centerTitle: true, + ), + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), body: SingleChildScrollView( physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()), child: Consumer( @@ -128,15 +134,14 @@ class _ProfileScreenState extends State { children: [ Column( children: [ - - Text( - AppLocalizations.of(context).yourprofile, - style: TextStyle( - color: Colors.white, - fontSize: 30.0, - fontWeight: FontWeight.bold, - ),), - + Text( + AppLocalizations.of(context)?.yourprofile ?? "", + style: TextStyle( + color: Colors.white, + fontSize: 30.0, + fontWeight: FontWeight.bold, + ), + ), SizedBox(height: 0.12 * MediaQuery.of(context).size.height), Container( margin: EdgeInsets.fromLTRB(15, 15, 15, 60), @@ -160,11 +165,10 @@ class _ProfileScreenState extends State { child: Visibility( visible: visibilityName, child: Text( - - userInfo.hasData - ? currentUser['name'] - : AppLocalizations.of(context).loading, - + userInfo.hasData + ? currentUser['name'] + : AppLocalizations.of(context)?.loading ?? + "", style: TextStyle( fontSize: 20, color: Colors.blue[200], @@ -175,20 +179,18 @@ class _ProfileScreenState extends State { ), SizedBox(height: 20), buildDetails( - AppLocalizations.of(context).email, - - userInfo.hasData - ? currentUser['email'] - : AppLocalizations.of(context).loading, + AppLocalizations.of(context)?.email ?? "", + userInfo.hasData + ? currentUser['email'] + : AppLocalizations.of(context)?.loading ?? "", + true), + SizedBox(height: 20), + buildDetails( + AppLocalizations.of(context)?.bio ?? "", + userInfo.hasData + ? currentUser['bio'] ?? 'No bio available' + : AppLocalizations.of(context)?.loading ?? "", true), - SizedBox(height: 20), - buildDetails( - AppLocalizations.of(context).bio, - userInfo.hasData - ? currentUser['bio'] - ?? 'No bio available' : AppLocalizations.of(context).loading, - true), - SizedBox(height: 20), Visibility( visible: visibilityFields, @@ -209,10 +211,12 @@ class _ProfileScreenState extends State { child: TextField( decoration: InputDecoration( focusedBorder: UnderlineInputBorder( - borderSide: BorderSide(color: kAuthThemeColor, width: 3), + borderSide: BorderSide( + color: kAuthThemeColor, width: 3), ), enabledBorder: UnderlineInputBorder( - borderSide: BorderSide(color: kAuthThemeColor, width: 3), + borderSide: BorderSide( + color: kAuthThemeColor, width: 3), ), ), style: TextStyle(color: Colors.white), @@ -228,60 +232,56 @@ class _ProfileScreenState extends State { ), ), buildDetails( - AppLocalizations.of(context).college, - - userInfo.hasData - ? currentUser['university'] - : AppLocalizations.of(context).loading, - + AppLocalizations.of(context)?.college ?? "", + userInfo.hasData + ? currentUser['university'] + : AppLocalizations.of(context)?.loading ?? "", true), SizedBox(height: 20), buildDetails( - AppLocalizations.of(context).course, - - userInfo.hasData - ? currentUser['course'] - : AppLocalizations.of(context).loading, - + AppLocalizations.of(context)?.course ?? "", + userInfo.hasData + ? currentUser['course'] + : AppLocalizations.of(context)?.loading ?? "", true), SizedBox(height: 20), buildDetails( - AppLocalizations.of(context).departmentmajor, - - userInfo.hasData - ? currentUser['department'] - : AppLocalizations.of(context).loading, + AppLocalizations.of(context)?.departmentmajor ?? + "", + userInfo.hasData + ? currentUser['department'] + : AppLocalizations.of(context)?.loading ?? "", true), SizedBox(height: 20), buildDetails( - AppLocalizations.of(context).currentacademicyear, - - userInfo.hasData - ? currentUser['year'].toString() - : AppLocalizations.of(context).loading, + AppLocalizations.of(context) + ?.currentacademicyear ?? + "", + userInfo.hasData + ? currentUser['year'].toString() + : AppLocalizations.of(context)?.loading ?? "", true), SizedBox(height: 20), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ buildDetails( - AppLocalizations.of(context).gender, + AppLocalizations.of(context)?.gender ?? "", userInfo.hasData - - ? enumToString(currentUser['gender']) - : AppLocalizations.of(context).loading, - + ? enumToString(currentUser['gender']) + : AppLocalizations.of(context)?.loading ?? + "", true), SizedBox(width: 20), Visibility( visible: !visibilityFields, child: buildDetails( - AppLocalizations.of(context).age, - - userInfo.hasData - ? currentUser['age'].toString() - : AppLocalizations.of(context).loading, - + AppLocalizations.of(context)?.age ?? "", + userInfo.hasData + ? currentUser['age'].toString() + : AppLocalizations.of(context) + ?.loading ?? + "", visibilityName), ), Visibility( @@ -321,9 +321,11 @@ class _ProfileScreenState extends State { onChanged: (value) { setState(() async { if (value != '') { - currentUser['age'] = int.parse(value); + currentUser['age'] = + int.parse(value); await UserDBServices.updateAge( - currentUser['uid'], int.parse(value)); + currentUser['uid'], + int.parse(value)); } }); }, @@ -341,8 +343,8 @@ class _ProfileScreenState extends State { onPressed: () async { print("Signing out"); await Provider.of( - context, - listen: false) + context, + listen: false) .resetCurrentIndex(); var _gAuth = GoogleAuthenticate(context); bool gResponse = await _gAuth.logOut(); @@ -362,13 +364,14 @@ class _ProfileScreenState extends State { context, MaterialPageRoute( builder: (_) => OnboardingPage()), - (Route route) => false, + (Route route) => false, ); } } }, style: OutlinedButton.styleFrom( - foregroundColor: Colors.transparent, side: BorderSide(color: Colors.red), + foregroundColor: Colors.transparent, + side: BorderSide(color: Colors.red), padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), shape: StadiumBorder(), @@ -392,10 +395,11 @@ class _ProfileScreenState extends State { child: CircleAvatar( radius: profilePictureDiameter / 2, backgroundImage: currentUser != null && - currentUser['profilePictureUrl'] != null && - currentUser['profilePictureUrl'].isNotEmpty + currentUser['profilePictureUrl'] != null && + currentUser['profilePictureUrl'].isNotEmpty ? NetworkImage(currentUser['profilePictureUrl']) - : AssetImage("assets/images/profile_pic.jpg") as ImageProvider?, + : AssetImage("assets/images/profile_pic.jpg") + as ImageProvider?, backgroundColor: Colors.transparent, foregroundColor: Theme.of(context).colorScheme.background, ), @@ -446,11 +450,11 @@ class _ProfileScreenState extends State { decoration: InputDecoration( focusedBorder: UnderlineInputBorder( borderSide: - BorderSide(color: kAuthThemeColor, width: 3), + BorderSide(color: kAuthThemeColor, width: 3), ), enabledBorder: UnderlineInputBorder( borderSide: - BorderSide(color: kAuthThemeColor, width: 3), + BorderSide(color: kAuthThemeColor, width: 3), ), ), style: TextStyle(color: Colors.white), @@ -459,7 +463,8 @@ class _ProfileScreenState extends State { setState(() async { if (value != '') { currentUser['name'] = value; - await UserDBServices.updateName(currentUser['uid'], value); + await UserDBServices.updateName( + currentUser['uid'], value); } }); }, diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index 1bbf62ced0..14d9979085 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -1,19 +1,18 @@ import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:friday/screens/faqs_screen.dart'; import 'package:friday/screens/help_screen.dart'; import 'package:friday/screens/themes.dart'; import 'package:friday/utils/notifications.dart'; import 'package:open_url/open_url.dart'; import 'package:provider/provider.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import '../models/users.dart'; -import '../services/theme_provider.dart'; -import '../services/user_info_services.dart'; import 'package:settings_ui/settings_ui.dart'; -import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../models/users.dart'; +import '../services/theme_provider.dart'; +import '../services/user_info_services.dart'; class SettingsScreen extends StatefulWidget { @override @@ -39,26 +38,26 @@ class _SettingsScreenState extends State { void initState() { // TODO: implement initState checknotify(); - _currentTheme = ThemeMode.system == ThemeMode.light ? lightTheme : darkTheme; + _currentTheme = + ThemeMode.system == ThemeMode.light ? lightTheme : darkTheme; super.initState(); } void notificationsInitialize() async { FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = - FlutterLocalNotificationsPlugin(); + FlutterLocalNotificationsPlugin(); const AndroidInitializationSettings initializationSettingsAndroid = - AndroidInitializationSettings('app_icon'); + AndroidInitializationSettings('app_icon'); final DarwinInitializationSettings initializationSettingsDarwin = - DarwinInitializationSettings( - onDidReceiveLocalNotification: null); + DarwinInitializationSettings(onDidReceiveLocalNotification: null); final LinuxInitializationSettings initializationSettingsLinux = - LinuxInitializationSettings( - defaultActionName: 'Open notification'); - final InitializationSettings initializationSettings = InitializationSettings( - android: initializationSettingsAndroid, - iOS: initializationSettingsDarwin, - macOS: initializationSettingsDarwin, - linux: initializationSettingsLinux); + LinuxInitializationSettings(defaultActionName: 'Open notification'); + final InitializationSettings initializationSettings = + InitializationSettings( + android: initializationSettingsAndroid, + iOS: initializationSettingsDarwin, + macOS: initializationSettingsDarwin, + linux: initializationSettingsLinux); await flutterLocalNotificationsPlugin.initialize(initializationSettings, onDidReceiveNotificationResponse: null); } @@ -66,21 +65,22 @@ class _SettingsScreenState extends State { Future checknotify() async { final SharedPreferences prefs = await SharedPreferences.getInstance(); notification = prefs.getBool('notification'); - if(notification==null){ + if (notification == null) { notification = true; } - } - @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(elevation: 0,backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8), - - centerTitle: true,), - backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8), + appBar: AppBar( + elevation: 0, + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), + centerTitle: true, + ), + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), body: SingleChildScrollView( scrollDirection: Axis.vertical, physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()), @@ -94,12 +94,13 @@ class _SettingsScreenState extends State { Column( children: [ Text( - AppLocalizations.of(context).settings, + AppLocalizations.of(context)?.settings ?? "", style: TextStyle( color: Colors.white, fontSize: 30.0, fontWeight: FontWeight.bold, - ),), + ), + ), SizedBox(height: 0.12 * MediaQuery.of(context).size.height), Container( margin: EdgeInsets.fromLTRB(15, 15, 15, 60), @@ -112,119 +113,151 @@ class _SettingsScreenState extends State { ), ), width: double.infinity, - child: - - SizedBox(height: MediaQuery.of(context).size.height ,width: MediaQuery.of(context).size.width,child:SettingsList( - lightTheme: SettingsThemeData(settingsListBackground: Theme.of(context).primaryColor, titleTextColor: Theme.of(context).secondaryHeaderColor, - settingsTileTextColor: Colors.white, leadingIconsColor: Colors.white, dividerColor: Colors.white70, tileDescriptionTextColor: Theme.of(context).primaryColorDark) - - ,sections: [ - SettingsSection( - - title: Text(AppLocalizations.of(context).common), - tiles: [ - SettingsTile.navigation( - leading: Icon(Icons.language), - onPressed: (c) { - ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text("Currently support is for Single language only. Stay tuned!"), - )); - }, - title: Text(AppLocalizations.of(context).language), - value: Text('English'), - ), - SettingsTile.switchTile(initialValue: modeval, onToggle: (s) { - final themeProvider = - Provider.of(context, listen: false); - setState(() { - modeval = s; - }); - if(modeval) { - setState(() { - themeProvider.setLightMode(); - }); - } - else { - setState(() { - themeProvider.setDarkmode(); - }); - } - - }, title: Text(AppLocalizations.of(context).lightmode), enabled: true, leading: Icon(Icons.light_mode),), - - SettingsTile.navigation( - leading: Icon(Icons.notifications_active_outlined), - title: Text(AppLocalizations.of(context).notifications), - onPressed: (s) async { - - NotificationService().showNotification(title: 'olalalaaa', body: 'it works'); - - //if(notification!){ - //await FlutterLocalNotificationsPlugin().cancelAll(); - //ScaffoldMessenger.of(context).showSnackBar(SnackBar( - // content: Text("Notifications turned off!"), - //)); - //} - //else { - //notificationsInitialize(); - //ScaffoldMessenger.of(context).showSnackBar(SnackBar( - // content: Text("Notifications turned on!"), - //)); - //} - - - - //notificationsInitialize(); - }, - value: Text(AppLocalizations.of(context).notificationsdesc), - ), - - SettingsTile.navigation( - leading: Icon(Icons.help_outline), - title: Text(AppLocalizations.of(context).help), - onPressed: (s) { - Navigator.of(context).push(MaterialPageRoute(builder: (context) => HelpScreen())); - }, - value: Text(AppLocalizations.of(context).helpdesc), - ), - - - SettingsTile.navigation( - leading: Icon(Icons.info_outlined), - title: Text(AppLocalizations.of(context).faqs), - value: Text(AppLocalizations.of(context).faqsdesc), - onPressed: (s) { - Navigator.of(context).push(MaterialPageRoute(builder: (context) => FAQScreen())); - }, + child: SizedBox( + height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, + child: SettingsList( + lightTheme: SettingsThemeData( + settingsListBackground: + Theme.of(context).primaryColor, + titleTextColor: + Theme.of(context).secondaryHeaderColor, + settingsTileTextColor: Colors.white, + leadingIconsColor: Colors.white, + dividerColor: Colors.white70, + tileDescriptionTextColor: + Theme.of(context).primaryColorDark), + sections: [ + SettingsSection( + title: Text( + AppLocalizations.of(context)?.common ?? ""), + tiles: [ + SettingsTile.navigation( + leading: Icon(Icons.language), + onPressed: (c) { + ScaffoldMessenger.of(context) + .showSnackBar(SnackBar( + content: Text( + "Currently support is for Single language only. Stay tuned!"), + )); + }, + title: Text(AppLocalizations.of(context) + ?.language ?? + ""), + value: Text('English'), + ), + SettingsTile.switchTile( + initialValue: modeval, + onToggle: (s) { + final themeProvider = + Provider.of(context, + listen: false); + setState(() { + modeval = s; + }); + if (modeval) { + setState(() { + themeProvider.setLightMode(); + }); + } else { + setState(() { + themeProvider.setDarkmode(); + }); + } + }, + title: Text(AppLocalizations.of(context) + ?.lightmode ?? + ""), + enabled: true, + leading: Icon(Icons.light_mode), + ), + SettingsTile.navigation( + leading: Icon( + Icons.notifications_active_outlined), + title: Text(AppLocalizations.of(context) + ?.notifications ?? + ""), + onPressed: (s) async { + NotificationService().showNotification( + title: 'olalalaaa', body: 'it works'); + + //if(notification!){ + //await FlutterLocalNotificationsPlugin().cancelAll(); + //ScaffoldMessenger.of(context).showSnackBar(SnackBar( + // content: Text("Notifications turned off!"), + //)); + //} + //else { + //notificationsInitialize(); + //ScaffoldMessenger.of(context).showSnackBar(SnackBar( + // content: Text("Notifications turned on!"), + //)); + //} + + //notificationsInitialize(); + }, + value: Text(AppLocalizations.of(context) + ?.notificationsdesc ?? + ""), + ), + SettingsTile.navigation( + leading: Icon(Icons.help_outline), + title: Text( + AppLocalizations.of(context)?.help ?? + ""), + onPressed: (s) { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => + HelpScreen())); + }, + value: Text(AppLocalizations.of(context) + ?.helpdesc ?? + ""), + ), + SettingsTile.navigation( + leading: Icon(Icons.info_outlined), + title: Text( + AppLocalizations.of(context)?.faqs ?? + ""), + value: Text(AppLocalizations.of(context) + ?.faqsdesc ?? + ""), + onPressed: (s) { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => + FAQScreen())); + }, + ), + SettingsTile.navigation( + leading: Icon(Icons.support), + title: Text(AppLocalizations.of(context) + ?.supportdevelopment ?? + ""), + onPressed: (s) async { + //js.context.callMethod('open', ['https://github.com/avinashkranjan/Friday']); + final result = await openUrl( + 'https://github.com/avinashkranjan/Friday'); + int a = result.exitCode; + if (a == 0) { + print('URL opened in your system!'); + print('\n'); + } else { + print( + 'Something went wrong with exit code = ${result.exitCode}: ' + '${result.stderr}'); + } + }, + value: Text(AppLocalizations.of(context) + ?.supportdevelopmentdesc ?? + ""), + ), + ], ), - SettingsTile.navigation( - leading: Icon(Icons.support), - title: Text(AppLocalizations.of(context).supportdevelopment), - onPressed: (s) async { - //js.context.callMethod('open', ['https://github.com/avinashkranjan/Friday']); - final result = await openUrl('https://github.com/avinashkranjan/Friday'); - int a = result.exitCode; - if (a == 0) { - print('URL opened in your system!'); - print('\n'); - } else { - print('Something went wrong with exit code = ${result.exitCode}: ' - '${result.stderr}'); - } - - }, - value: Text(AppLocalizations.of(context).supportdevelopmentdesc), - ), - ], ), - ], - ),) - - - - ), - + )), ], ), ], diff --git a/lib/widgets/header.dart b/lib/widgets/header.dart index d009daed9d..9623215d1f 100644 --- a/lib/widgets/header.dart +++ b/lib/widgets/header.dart @@ -1,8 +1,8 @@ -import 'package:friday/services/user_info_services.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:friday/services/user_info_services.dart'; import 'package:provider/provider.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; class Header extends StatelessWidget { @override @@ -25,10 +25,9 @@ class Header extends StatelessWidget { FittedBox( fit: BoxFit.fitWidth, child: Text( - - _userInfo.user != null - ? "Hello, " + _userInfo.user!.name.split(" ")[0] - : AppLocalizations.of(context).hellosir, + _userInfo.user != null + ? "Hello, " + _userInfo.user!.name.split(" ")[0] + : AppLocalizations.of(context)?.hellosir ?? "", style: TextStyle( color: Colors.white, fontSize: 25.0, @@ -42,9 +41,11 @@ class Header extends StatelessWidget { ), CircleAvatar( radius: 25.0, - backgroundImage: _userInfo.user != null && _userInfo.user!.profilePictureUrl.isNotEmpty + backgroundImage: _userInfo.user != null && + _userInfo.user!.profilePictureUrl.isNotEmpty ? NetworkImage(_userInfo.user!.profilePictureUrl) - : AssetImage("assets/images/profile_pic.jpg") as ImageProvider, + : AssetImage("assets/images/profile_pic.jpg") + as ImageProvider, ), ], ); @@ -54,4 +55,4 @@ class Header extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/recents_alerts.dart b/lib/widgets/recents_alerts.dart index ff411c3b4f..dee84ea9bb 100644 --- a/lib/widgets/recents_alerts.dart +++ b/lib/widgets/recents_alerts.dart @@ -1,24 +1,21 @@ -import 'package:flutter/material.dart'; -import 'package:friday/models/users.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_icons_null_safety/flutter_icons_null_safety.dart'; -import 'package:friday/services/classes_db_services.dart'; -import 'package:intl/intl.dart'; import 'package:friday/constants.dart'; import 'package:friday/models/alert.dart'; -import 'dart:convert'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:friday/widgets/countdown_painter.dart'; +import 'package:intl/intl.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:shared_preferences_android/shared_preferences_android.dart'; class RecentsAlerts extends StatefulWidget { @override State createState() => _RecentsAlertsState(); } -class _RecentsAlertsState extends State with WidgetsBindingObserver { +class _RecentsAlertsState extends State + with WidgetsBindingObserver { final DateFormat dateFormat = DateFormat("hh:mm a"); late List impstuff; late SharedPreferences preferences; @@ -39,7 +36,6 @@ class _RecentsAlertsState extends State with WidgetsBindingObserv @override void didChangeAppLifecycleState(AppLifecycleState state) { - loadalerts(); loadpref(); @@ -57,7 +53,6 @@ class _RecentsAlertsState extends State with WidgetsBindingObserv hoursLeft = hoursLeft < 0 ? -hoursLeft : 0; double percent = hoursLeft / 48; - return Row( children: [ Container( @@ -112,7 +107,6 @@ class _RecentsAlertsState extends State with WidgetsBindingObserv fontSize: 15.0, ), ), - ], ), SizedBox(height: 10.0), @@ -140,17 +134,25 @@ class _RecentsAlertsState extends State with WidgetsBindingObserv color: Theme.of(context).colorScheme.secondary, size: 17.0, ), - SizedBox(width: 10,), - Text('Mark as Important :', style: TextStyle(color: kTextColor),), - Checkbox(value: impstuff[index]=='false'?false:true, onChanged: (s) async { - impstuff[index] = s.toString(); - await preferences.setStringList('favbool', impstuff).then((value) => print(impstuff)); - - setState(() { - impstuff; - }); - - }) + SizedBox( + width: 10, + ), + Text( + 'Mark as Important :', + style: TextStyle(color: kTextColor), + ), + Checkbox( + value: impstuff[index] == 'false' ? false : true, + onChanged: (s) async { + impstuff[index] = s.toString(); + await preferences + .setStringList('favbool', impstuff) + .then((value) => print(impstuff)); + + setState(() { + impstuff; + }); + }) ], ) ], @@ -178,7 +180,7 @@ class _RecentsAlertsState extends State with WidgetsBindingObserv ), ), Text( - AppLocalizations.of(context).hoursleft, + AppLocalizations.of(context)?.hoursleft ?? "", style: TextStyle( color: _getColor(context, percent), fontSize: 13.0, @@ -204,31 +206,25 @@ class _RecentsAlertsState extends State with WidgetsBindingObserv return kHourColor; } - void loadpref() async{ + void loadpref() async { preferences = await SharedPreferences.getInstance(); impstuff = await preferences.getStringList('favbool')!; setState(() { impstuff; }); - } - } - - void loadalerts() async { - - final DocumentSnapshot> documentSnapShot = await FirebaseFirestore.instance - .doc('users/${FirebaseAuth.instance.currentUser?.uid}') - .get(); - - Map _classesListStored = Map(); - if(documentSnapShot.data()!=null) { - _classesListStored = (documentSnapShot.data())!; - print(_classesListStored); - print('yha ka hai'); - - } +void loadalerts() async { + final DocumentSnapshot> documentSnapShot = + await FirebaseFirestore.instance + .doc('users/${FirebaseAuth.instance.currentUser?.uid}') + .get(); + + Map _classesListStored = Map(); + if (documentSnapShot.data() != null) { + _classesListStored = (documentSnapShot.data())!; + print(_classesListStored); + print('yha ka hai'); } - - +} From d315793cb1731402573b478e2013dbe80ff447e8 Mon Sep 17 00:00:00 2001 From: Nishant Shingate Date: Tue, 17 Oct 2023 19:54:45 +0530 Subject: [PATCH 3/5] updated theme --- lib/screens/themes.dart | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/screens/themes.dart b/lib/screens/themes.dart index 30699c62a8..020692c39d 100644 --- a/lib/screens/themes.dart +++ b/lib/screens/themes.dart @@ -1,16 +1,12 @@ import 'package:flutter/material.dart'; - - final lightTheme = ThemeData( - - .copyWith(secondary: Colors.white) - .copyWith(primary: Colors.black), - + colorScheme: ColorScheme.fromSwatch() + .copyWith(secondary: Colors.white) + .copyWith(primary: Colors.black), ); final darkTheme = ThemeData( - primaryColor: Color(0xFF202328), visualDensity: VisualDensity.adaptivePlatformDensity, colorScheme: ColorScheme.fromSwatch() From a95d36596a410d7e09c565d764fd7eb23efd9fc3 Mon Sep 17 00:00:00 2001 From: Nishant Shingate Date: Wed, 18 Oct 2023 14:57:43 +0530 Subject: [PATCH 4/5] fixed chart --- lib/screens/classes_screen.dart | 60 ++++++++++++++++----------------- lib/screens/home_screen.dart | 48 ++++++++++++++++++-------- pubspec.lock | 32 ++++++++++++++++++ pubspec.yaml | 5 ++- 4 files changed, 100 insertions(+), 45 deletions(-) diff --git a/lib/screens/classes_screen.dart b/lib/screens/classes_screen.dart index f177e81858..aa57219772 100644 --- a/lib/screens/classes_screen.dart +++ b/lib/screens/classes_screen.dart @@ -1,11 +1,11 @@ -import 'package:friday/models/users.dart'; -import 'package:friday/services/classes_db_services.dart'; -import 'package:date_time_picker/date_time_picker.dart'; +import 'package:date_time_picker_selector/date_time_picker_selector.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:friday/constants.dart'; +import 'package:friday/models/users.dart'; +import 'package:friday/services/classes_db_services.dart'; import 'package:friday/widgets/build_classes.dart'; import 'package:friday/widgets/header.dart'; -import 'package:flutter/services.dart'; import 'package:intl/intl.dart'; TextEditingController dateController = TextEditingController(); @@ -94,11 +94,11 @@ class _ClassesScreenState extends State { }, items: Mode.values .map((selectedMode) => DropdownMenuItem( - value: selectedMode, - child: Text( - modeEnumToString(selectedMode), - style: TextStyle(color: Colors.white), - ))) + value: selectedMode, + child: Text( + modeEnumToString(selectedMode), + style: TextStyle(color: Colors.white), + ))) .toList(), value: null, onChanged: (Mode? mode) { @@ -359,10 +359,10 @@ class CalenderDateFormatAddition extends StatelessWidget { final int dayAdditon; final bool itemSelected; - CalenderDateFormatAddition({ - required this.dateTime, - required this.dayAdditon, - this.itemSelected = false}); + CalenderDateFormatAddition( + {required this.dateTime, + required this.dayAdditon, + this.itemSelected = false}); @override Widget build(BuildContext context) { @@ -373,29 +373,29 @@ class CalenderDateFormatAddition extends StatelessWidget { TextSpan( text: (dayAdditon > 0) ? dateTime.add(Duration(days: dayAdditon)).day.toString() + - '\n' + '\n' : dateTime - .subtract(Duration(days: dayAdditon * -1)) - .day - .toString() + - '\n', + .subtract(Duration(days: dayAdditon * -1)) + .day + .toString() + + '\n', style: (itemSelected == true) ? kCalendarDay.copyWith( - color: Colors.white, - fontSize: 17.0, - fontWeight: FontWeight.w500, - ) + color: Colors.white, + fontSize: 17.0, + fontWeight: FontWeight.w500, + ) : kCalendarDay), TextSpan( text: (itemSelected == true) ? (dayAdditon > 0) - ? DateFormat.E() - .format(dateTime.add(Duration(days: dayAdditon))) - .toString() - : DateFormat.E() - .format( - dateTime.subtract(Duration(days: dayAdditon * -1))) - .toString() + ? DateFormat.E() + .format(dateTime.add(Duration(days: dayAdditon))) + .toString() + : DateFormat.E() + .format( + dateTime.subtract(Duration(days: dayAdditon * -1))) + .toString() : '', style: TextStyle( color: Colors.white, @@ -407,4 +407,4 @@ class CalenderDateFormatAddition extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 3e41915bdb..5c99a4cefc 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -1,4 +1,5 @@ -import 'package:charts_flutter/flutter.dart' as charts; +import 'package:d_chart/commons/data_model.dart'; +import 'package:d_chart/time/line.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart' show rootBundle; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -595,10 +596,17 @@ class ProgressChart extends StatelessWidget { ), SizedBox(height: 10.0), Expanded( - child: charts.TimeSeriesChart( - _createChartSeries(), - animate: true, + child: AspectRatio( + aspectRatio: 16 / 9, + child: DChartLineT( + // groupList: timeGroupList, + groupList: _createChartsSeries(), + ), ), + // child: charts.TimeSeriesChart( + // _createChartSeries(), + // animate: true, + // ), ), SizedBox(height: 10.0), Text( @@ -609,21 +617,33 @@ class ProgressChart extends StatelessWidget { fontWeight: FontWeight.bold, ), ), + SizedBox( + height: 30, + ) ], ); } - List> _createChartSeries() { - return [ - charts.Series( - id: 'Assignment Progress', - data: data, - domainFn: (AssignmentData assignment, _) => assignment.date, - measureFn: (AssignmentData assignment, _) => assignment.score, - colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, - ), - ]; + List _createChartsSeries() { + List timeDataList = data + .map( + (assignment) => + TimeData(domain: assignment.date, measure: assignment.score), + ) + .toList(); + return [TimeGroup(id: "Assignment Progress", data: timeDataList)]; } + // List> _createChartSeries() { + // return [ + // charts.Series( + // id: 'Assignment Progress', + // data: data, + // domainFn: (AssignmentData assignment, _) => assignment.date, + // measureFn: (AssignmentData assignment, _) => assignment.score, + // colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, + // ), + // ]; + // } } class AssignmentData { diff --git a/pubspec.lock b/pubspec.lock index 85fcb4c233..abb6da49f6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -105,6 +105,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.17.2" + community_charts_common: + dependency: "direct main" + description: + name: community_charts_common + sha256: "20697244c826df0545237ebe01d61caa96a2a2e4d23c6f88890441636a4d5220" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + community_charts_flutter: + dependency: "direct main" + description: + name: community_charts_flutter + sha256: ca5bd07337e162daee13c19679f602cd8b3f704520d242beeebbc2e312f84f89 + url: "https://pub.dev" + source: hosted + version: "1.0.2" convert: dependency: transitive description: @@ -137,6 +153,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" + d_chart: + dependency: "direct main" + description: + name: d_chart + sha256: "25383f0d0b71a3f540511573ac0603286b2d736ead55073d595b7f48764919e4" + url: "https://pub.dev" + source: hosted + version: "2.6.2" + date_time_picker_selector: + dependency: "direct main" + description: + name: date_time_picker_selector + sha256: d7e70109490ac778b6203f95578db06a21447df7a83d1d8e24dd80f2dd54291e + url: "https://pub.dev" + source: hosted + version: "2.2.0" dbus: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 14d1a860d9..13acf572bf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,7 +25,7 @@ dependencies: url_launcher: firebase_storage: path_provider: - # date_time_picker: + date_time_picker_selector: table_calendar: flutter_login_facebook: flutter_icons_null_safety: @@ -35,6 +35,9 @@ dependencies: is_first_run: shared_preferences: # charts_flutter: + d_chart: + community_charts_common: ^1.0.2 + community_charts_flutter: ^1.0.2 share_plus: flutter_share: settings_ui: From 09f406640e56a3b5f7441dc5a4dc98f87492ae56 Mon Sep 17 00:00:00 2001 From: Nishant Shingate Date: Wed, 18 Oct 2023 15:24:26 +0530 Subject: [PATCH 5/5] Fiixed #434 --- lib/localizationTexts/defaulttexts.dart | 75 ++++--- lib/localizationTexts/gujarati.dart | 45 +--- lib/localizationTexts/hindi.dart | 47 +--- lib/localizationTexts/kannada.dart | 45 +--- lib/localizationTexts/marathi.dart | 45 +--- lib/localizationTexts/russian.dart | 48 +---- lib/main.dart | 121 +++++------ lib/models/users.dart | 11 +- lib/screens/contact_us_screen.dart | 204 +++++++++--------- lib/screens/help_screen.dart | 143 ++++++------ lib/screens/splash.dart | 3 +- .../signup_form_additional_details.dart | 35 +-- 12 files changed, 321 insertions(+), 501 deletions(-) diff --git a/lib/localizationTexts/defaulttexts.dart b/lib/localizationTexts/defaulttexts.dart index 6521a89992..38e7c53ff6 100644 --- a/lib/localizationTexts/defaulttexts.dart +++ b/lib/localizationTexts/defaulttexts.dart @@ -1,85 +1,82 @@ -import 'package:flutter/material.dart'; - - class LocalizationsTexts { - +class LocalizationsTexts { static var friday = "Friday"; static var hellosir = "Hello, Sir!"; static var recentalerts = "Recent Alerts"; - static var viewall = "View all"; + static var viewall = "View all"; - static var seefavourites = "SEE FAVOURITES"; + static var seefavourites = "SEE FAVOURITES"; - static var search = "search"; + static var search = "search"; - static var recenthomework = "Recent Homework"; + static var recenthomework = "Recent Homework"; - static var favourites = "Favourites"; + static var favourites = "Favourites"; - static var clearallfavourites = "CLEAR ALL FAVOURITES"; + static var clearallfavourites = "CLEAR ALL FAVOURITES"; - static var hoursleft = "hours left"; + static var hoursleft = "hours left"; - static var addnewclass = "Add New Class"; + static var addnewclass = "Add New Class"; - static var mode = "Mode"; + static var mode = "Mode"; - static var teachername = "Teacher Name"; + static var teachername = "Teacher Name"; - static var date = "Date"; + static var date = "Date"; - static var time = "Time"; + static var time = "Time"; - static var joinlink = "Join Link"; + static var joinlink = "Join Link"; - static var subject = "Subject"; + static var subject = "Subject"; static var save = "Save"; - static var yourprofile = "Your Profile"; + static var yourprofile = "Your Profile"; - static var loading = "Loading..."; + static var loading = "Loading..."; - static var email = "Email"; + static var email = "Email"; - static var bio = "Bio"; + static var bio = "Bio"; - static var college = "College"; + static var college = "College"; - static var course = "Course"; + static var course = "Course"; static var departmentmajor = "Department/Major"; - static var currentacademicyear = "Current Academic Year"; + static var currentacademicyear = "Current Academic Year"; - static var gender = "Gender"; + static var gender = "Gender"; - static var age = "Age"; + static var age = "Age"; - static var settings = "Settings"; + static var settings = "Settings"; - static var common = "Common"; + static var common = "Common"; static var language = "Language"; - static var lightmode = "Light Mode"; + static var lightmode = "Light Mode"; - static var notifications = "Notifications"; + static var notifications = "Notifications"; - static var notificationsdesc = "Turn your app notifications on or off"; + static var notificationsdesc = "Turn your app notifications on or off"; - static var help = "Help"; + static var help = "Help"; - static var helpdesc = "See our help modules for queries"; + static var helpdesc = "See our help modules for queries"; - static var faqs = "FAQs"; + static var faqs = "FAQs"; - static var faqsdesc = "Basic usage guidelines"; + static var faqsdesc = "Basic usage guidelines"; static var supportdevelopment = "Support Development"; - static var supportdevelopmentdesc = "See latest issues and contribute to the project!"; - } - + static var supportdevelopmentdesc = + "See latest issues and contribute to the project!"; +} diff --git a/lib/localizationTexts/gujarati.dart b/lib/localizationTexts/gujarati.dart index 58143f40b0..2e63a16488 100644 --- a/lib/localizationTexts/gujarati.dart +++ b/lib/localizationTexts/gujarati.dart @@ -1,123 +1,82 @@ -import 'package:flutter/material.dart'; - class GujaratiTexts { - String get friday => 'શુક્રવાર'; - String get hellosir => 'નમસ્તે મહોદય!'; - String get recentalerts => 'આખરી ચેતવણીઓ'; - String get viewall => 'બધું જુઓ'; - String get seefavourites => 'પ્રિયતમો જુઓ'; - String get search => 'શોધો'; - String get recenthomework => 'આખરી હોમવર્ક'; - String get favourites => 'પ્રિયતમ'; - String get clearallfavourites => 'બધા પ્રિયતમો સાફ કરો'; - String get hoursleft => 'અવશેષ કરેલા કલાક'; - String get addnewclass => 'નવી શ્રેણી ઉમેરો'; - String get mode => 'પ્રકાર'; - String get teachername => 'શિક્ષકનું નામ'; - String get date => 'તારીખ'; - String get time => 'સમય'; - String get joinlink => 'લિંક થી જોડાઓ'; - String get subject => 'વિષય'; - String get save => 'સાચવો'; - String get yourprofile => 'તમારી પ્રોફાઇલ'; - String get loading => 'લોડ થાય છે...'; - String get email => 'ઇમેઇલ'; - String get bio => 'જીવનવર્ણન'; - String get college => 'કોલેજ'; - String get course => 'કોર્સનો પ્રકાર'; - String get departmentmajor => 'વિભાગ'; - String get currentacademicyear => 'વર્તમાન શૈક્ષણિક વર્ષ'; - String get gender => 'લિંગ'; - String get age => 'ઉંમર'; - String get settings => 'સેટિંગ્સ'; - String get common => 'સામાન્ય'; - String get language => 'ભાષા'; - String get lightmode => 'આલોક સ્થિતિ'; - String get notifications => 'સૂચનાઓ'; - String get notificationsdesc => 'એપની સૂચનાઓને ચાલુ અથવા બંધ કરો'; - String get help => 'મદદ'; - String get helpdesc => 'પ્રશ્નો માટે અમારી સહાયતા મોડ્યુલ જુઓ'; - String get faqs => 'સામાન્ય પ્રશ્નો'; - String get faqsdesc => 'મૂળ ઉપયોગ માર્ગદર્શનો'; - String get supportdevelopment => 'એપની વિકાસ સમર્થન કરો'; - - String get supportdevelopmentdesc => 'સમસ્યાઓને સમાધાન કરો, બગની રિપોર્ટ કરો, અને આદિ|'; + String get supportdevelopmentdesc => + 'સમસ્યાઓને સમાધાન કરો, બગની રિપોર્ટ કરો, અને આદિ|'; } diff --git a/lib/localizationTexts/hindi.dart b/lib/localizationTexts/hindi.dart index 8aa8b1a392..31325861bc 100644 --- a/lib/localizationTexts/hindi.dart +++ b/lib/localizationTexts/hindi.dart @@ -1,123 +1,82 @@ -import 'package:flutter/material.dart'; - class HindiTexts { - String get friday => 'शुक्रवार'; - String get hellosir => 'नमस्ते महोदय!'; - String get recentalerts => 'हालिया अलर्ट'; - String get viewall => 'सभी देखें'; - String get seefavourites => 'पसंदीदा देखें'; - String get search => 'खोजो'; - String get recenthomework => 'हालिया होमवर्क'; - String get favourites => 'पसंदीदा'; - String get clearallfavourites => 'सभी पसंदीदा साफ़ करें'; - String get hoursleft => 'घंटे बाकी है'; - String get addnewclass => 'नई कक्षा जोड़ें'; - String get mode => 'प्रकार'; - String get teachername => 'शिक्षक का नाम'; - String get date => 'तारीख'; - String get time => 'समय'; - String get joinlink => 'लिंक से जुड़ें'; - String get subject => 'विषय'; - String get save => 'इसे जोड़ें'; - String get yourprofile => 'आपकी प्रोफ़ाइल'; - String get loading => 'लोड हो रहा है...'; - String get email => 'ईमेल'; - String get bio => 'बायो'; - String get college => 'कॉलेज'; - String get course => 'पाठ्यक्रम प्रकार'; - String get departmentmajor => 'विभाग'; - String get currentacademicyear => 'वर्तमान शैक्षणिक वर्ष'; - String get gender => 'लिंग'; - String get age => 'आयु'; - String get settings => 'सेटिंग'; - String get common => 'सामान्य'; - String get language => 'भाषा'; - String get lightmode => 'प्रकाश मोड'; - String get notifications => 'सूचनाएं'; - String get notificationsdesc => 'ऐप के नोटिफिकेशन को चालू या बंद करें'; - String get help => 'मदद'; - String get helpdesc => 'प्रश्नों के लिए हमारे सहायता मॉड्यूल देखें'; - String get faqs => 'सामान्य प्रश्न'; - String get faqsdesc => 'बुनियादी उपयोग दिशानिर्देश'; - String get supportdevelopment => 'ऐप के विकास का समर्थन करें'; - - String get supportdevelopmentdesc => 'समस्याओं का समाधान करें, बग की रिपोर्ट करें, इत्यादि|'; -} \ No newline at end of file + String get supportdevelopmentdesc => + 'समस्याओं का समाधान करें, बग की रिपोर्ट करें, इत्यादि|'; +} diff --git a/lib/localizationTexts/kannada.dart b/lib/localizationTexts/kannada.dart index 01559c2b18..7c108f4ef9 100644 --- a/lib/localizationTexts/kannada.dart +++ b/lib/localizationTexts/kannada.dart @@ -1,123 +1,82 @@ -import 'package:flutter/material.dart'; - class KannadaTexts { - String get friday => 'ಶುಕ್ರವಾರ'; - String get hellosir => 'ನಮಸ್ಕಾರ ಸರ್!'; - String get recentalerts => 'ಇತ್ತಿಹಾಸ ಚೀಟಿಗಳು'; - String get viewall => 'ಎಲ್ಲವನ್ನು ವೀಕ್ಷಿಸಿ'; - String get seefavourites => 'ಪ್ರಿಯಪ್ರಿಯಗಳನ್ನು ವೀಕ್ಷಿಸಿ'; - String get search => 'ಹುಡುಕಿ'; - String get recenthomework => 'ಇತ್ತಿಹಾಸ ಮನೆಕಾರ್ಯ'; - String get favourites => 'ಪ್ರಿಯಪ್ರಿಯಗಳು'; - String get clearallfavourites => 'ಎಲ್ಲವನ್ನು ಸ್ವಚ್ಛಗೊಳಿಸಿ'; - String get hoursleft => 'ಉಳಿದ ಗಂಟೆಗಳು'; - String get addnewclass => 'ಹೊಸ ವರ್ಗವನ್ನು ಸೇರಿಸಿ'; - String get mode => 'ಮೋಡ್'; - String get teachername => 'ಶಿಕ್ಷಕರ ಹೆಸರು'; - String get date => 'ದಿನಾಂಕ'; - String get time => 'ಸಮಯ'; - String get joinlink => 'ಲಿಂಕ್‌ಗೆ ಸೇರಿರಿ'; - String get subject => 'ವಿಷಯ'; - String get save => 'ಸೇರಿಸಿ'; - String get yourprofile => 'ನಿಮ್ಮ ಪ್ರೊಫೈಲ್'; - String get loading => 'ಲೋಡ್ ಆಗುತ್ತಿದೆ...'; - String get email => 'ಇಮೇಲ್'; - String get bio => 'ಜೀವನಚರಿತ್ರೆ'; - String get college => 'ಕಾಲೇಜು'; - String get course => 'ಕೋರ್ಸ್ ರೀತಿ'; - String get departmentmajor => 'ವಿಭಾಗ'; - String get currentacademicyear => 'ಪ್ರಸ್ತುತ ಶಿಕ್ಷಣ ವರ್ಷ'; - String get gender => 'ಲಿಂಗ'; - String get age => 'ವಯಸ್ಸು'; - String get settings => 'ಸೆಟ್ಟಿಂಗ್‌ಗಳು'; - String get common => 'ಸಾಮಾನ್ಯ'; - String get language => 'ಭಾಷೆ'; - String get lightmode => 'ಬೆಳಕು ಮೋಡ್'; - String get notifications => 'ಅಧಿಸೂಚನೆಗಳು'; - String get notificationsdesc => 'ಆ್ಯಪ್‌ನ ಅಧಿಸೂಚನೆಗಳನ್ನು ಆನ್/ಆಫ್ ಮಾಡಿ'; - String get help => 'ಸಹಾಯ'; - String get helpdesc => 'ಪ್ರಶ್ನೆಗಳಿಗೆ ನಮ್ಮ ಸಹಾಯ ಮಾಡೂಲ್‌ಗಳನ್ನು ವೀಕ್ಷಿಸಿ'; - String get faqs => 'ಸಾಮಾನ್ಯ ಪ್ರಶ್ನೆಗಳು'; - String get faqsdesc => 'ಬುನಿಯಾದ ಬಳಕೆ ಮಾರ್ಗದರ್ಶಿಗಳು'; - String get supportdevelopment => 'ಆ್ಯಪ್‌ನ ಅಭಿವೃದ್ಧಿಯನ್ನು ಬೆಂಬಲಿಸಿ'; - - String get supportdevelopmentdesc => 'ಸಮಸ್ಯೆಗಳನ್ನು ಪರಿಹರಿಸಿ, ಬಗ್ ಅನ್ನು ಅಂಕಿತ ಮಾಡಿ, ಇತ್ಯಾದಿ|'; + String get supportdevelopmentdesc => + 'ಸಮಸ್ಯೆಗಳನ್ನು ಪರಿಹರಿಸಿ, ಬಗ್ ಅನ್ನು ಅಂಕಿತ ಮಾಡಿ, ಇತ್ಯಾದಿ|'; } diff --git a/lib/localizationTexts/marathi.dart b/lib/localizationTexts/marathi.dart index 1dce9df620..e7cc6d26a4 100644 --- a/lib/localizationTexts/marathi.dart +++ b/lib/localizationTexts/marathi.dart @@ -1,123 +1,82 @@ -import 'package:flutter/material.dart'; - class MarathiTexts { - String get friday => 'शुक्रवार'; - String get hellosir => 'नमस्ते महोदय!'; - String get recentalerts => 'हालच्या सूचना'; - String get viewall => 'सर्व पहा'; - String get seefavourites => 'पसंदीदा पहा'; - String get search => 'शोधा'; - String get recenthomework => 'हालच्या होमवर्क'; - String get favourites => 'पसंदीदा'; - String get clearallfavourites => 'सर्व पसंदीदा साफ करा'; - String get hoursleft => 'शिल्लक वेळ'; - String get addnewclass => 'नविन वर्ग जोडा'; - String get mode => 'प्रकार'; - String get teachername => 'शिक्षकाचे नाव'; - String get date => 'तारीख'; - String get time => 'वेळ'; - String get joinlink => 'लिंकद्वारे सामील व्हा'; - String get subject => 'विषय'; - String get save => 'जतन करा'; - String get yourprofile => 'तुमची प्रोफाइल'; - String get loading => 'लोड होत आहे...'; - String get email => 'ईमेल'; - String get bio => 'बायो'; - String get college => 'कॉलेज'; - String get course => 'पाठ्यक्रम प्रकार'; - String get departmentmajor => 'विभाग'; - String get currentacademicyear => 'चाललेला शैक्षणिक वर्ष'; - String get gender => 'लिंग'; - String get age => 'वय'; - String get settings => 'सेटिंग्ज'; - String get common => 'सामान्य'; - String get language => 'भाषा'; - String get lightmode => 'प्रकाश मोड'; - String get notifications => 'सूचना'; - String get notificationsdesc => 'ऐपच्या सूचना सुरू किंवा बंद करा'; - String get help => 'मदत'; - String get helpdesc => 'प्रश्नांसाठी आमच्या सहाय्यक मॉड्यूल पहा'; - String get faqs => 'सामान्य प्रश्ने'; - String get faqsdesc => 'मौलिक वापराच्या मार्गदर्शने'; - String get supportdevelopment => 'ऐपच्या विकासाचा समर्थन करा'; - - String get supportdevelopmentdesc => 'समस्या परिहार करा, बगची माहिती द्या, इत्यादी|'; + String get supportdevelopmentdesc => + 'समस्या परिहार करा, बगची माहिती द्या, इत्यादी|'; } diff --git a/lib/localizationTexts/russian.dart b/lib/localizationTexts/russian.dart index 95f0d617a5..9f223c6345 100644 --- a/lib/localizationTexts/russian.dart +++ b/lib/localizationTexts/russian.dart @@ -1,123 +1,83 @@ -import 'package:flutter/material.dart'; - class RussianTexts { - String get friday => 'Пятница'; - String get hellosir => 'Пятница!'; - String get recentalerts => 'последние оповещения'; - String get viewall => 'Посмотреть все'; - String get seefavourites => 'ПОСМОТРЕТЬ ИЗБРАННОЕ'; - String get search => 'поиск'; - String get recenthomework => 'Недавнее домашнее задание'; - String get favourites => 'Избранное'; - String get clearallfavourites => 'УДАЛИТЬ ВСЕ ИЗБРАННОЕ'; - String get hoursleft => 'часов осталось'; - String get addnewclass => 'Добавить новый класс'; - String get mode => 'Режим'; - String get teachername => 'Имя учителя'; - String get date => 'Дата'; - String get time => 'Время'; - String get joinlink => 'Присоединиться по ссылке'; - String get subject => 'Предмет'; - String get save => 'Сохранять'; - String get yourprofile => 'Ваш профиль'; - String get loading => 'Загрузка...'; - String get email => 'Электронная почта'; - String get bio => 'Био'; - String get college => 'Колледж'; - String get course => 'Курс'; - String get departmentmajor => 'Департамент/майор'; - String get currentacademicyear => 'Текущий учебный год'; - String get gender => 'Пол'; - String get age => 'Возраст'; - String get settings => 'Настройки'; - String get common => 'Общий'; - String get language => 'Язык'; - String get lightmode => 'Легкий режим'; - String get notifications => 'Уведомления'; - - String get notificationsdesc => 'Включите или отключите уведомления вашего приложения'; + String get notificationsdesc => + 'Включите или отключите уведомления вашего приложения'; - String get help => 'Помощь'; - String get helpdesc => 'См. наши справочные модули для запросов'; - String get faqs => 'Часто задаваемые вопросы'; - String get faqsdesc => 'Основные рекомендации по использованию'; - String get supportdevelopment => 'Поддержка развития'; - - String get supportdevelopmentdesc => 'Смотрите последние выпуски и внесите свой вклад в проект!'; + String get supportdevelopmentdesc => + 'Смотрите последние выпуски и внесите свой вклад в проект!'; } diff --git a/lib/main.dart b/lib/main.dart index c78f1cbadf..3eff9a84db 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,56 +1,52 @@ import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter_local_notifications/flutter_local_notifications.dart'; -import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:friday/feedback.dart'; import 'package:friday/models/alert.dart'; import 'package:friday/screens/faqs_screen.dart'; -import 'package:friday/screens/onboarding_page.dart'; +import 'package:friday/screens/phone_verification_screen.dart'; import 'package:friday/screens/splash.dart'; -import 'package:friday/screens/faqs_screen.dart'; - -import 'package:flutter/material.dart'; -import 'package:friday/feedback.dart'; import 'package:friday/screens/theme_screen.dart'; -import 'package:friday/services/phone_number_verification_db.dart'; -import 'package:friday/services/theme_provider.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:friday/screens/phone_verification_screen.dart'; import 'package:friday/screens/verify_code_screen.dart'; +///Project Local Imports +import 'package:friday/services/authentication.dart'; +import 'package:friday/services/phone_number_verification_db.dart'; +import 'package:friday/services/theme_provider.dart'; +import 'package:friday/services/user_info_services.dart'; import 'package:friday/utils/bottom_navbar_tabs.dart'; -import 'package:flutter/services.dart'; -import 'package:introduction_screen/introduction_screen.dart'; import 'package:is_first_run/is_first_run.dart'; import 'package:provider/provider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; -///Project Local Imports -import 'package:friday/services/authentication.dart'; -import 'package:friday/services/user_info_services.dart'; -import 'screens/settings_screen.dart'; -import 'screens/help_screen.dart'; -import 'screens/contact_us_screen.dart'; -import 'screens/app_info_screen.dart'; import 'onboarding/introslider.dart'; +import 'screens/app_info_screen.dart'; +import 'screens/contact_us_screen.dart'; +import 'screens/help_screen.dart'; +import 'screens/settings_screen.dart'; import 'utils/notifications.dart'; - void main() async { WidgetsFlutterBinding.ensureInitialized(); NotificationService().initNotification(); NotificationService().showNotification(title: 'olalalaaa', body: 'it works'); await Firebase.initializeApp(); - runApp(MultiProvider( // create the provider - providers: [ - ChangeNotifierProvider( - create: (_) => ThemeProvider(), - ) - ], - child: MyApp(), - ),); + runApp( + MultiProvider( + // create the provider + providers: [ + ChangeNotifierProvider( + create: (_) => ThemeProvider(), + ) + ], + child: MyApp(), + ), + ); } class MyApp extends StatefulWidget { - @override State createState() => _MyAppState(); } @@ -59,13 +55,11 @@ class _MyAppState extends State { bool isFirstRun = false; int backButtonPressCounter = 0; - @override void initState() { super.initState(); checkFirstRun(); - loadpref(); } @@ -77,6 +71,7 @@ class _MyAppState extends State { }); prefs.setBool('already_rated', false); } + Future showRatingDialog(BuildContext context) async { SharedPreferences prefs = await SharedPreferences.getInstance(); bool alreadyRated = prefs.getBool('already_rated') ?? false; @@ -132,7 +127,7 @@ class _MyAppState extends State { ) ], child: WillPopScope( - onWillPop:onWillPop, + onWillPop: onWillPop, child: MaterialApp( theme: Provider.of(context).currentTheme, localizationsDelegates: [ @@ -146,53 +141,55 @@ class _MyAppState extends State { Locale('ru'), Locale('en'), // English Locale('hi'), - Locale('gu'),// Hindi - Locale('mr')// Hindi + Locale('gu'), // Hindi + Locale('mr') // Hindi ], - debugShowCheckedModeBanner: false, - title: 'Friday', - - home: FutureBuilder( - future: Future.delayed(Duration(seconds: 3)), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return SplashScreen(key: UniqueKey()); - } else { - if (isFirstRun) { - return OnBoardingPage(); - } else { - WidgetsBinding.instance.addPostFrameCallback( - (_) => showRatingDialog(context), - ); - return AuthenticationService.handleEntryPoint(context); - - }}} - ), + debugShowCheckedModeBanner: false, + title: 'Friday', + home: FutureBuilder( + future: Future.delayed(Duration(seconds: 3)), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return SplashScreen(key: UniqueKey()); + } else { + if (isFirstRun) { + return OnBoardingPage(); + } else { + WidgetsBinding.instance.addPostFrameCallback( + (_) => showRatingDialog(context), + ); + return AuthenticationService.handleEntryPoint(context); + } + } + }), routes: { '/feedback': (context) => FeedbackPage(), '/settings': (context) => SettingsScreen(), '/help': (context) => HelpScreen(), '/contact': (context) => ContactUsScreen(), '/appInfo': (context) => AppInfoScreen(), - '/theme':(context) => ThemeScreen(), - '/faqs':(context) => FAQScreen(), + '/theme': (context) => ThemeScreen(), + '/faqs': (context) => FAQScreen(), '/phoneVerification': (context) => PhoneVerificationScreen(), - '/verifyCode': (context) => VerifyCodeScreen(phoneNumber: '7267097531', phoneNumberVerificationDb: PhoneNumberVerificationDb(verificationCallback: null),), + '/verifyCode': (context) => VerifyCodeScreen( + phoneNumber: '7267097531', + phoneNumberVerificationDb: + PhoneNumberVerificationDb(verificationCallback: null), + ), }, ), ), ); } - void loadpref() async{ + void loadpref() async { SharedPreferences pref = await SharedPreferences.getInstance(); - List? k = await pref.getStringList('favbool'); - if(k == null) { + List? k = pref.getStringList('favbool'); + if (k == null) { List tmp = []; int len = recentAlerts.length; - for(var i = 0; i < len; i++) { + for (var i = 0; i < len; i++) { tmp.add('false'); - } await pref.setStringList('favbool', tmp); } diff --git a/lib/models/users.dart b/lib/models/users.dart index 82b4bc391d..535a8bf0aa 100644 --- a/lib/models/users.dart +++ b/lib/models/users.dart @@ -1,7 +1,7 @@ import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:flutter/cupertino.dart'; enum Gender { Male, Female, Other } + enum Mode { Online, Offline } class Users { @@ -44,7 +44,7 @@ class Users { Gender gender, int age, [ String profilePictureUrl = "", - ]) { + ]) { this.course = course; this.department = department; this.university = university; @@ -57,7 +57,7 @@ class Users { factory Users.fromJson(DocumentSnapshot snapshot) { Map? json = snapshot.data() as Map?; Gender gender = stringToEnum(json?["gender"] as String); - return new Users( + return new Users( uid: snapshot.id, name: json?["name"] as String? ?? "", email: json?["email"] as String? ?? "", @@ -99,7 +99,6 @@ String enumToString(Gender gender) { default: return "Other"; - } } @@ -111,7 +110,6 @@ String modeEnumToString(Mode currMode) { default: return "Offline"; - } } @@ -124,10 +122,7 @@ Gender stringToEnum(String gen) { case "Female": return Gender.Female; - default: return Gender.Other; - } } - diff --git a/lib/screens/contact_us_screen.dart b/lib/screens/contact_us_screen.dart index 14ee00d322..c2a3193c54 100644 --- a/lib/screens/contact_us_screen.dart +++ b/lib/screens/contact_us_screen.dart @@ -1,8 +1,8 @@ -import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; -import 'package:http/http.dart' as http; + import '../models/users.dart'; import '../services/user_info_services.dart'; @@ -15,121 +15,129 @@ class _ContactUsScreenState extends State { String question = 'How can we help?'; String email = ''; - - @override Widget build(BuildContext context) { final userInfoProvider = - Provider.of(context, listen: false); + Provider.of(context, listen: false); Users? currentUser = userInfoProvider.user; - if(currentUser == null) { + if (currentUser == null) { email = ''; - } - else { + } else { email = currentUser.email.toString(); } - - - return Scaffold( - appBar: AppBar(elevation: 0,backgroundColor: Colors.transparent, - - centerTitle: true,), - backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8), - + appBar: AppBar( + elevation: 0, + backgroundColor: Colors.transparent, + centerTitle: true, + ), + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), body: SingleChildScrollView( physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()), child: Consumer( builder: (context, userInfo, _) { Users _user; if (userInfo.hasData) _user = userInfo.user!; - return Stack( - alignment: Alignment.center, - children: [ - Column( - children: [ - SizedBox(height: 30,), - Text( - "Contact Us", - style: TextStyle( - color: Colors.white, - fontSize: 30.0, - fontWeight: FontWeight.bold, - ),), - SizedBox(height: 0.12 * MediaQuery.of(context).size.height), - Container( - margin: EdgeInsets.fromLTRB(15, 15, 15, 60), - padding: EdgeInsets.all(30), - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(40), - topRight: Radius.circular(40), + return Stack(alignment: Alignment.center, children: [ + Column(children: [ + SizedBox( + height: 30, + ), + Text( + "Contact Us", + style: TextStyle( + color: Colors.white, + fontSize: 30.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 0.12 * MediaQuery.of(context).size.height), + Container( + margin: EdgeInsets.fromLTRB(15, 15, 15, 60), + padding: EdgeInsets.all(30), + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(40), + topRight: Radius.circular(40), + ), + ), + width: double.infinity, + child: SizedBox( + height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + 'Ask a Question', + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + color: Colors.white), ), - ), - width: double.infinity, - child: - - SizedBox(height: MediaQuery.of(context).size.height ,width: MediaQuery.of(context).size.width,child:Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text( - 'Ask a Question', - style: TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.bold, - color: Colors.white - ), - ), - SizedBox(height: 16.0), - Text(question, style: TextStyle(color: Colors.white),), - SizedBox(height: 8.0), - TextFormField( - onChanged: (value) { - setState(() { - question = value; - }); - }, - decoration: InputDecoration( - labelText: 'Your Question', - border: OutlineInputBorder(), - labelStyle: TextStyle(color: Theme.of(context).primaryColorDark) - - ), - maxLines: 3, - ), - SizedBox(height: 16.0), - ElevatedButton( - child: Text('Send'), - onPressed: () async { - DateTime now = DateTime.now(); - String dateinsert = DateFormat('kk:mm:ss \n EEE d MMM').format(now); - - String queryString = "?query=$question&email=$email×tamp=$dateinsert"; - String finalquery = 'https://script.google.com/macros/s/AKfycbwbXfW9AeABuhhKiJAnUs_ZCQ-6x4OJECSgq7_xCTcNpbds45IUy_d6mlKrLsouzweJPQ/exec'+queryString; - var finalURI = Uri.parse(finalquery); - var response = await http.get(finalURI); - if (response.statusCode == 200) { - print('User query published successfully!'); - ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text("User query published successfully!"), - )); - - } - else { - print('User query failed to be published!'); - ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text("User query failed to be published!"), - )); - } - - }, - ),])))])]); + SizedBox(height: 16.0), + Text( + question, + style: TextStyle(color: Colors.white), + ), + SizedBox(height: 8.0), + TextFormField( + onChanged: (value) { + setState(() { + question = value; + }); + }, + decoration: InputDecoration( + labelText: 'Your Question', + border: OutlineInputBorder(), + labelStyle: TextStyle( + color: Theme.of(context) + .primaryColorDark)), + maxLines: 3, + ), + SizedBox(height: 16.0), + ElevatedButton( + child: Text('Send'), + onPressed: () async { + DateTime now = DateTime.now(); + String dateinsert = + DateFormat('kk:mm:ss \n EEE d MMM') + .format(now); + + String queryString = + "?query=$question&email=$email×tamp=$dateinsert"; + String finalquery = + 'https://script.google.com/macros/s/AKfycbwbXfW9AeABuhhKiJAnUs_ZCQ-6x4OJECSgq7_xCTcNpbds45IUy_d6mlKrLsouzweJPQ/exec' + + queryString; + var finalURI = Uri.parse(finalquery); + var response = await http.get(finalURI); + if (response.statusCode == 200) { + print('User query published successfully!'); + ScaffoldMessenger.of(context) + .showSnackBar(SnackBar( + content: Text( + "User query published successfully!"), + )); + } else { + print('User query failed to be published!'); + ScaffoldMessenger.of(context) + .showSnackBar(SnackBar( + content: Text( + "User query failed to be published!"), + )); + } + }, + ), + ]))) + ]) + ]); }, ), ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/help_screen.dart b/lib/screens/help_screen.dart index 911c971df6..bc7743cd1e 100644 --- a/lib/screens/help_screen.dart +++ b/lib/screens/help_screen.dart @@ -1,82 +1,103 @@ - import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:settings_ui/settings_ui.dart'; + import '../models/users.dart'; import '../services/user_info_services.dart'; -import 'contact_us_screen.dart'; import 'app_info_screen.dart'; +import 'contact_us_screen.dart'; class HelpScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(elevation: 0,backgroundColor: Colors.transparent, - - centerTitle: true,), - backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8), - + appBar: AppBar( + elevation: 0, + backgroundColor: Colors.transparent, + centerTitle: true, + ), + backgroundColor: + Theme.of(context).colorScheme.background.withOpacity(0.8), body: SingleChildScrollView( physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()), child: Consumer( builder: (context, userInfo, _) { Users _user; if (userInfo.hasData) _user = userInfo.user!; - return Stack( - alignment: Alignment.center, - children: [ - Column( - children: [ - SizedBox(height: 30,), - Text( - "Help Section", - style: TextStyle( - color: Colors.white, - fontSize: 30.0, - fontWeight: FontWeight.bold, - ),), - SizedBox(height: 0.12 * MediaQuery.of(context).size.height), - Container( - margin: EdgeInsets.fromLTRB(15, 15, 15, 60), - padding: EdgeInsets.all(30), - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(40), - topRight: Radius.circular(40), - ), - ), - width: double.infinity, - child: - - SizedBox(height: MediaQuery.of(context).size.height ,width: MediaQuery.of(context).size.width,child:ListView( - children: [ - ListTile( - leading: Icon(Icons.contact_mail, color: Colors.white,), - title: Text('Contact Us', style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ContactUsScreen(), - ), - ); - }, + return Stack(alignment: Alignment.center, children: [ + Column(children: [ + SizedBox( + height: 30, ), - ListTile( - leading: Icon(Icons.info, color: Colors.white,), - title: Text('App Info',style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AppInfoScreen(), - ), - ); - }, + Text( + "Help Section", + style: TextStyle( + color: Colors.white, + fontSize: 30.0, + fontWeight: FontWeight.bold, + ), ), - ], - ),))])]); + SizedBox(height: 0.12 * MediaQuery.of(context).size.height), + Container( + margin: EdgeInsets.fromLTRB(15, 15, 15, 60), + padding: EdgeInsets.all(30), + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(40), + topRight: Radius.circular(40), + ), + ), + width: double.infinity, + child: SizedBox( + height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, + child: ListView( + children: [ + ListTile( + leading: Icon( + Icons.contact_mail, + color: Colors.white, + ), + title: Text( + 'Contact Us', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold), + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ContactUsScreen(), + ), + ); + }, + ), + ListTile( + leading: Icon( + Icons.info, + color: Colors.white, + ), + title: Text( + 'App Info', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold), + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AppInfoScreen(), + ), + ); + }, + ), + ], + ), + )) + ]) + ]); }, ), ), diff --git a/lib/screens/splash.dart b/lib/screens/splash.dart index 977a4d9d12..8ce48f88d4 100644 --- a/lib/screens/splash.dart +++ b/lib/screens/splash.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:is_first_run/is_first_run.dart'; + import '../widgets/onboarding_canvas_design.dart'; import '../widgets/splash_animation.dart'; @@ -20,7 +20,6 @@ class _SplashScreenState extends State super.dispose(); } - @override void initState() { super.initState(); diff --git a/lib/widgets/signup_form_additional_details.dart b/lib/widgets/signup_form_additional_details.dart index 6a009951a4..4416d13dde 100644 --- a/lib/widgets/signup_form_additional_details.dart +++ b/lib/widgets/signup_form_additional_details.dart @@ -1,12 +1,12 @@ +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:fluttertoast/fluttertoast.dart'; import 'package:friday/models/users.dart'; import 'package:friday/services/auth_error_msg_toast.dart'; import 'package:friday/services/classes_db_services.dart'; import 'package:friday/services/user_info_services.dart'; import 'package:friday/widgets/auth_input_form_field.dart'; -import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:fluttertoast/fluttertoast.dart'; import 'package:provider/provider.dart'; import '../constants.dart'; @@ -26,16 +26,16 @@ class _SignUpFormAdditionalDetailsState String errorMsg = ""; bool isProcessing = false; TextEditingController _deptName = TextEditingController(); - TextEditingController _year = TextEditingController(); - TextEditingController _age = TextEditingController(); + TextEditingController _year = TextEditingController(); + TextEditingController _age = TextEditingController(); TextEditingController _colName = TextEditingController(); - TextEditingController _courseName = TextEditingController(); + TextEditingController _courseName = TextEditingController(); Gender? _gen; GlobalKey _formKey = GlobalKey(); GlobalKey _colFormKey = GlobalKey(); - GlobalKey _courseFormKey = GlobalKey(); + GlobalKey _courseFormKey = GlobalKey(); GlobalKey _deptFormKey = GlobalKey(); - String _defaultCollegeName = ""; + String _defaultCollegeName = ""; String _defaultCourseName = ""; String _defaultDepartmentName = ""; @@ -43,7 +43,9 @@ class _SignUpFormAdditionalDetailsState ClassesDBServices classesDBServices = ClassesDBServices(); String _college = "", _course = "", _department = ""; - final List _collegeList = [''], _coursesList = [''], _departmentList = ['']; + final List _collegeList = [''], + _coursesList = [''], + _departmentList = ['']; late Future fetchColleges; getCollegeNameData() async { @@ -246,7 +248,8 @@ class _SignUpFormAdditionalDetailsState ElevatedButton( style: ElevatedButton.styleFrom( padding: EdgeInsets.symmetric( - vertical: 13, horizontal: 20), backgroundColor: kAuthThemeColor, + vertical: 13, horizontal: 20), + backgroundColor: kAuthThemeColor, shape: RoundedRectangleBorder( borderRadius: BorderRadiusDirectional.circular(30), @@ -370,8 +373,11 @@ class _SignUpFormAdditionalDetailsState showDialog( context: context, builder: (context) => AlertDialog( - backgroundColor: kCardColor, - title: Text("Enter Your College Name" , style: TextStyle(color: Colors.white),), + backgroundColor: kCardColor, + title: Text( + "Enter Your College Name", + style: TextStyle(color: Colors.white), + ), content: Container( height: MediaQuery.of(context).size.height / 5, child: Form( @@ -399,7 +405,8 @@ class _SignUpFormAdditionalDetailsState Container( alignment: Alignment.centerRight, child: ElevatedButton( - style: ElevatedButton.styleFrom(backgroundColor: kAuthThemeColor), + style: ElevatedButton.styleFrom( + backgroundColor: kAuthThemeColor), child: Text( "Submit", style: TextStyle(