6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit fd6d8730
Changed files
.../pregistration/bloc/preregistration_cubit.dart | 23 ++++----- .../lib/pregistration/preregistration_flow.dart | 58 ++++++++++++---------- 2 files changed, 41 insertions(+), 40 deletions(-)
Diff
diff --git a/comwell_key_app/lib/pregistration/bloc/preregistration_cubit.dart b/comwell_key_app/lib/pregistration/bloc/preregistration_cubit.dart
index 929097d7..a294deed 100644
--- a/comwell_key_app/lib/pregistration/bloc/preregistration_cubit.dart
+++ b/comwell_key_app/lib/pregistration/bloc/preregistration_cubit.dart
@@ -70,17 +70,13 @@ class PreregistrationCubit extends Cubit<PreregistrationState> {
}
void _onConfirmPressed() async {
- final index = PreregistrationPage.information.index;
- _isAnimating = true;
- await pageController.animateToPage(index,
- duration: const Duration(milliseconds: 500),
- curve: Curves.fastOutSlowIn);
- _isAnimating = false;
+ emit(state.copyWith(loading: true));
+ Future.delayed(const Duration(seconds: 3), () {
+ emit(state.copyWith(loading: false));
+ });
}
- void onEditProfileClicked() {
-
- }
+ void onEditProfileClicked() {}
void onEditAddressClicked() {
_navigateTo(PreregistrationPage.information);
@@ -90,8 +86,7 @@ class PreregistrationCubit extends Cubit<PreregistrationState> {
_navigateTo(PreregistrationPage.paymentMethod);
}
- void onEditExtrasClicked() {
- }
+ void onEditExtrasClicked() {}
void onBackClicked() {
if (_isAnimating) return;
@@ -102,7 +97,7 @@ class PreregistrationCubit extends Cubit<PreregistrationState> {
}
void _navigateTo(PreregistrationPage page) async {
- if(_isAnimating) return;
+ if (_isAnimating) return;
_isAnimating = true;
await pageController.animateToPage(page.index,
duration: const Duration(milliseconds: 500),
@@ -111,7 +106,7 @@ class PreregistrationCubit extends Cubit<PreregistrationState> {
}
void _navigateNextPage() async {
- if(_isAnimating) return;
+ if (_isAnimating) return;
_isAnimating = true;
await pageController.nextPage(
duration: const Duration(milliseconds: 500),
@@ -120,7 +115,7 @@ class PreregistrationCubit extends Cubit<PreregistrationState> {
}
void _navigatePreviousPage() async {
- if(_isAnimating) return;
+ if (_isAnimating) return;
_isAnimating = true;
await pageController.previousPage(
duration: const Duration(milliseconds: 500),
diff --git a/comwell_key_app/lib/pregistration/preregistration_flow.dart b/comwell_key_app/lib/pregistration/preregistration_flow.dart
index 694a18a2..c7861bfd 100644
--- a/comwell_key_app/lib/pregistration/preregistration_flow.dart
+++ b/comwell_key_app/lib/pregistration/preregistration_flow.dart
@@ -51,43 +51,49 @@ class _PreregistrationFlowState extends State<PreregistrationFlow> {
appBar: AppBar(
backgroundColor: colorSecondary,
leading: BackButton(
+ color: Colors.black,
onPressed: () {
cubit.onBackClicked();
},
),
),
- bottomNavigationBar: Column(
- // BOTTOM NAVIGATION
- mainAxisSize: MainAxisSize.min,
- children: [
- const Divider(
- color: Colors.black12,
- height: 0,
- ),
- Row(
+ bottomNavigationBar: Builder(
+ builder: (context) {
+ if(state.loading) return const SizedBox();
+ return Column(
+ // BOTTOM NAVIGATION
+ mainAxisSize: MainAxisSize.min,
children: [
- Expanded(
- child: Padding(
- padding: const EdgeInsets.all(16.0),
- child: ElevatedButton(
- onPressed: () {
- cubit.onContinueClicked();
- },
- style: const ButtonStyle(
- backgroundColor:
- WidgetStatePropertyAll(Color(0xffAA8D65)),
- foregroundColor:
- WidgetStatePropertyAll(Colors.white)),
+ const Divider(
+ color: Colors.black12,
+ height: 0,
+ ),
+ Row(
+ children: [
+ Expanded(
child: Padding(
- padding: const EdgeInsets.symmetric(vertical: 16.0),
- child: Text(state.buttonTextLocalized),
+ padding: const EdgeInsets.all(16.0),
+ child: ElevatedButton(
+ onPressed: () {
+ cubit.onContinueClicked();
+ },
+ style: const ButtonStyle(
+ backgroundColor:
+ WidgetStatePropertyAll(Color(0xffAA8D65)),
+ foregroundColor:
+ WidgetStatePropertyAll(Colors.white)),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 16.0),
+ child: Text(state.buttonTextLocalized),
+ ),
+ ),
),
),
- ),
+ ],
),
],
- ),
- ],
+ );
+ }
),
body: Expanded(
child: Padding(