-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee38832
commit 0bde3a2
Showing
10 changed files
with
138 additions
and
17 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
frontend/lib/common/components/buttons/small_round_button.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
/* A small round button holding any text */ | ||
class SmallRoundButton extends StatelessWidget { | ||
final String title; | ||
final VoidCallback onPressed; | ||
|
||
const SmallRoundButton({ | ||
super.key, | ||
required this.title, | ||
required this.onPressed, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ElevatedButton( | ||
onPressed: onPressed, | ||
style: ElevatedButton.styleFrom( | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(25.0), | ||
), | ||
backgroundColor: Theme.of(context).colorScheme.primary, | ||
), | ||
child: Text( | ||
title, | ||
style: Theme.of(context).textTheme.labelLarge, | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
frontend/lib/features/onboarding/pages/enter_biometrics_page.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:frontend/common/components/buttons/small_round_button.dart'; | ||
import 'package:frontend/features/auth/providers/auth_page_state_provider.dart'; | ||
|
||
class EnterBiometricsPage extends ConsumerWidget { | ||
const EnterBiometricsPage({super.key}); | ||
|
||
void signOutUser(WidgetRef ref) async { | ||
FirebaseAuth.instance.signOut(); | ||
ref.read(authPageStateProvider.notifier).state = AuthPageState.login; | ||
|
||
// TODO: notify user if not all data has been synced with server yet | ||
|
||
// TODO: move this to a central shared file | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
/* Get the screen height */ | ||
double screenHeight = MediaQuery.of(context).size.height; | ||
// Controllers for form fields | ||
final TextEditingController birthdayController = TextEditingController(); | ||
// Add controllers for other fields as needed | ||
|
||
return Scaffold( | ||
appBar: AppBar( | ||
backgroundColor: Theme.of(context).colorScheme.background, | ||
title: Text( | ||
"Profile Setup", | ||
style: Theme.of(context).textTheme.displaySmall, | ||
)), | ||
body: SafeArea( | ||
child: SingleChildScrollView( | ||
padding: const EdgeInsets.all(16.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Text( | ||
"Birthday", | ||
style: TextStyle(fontSize: 16), | ||
), | ||
TextField( | ||
controller: birthdayController, | ||
decoration: const InputDecoration( | ||
hintText: 'YYYY-MM-DD', | ||
), | ||
), | ||
// Add other fields (sex, height, weight, etc.) here | ||
SizedBox(height: screenHeight * .01), | ||
|
||
/* Save button */ | ||
Align( | ||
alignment: Alignment.centerRight, | ||
child: SmallRoundButton( | ||
title: "Save", | ||
onPressed: () { | ||
signOutUser(ref); | ||
}, | ||
), | ||
) | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
frontend/lib/features/syncing/providers/syncing_page_state_provider.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters