Skip to content

Commit

Permalink
priming up the app for update(profile push etc)
Browse files Browse the repository at this point in the history
  • Loading branch information
devout-coder committed Aug 23, 2023
1 parent 59401a3 commit 29d48b4
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 281 deletions.
3 changes: 1 addition & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ class _TSECAppState extends ConsumerState<TSECApp> {
GoRoute(
path: '/profile-page',
builder: (context, state) {
// use state.queryParams to get search query from query parameter
String justLoggedInSt =
state.queryParams['justLoggedIn'] ?? "false"; // may be null
bool justLoggedIn = justLoggedInSt == "true";
Expand All @@ -171,7 +170,7 @@ class _TSECAppState extends ConsumerState<TSECApp> {
StudentModel? studentModel = await ref
.watch(authProvider.notifier)
.fetchStudentDetails(user, context);
ref.watch(studentModelProvider.notifier).update((state) => studentModel);
// ref.watch(studentModelProvider.notifier).update((state) => studentModel);
ref.read(studentModelProvider.notifier).state = studentModel;

NotificationType.makeTopic(ref, studentModel);
Expand Down
4 changes: 2 additions & 2 deletions lib/models/student_model/student_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/provider/auth_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class AuthProvider extends StateNotifier<bool> {
}
}

void updateUserDetails(
Future updateUserDetails(
StudentModel student, WidgetRef ref, BuildContext context) async {
try {
StudentModel updatedStudentData =
Expand Down
2 changes: 2 additions & 0 deletions lib/screens/login_screen/widgets/custom_login_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ class _LoginWidgetState extends ConsumerState<LoginWidget> {
child: Center(
child: Text(
'Reset Password',
style: TextStyle(
color: Theme.of(context).colorScheme.primary),
),
),
),
Expand Down
Loading

0 comments on commit 29d48b4

Please sign in to comment.