update
This commit is contained in:
parent
148cdec83c
commit
7749f1100d
19 changed files with 447 additions and 217 deletions
|
|
@ -1,11 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:glossy/glossy.dart';
|
||||
import 'package:internet_connection_checker/internet_connection_checker.dart';
|
||||
import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/widgets/buttonwithprogress_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/glossy_container_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_form_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
|
|
@ -108,81 +107,77 @@ class _RegisterPageState extends State<RegisterPage> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: PageBackgroundWidget(
|
||||
page: 'register',
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const Gap(96),
|
||||
const TitleWidget(
|
||||
firstTextSize: 14,
|
||||
secondTextSize: 24,
|
||||
logoSize: 90,
|
||||
),
|
||||
const Gap(32),
|
||||
const TextWidget(
|
||||
text: 'Register',
|
||||
title: true,
|
||||
),
|
||||
const Gap(16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 32, right: 32),
|
||||
child: GlossyContainerWidget(
|
||||
height: containerHeight,
|
||||
child: Form(
|
||||
child: Column(
|
||||
children: [
|
||||
InputWidget(label: 'Email', controller: _emailController),
|
||||
const Gap(16),
|
||||
InputWidget(
|
||||
label: 'Password',
|
||||
controller: _passwordController,
|
||||
password: true,
|
||||
),
|
||||
const Gap(16),
|
||||
InputWidget(
|
||||
label: 'Confirm Password',
|
||||
controller: _confirmPasswordController,
|
||||
password: true,
|
||||
),
|
||||
const Gap(40),
|
||||
// TextButton(onPressed: () => {_signIn()}, child: const Text('Login'))
|
||||
// if (_isLoading)
|
||||
// const Center(child: CircularProgressIndicator(color: Colors.white))
|
||||
// else
|
||||
// ButtonWidget(text: 'Create Account', onPressed: _signUp)
|
||||
ButtonWithProgressWidget(
|
||||
trigger: _isLoading,
|
||||
progressText: 'Registering',
|
||||
buttonText: 'Register',
|
||||
onPressed: _signUp)
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
const Gap(16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const TextWidget(
|
||||
text: "Already have an account?",
|
||||
size: 14,
|
||||
),
|
||||
const Gap(8),
|
||||
GestureDetector(
|
||||
onTap: () => {context.push('/login')},
|
||||
child: const TextWidget(
|
||||
text: 'Login here',
|
||||
size: 14,
|
||||
underlined: true,
|
||||
body: PageBackgroundWidget(
|
||||
page: 'register',
|
||||
child: Center(
|
||||
child: Column(mainAxisAlignment: MainAxisAlignment.start, children: [
|
||||
const Gap(96),
|
||||
const TitleWidget(
|
||||
firstTextSize: 14,
|
||||
secondTextSize: 24,
|
||||
logoSize: 90,
|
||||
),
|
||||
const Gap(32),
|
||||
const TextWidget(
|
||||
text: 'Register',
|
||||
title: true,
|
||||
),
|
||||
const Gap(16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 32, right: 32),
|
||||
child: GlossyContainerWidget(
|
||||
// height: containerHeight,
|
||||
child: Form(
|
||||
child: Column(
|
||||
children: [
|
||||
InputFormWidget(label: 'Email', controller: _emailController),
|
||||
const Gap(16),
|
||||
InputFormWidget(
|
||||
label: 'Password',
|
||||
controller: _passwordController,
|
||||
password: true,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
showNotification(context, 'Error: Please enter a password', false);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
);
|
||||
const Gap(16),
|
||||
InputFormWidget(
|
||||
label: 'Confirm Password',
|
||||
controller: _confirmPasswordController,
|
||||
password: true,
|
||||
onSubmitted: (String? password) {
|
||||
_signUp();
|
||||
},
|
||||
),
|
||||
const Gap(40),
|
||||
ButtonWithProgressWidget(
|
||||
trigger: _isLoading, progressText: 'Registering', buttonText: 'Register', onPressed: _signUp)
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
const Gap(16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const TextWidget(
|
||||
text: "Already have an account?",
|
||||
size: 14,
|
||||
),
|
||||
const Gap(8),
|
||||
GestureDetector(
|
||||
onTap: () => {context.push('/login')},
|
||||
child: const TextWidget(
|
||||
text: 'Login here',
|
||||
size: 14,
|
||||
underlined: true,
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
]))));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue