Skip to content

Commit

Permalink
minor UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
devout-coder committed Sep 16, 2023
1 parent ad95d28 commit f3bff77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 49 deletions.
45 changes: 0 additions & 45 deletions lib/provider/timetable_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,66 +19,21 @@ final timeTableProvider =
return TimeTableProvider(
TimeTableService(ref.watch(firestoreProvider)),
ref,
// ref.watch(timetableServiceProvider),
data?.yearBranchDivTopic,
);
}));

// class TimeTableProvider extends StateNotifier<bool> {
// 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<Stream> {
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<CounterState> {
// CounterNotifier(int initialCount) : super(CounterState(initialCount));
//
// void increment() {
// state = CounterState(state.count + 1);
// }
//
// void decrement() {
// state = CounterState(state.count - 1);
// }
// }
5 changes: 3 additions & 2 deletions lib/screens/profile_screen/profile_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
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(
Expand Down Expand Up @@ -232,7 +233,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
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 ?? "";
Expand Down Expand Up @@ -407,7 +408,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
),
CustomTextWithDivider(
label: "Phone Number",
value: data.phoneNum,
value: data.phoneNum ?? "",
showDivider: true,
),
CustomTextWithDivider(
Expand Down
3 changes: 1 addition & 2 deletions lib/utils/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit f3bff77

Please sign in to comment.