forked from eatvio/eatvio_app
feature(registration): new registration flow
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'bloc/date_of_birth_bloc.dart';
|
||||
@@ -35,53 +36,33 @@ class _DateOfBirthScreenState extends State<DateOfBirthScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return BlocBuilder<DateOfBirthBloc, DateOfBirthState>(
|
||||
builder: (context, state) {
|
||||
return Scaffold(
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: BlocBuilder<DateOfBirthBloc, DateOfBirthState>(
|
||||
builder: (context, state) {
|
||||
return Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(color: theme.colorScheme.primary, width: 1.h),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (4 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 38.v),
|
||||
Text("date_of_birth".tr, style: theme.textTheme.headlineSmall),
|
||||
Spacer(flex: 39),
|
||||
const SizedBox(height: 32),
|
||||
_buildDateInput(context),
|
||||
Spacer(flex: 60),
|
||||
BlocBuilder<DateOfBirthBloc, DateOfBirthState>(
|
||||
builder: (context, state) {
|
||||
return NextStepButton(
|
||||
text: "continue".tr.toUpperCase(),
|
||||
margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapContinue(state, context),
|
||||
);
|
||||
},
|
||||
),
|
||||
// BlocBuilder<DateOfBirthBloc, DateOfBirthState>(
|
||||
// builder: (context, state) {
|
||||
// return NextStepButton(
|
||||
// text: "continue".tr.toUpperCase(),
|
||||
// margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
// buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
// onPressed: onTapContinue(state, context),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -138,10 +119,43 @@ class _DateOfBirthScreenState extends State<DateOfBirthScreen> {
|
||||
|
||||
onTapCalendar(BuildContext context) {
|
||||
return () {
|
||||
openDatePickerDialog(context);
|
||||
// openDatePickerDialog(context);
|
||||
_showDialog(
|
||||
CupertinoDatePicker(
|
||||
initialDateTime: DateTime.now(),
|
||||
mode: CupertinoDatePickerMode.date,
|
||||
onDateTimeChanged: (DateTime newTime) {
|
||||
setState(() {
|
||||
selectedDate = newTime;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
void _showDialog(Widget child) {
|
||||
showCupertinoModalPopup<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) => Container(
|
||||
height: 216,
|
||||
padding: const EdgeInsets.only(top: 6.0),
|
||||
// The Bottom margin is provided to align the popup above the system
|
||||
// navigation bar.
|
||||
margin: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).viewInsets.bottom,
|
||||
),
|
||||
// Provide a background color for the popup.
|
||||
color: CupertinoColors.systemBackground.resolveFrom(context),
|
||||
// Use a SafeArea widget to avoid system overlaps.
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
GoRouter.of(context).pop();
|
||||
|
||||
Reference in New Issue
Block a user