From f3bff77594afab69d4572d0b1532787baf8368fd Mon Sep 17 00:00:00 2001 From: Pranil Date: Sun, 17 Sep 2023 02:21:14 +0530 Subject: [PATCH] minor UI changes --- lib/provider/timetable_provider.dart | 45 ------------------- .../profile_screen/profile_screen.dart | 5 ++- lib/utils/themes.dart | 3 +- 3 files changed, 4 insertions(+), 49 deletions(-) diff --git a/lib/provider/timetable_provider.dart b/lib/provider/timetable_provider.dart index 1daa3c46..8210db5a 100644 --- a/lib/provider/timetable_provider.dart +++ b/lib/provider/timetable_provider.dart @@ -19,66 +19,21 @@ final timeTableProvider = return TimeTableProvider( TimeTableService(ref.watch(firestoreProvider)), ref, - // ref.watch(timetableServiceProvider), data?.yearBranchDivTopic, ); })); -// class TimeTableProvider extends StateNotifier { -// final TimeTableService _ttService; -// -// final String? _d; -// final Ref _ref; -// -// // TimeTableProvider({ttService, ref, d}) -// // : _ttService = ttService, -// // _ref = ref, -// // _d = d, -// // super(false); -// -// TimeTableProvider({ttService, ref, d}) -// : _ttService = ttService, -// _ref = ref, -// _d = d, -// super(false); -// -// Stream getTimeTable() { -// // return await _authService.fetchStudentDetails(user, context); -// return _ttService.getweekTimetable(_d); -// } -// } class TimeTableProvider extends StateNotifier { TimeTableService? _ttService; String? _d; Ref? _ref; - // TimeTableProvider({ttService, ref, d}) - // : _ttService = ttService, - // _ref = ref, - // _d = d, - // super(false); - TimeTableProvider(ttService, ref, d) : super(Stream.empty()) { _ttService = ttService; _ref = ref; _d = d; state = _ttService!.getweekTimetable(_d); } - // Stream getTimeTable() { - // return await _authService.fetchStudentDetails(user, context); - // return _ttService.getweekTimetable(_d); - // } } -// class CounterNotifier extends StateNotifier { -// CounterNotifier(int initialCount) : super(CounterState(initialCount)); -// -// void increment() { -// state = CounterState(state.count + 1); -// } -// -// void decrement() { -// state = CounterState(state.count - 1); -// } -// } diff --git a/lib/screens/profile_screen/profile_screen.dart b/lib/screens/profile_screen/profile_screen.dart index e972df92..9af70c67 100644 --- a/lib/screens/profile_screen/profile_screen.dart +++ b/lib/screens/profile_screen/profile_screen.dart @@ -163,6 +163,7 @@ class _ProfilePageState extends ConsumerState { Future _saveChanges(WidgetRef ref) async { final StudentModel? data = ref.watch(studentModelProvider); bool b = data!.updateCount != null ? data.updateCount! < 2 : true; + debugPrint("b is $b"); if (b) { if (batch == null || div == null) { ScaffoldMessenger.of(context).showSnackBar( @@ -232,7 +233,7 @@ class _ProfilePageState extends ConsumerState { div = data.div; gradyear = data.gradyear; batch = data.batch; - phoneNum = data.phoneNum; + phoneNum = data.phoneNum ?? ""; address = data.address ?? ''; homeStation = data.homeStation ?? ''; _dobController.text = data.dateOfBirth ?? ""; @@ -407,7 +408,7 @@ class _ProfilePageState extends ConsumerState { ), CustomTextWithDivider( label: "Phone Number", - value: data.phoneNum, + value: data.phoneNum ?? "", showDivider: true, ), CustomTextWithDivider( diff --git a/lib/utils/themes.dart b/lib/utils/themes.dart index f9eb6310..1a467986 100644 --- a/lib/utils/themes.dart +++ b/lib/utils/themes.dart @@ -92,7 +92,6 @@ late final darkTheme = ThemeData( primaryColorDark: const Color(0xFF000000), shadowColor: const Color(0x00A9A9A9), cardColor: Colors.white70, - // textSecondaryColor: Color.fromARGB(255, 65, 60, 60), elevatedButtonTheme: _getElevatedButtonTheme( darkColor: kDarkModeDarkBlue, lightColor: kDarkModeLightBlue, @@ -108,7 +107,7 @@ late final darkTheme = ThemeData( fontFamily: "SF Pro Text", colorScheme: ColorScheme.fromSwatch().copyWith( secondary: kLightBlack, - onPrimary: Color.fromARGB(255, 171, 171, 171), + // onPrimary: Color.fromARGB(255, 171, 171, 171), primaryContainer: Color(0xFF323232), secondaryContainer: Color(0xff00C62C), onSecondaryContainer: Colors.white,