122 lines
4.2 KiB
Dart
122 lines
4.2 KiB
Dart
import 'package:adaptix/adaptix.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:sapaly_shop/components/custom_button.dart';
|
|
import 'package:sapaly_shop/components/text_field.dart';
|
|
import 'package:sapaly_shop/screens/auth/login.dart';
|
|
import 'package:sapaly_shop/services/app_constants.dart';
|
|
import 'package:sapaly_shop/themes/app_theme.dart';
|
|
|
|
import '../../services/page_navigator.dart';
|
|
|
|
class RegisterScreen extends StatefulWidget {
|
|
const RegisterScreen({super.key});
|
|
|
|
@override
|
|
State<RegisterScreen> createState() => _RegisterScreenState();
|
|
}
|
|
|
|
class _RegisterScreenState extends State<RegisterScreen> {
|
|
final TextEditingController _email = TextEditingController();
|
|
final TextEditingController _password = TextEditingController();
|
|
final TextEditingController _passwordConfirm = TextEditingController();
|
|
final TextEditingController _phone = TextEditingController();
|
|
|
|
@override
|
|
void dispose() {
|
|
_email.clear();
|
|
_password.clear();
|
|
_passwordConfirm.clear();
|
|
_phone.clear();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Center(
|
|
child: Container(
|
|
margin: EdgeInsets.symmetric(
|
|
horizontal: AppConstants.horizontalPadding(context),
|
|
),
|
|
padding: EdgeInsets.symmetric(
|
|
horizontal: AppConstants.horizontalPadding(context),
|
|
),
|
|
height: AppConstants.deviceHeight(context) / (1.13),
|
|
width: double.infinity,
|
|
decoration: BoxDecoration(
|
|
border: Border.all(
|
|
width: 2.adaptedPx(),
|
|
color: AppTheme.blackColor.withOpacity(0.1),
|
|
),
|
|
borderRadius: BorderRadius.circular(15.adaptedPx()),
|
|
),
|
|
child: ListView(
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Image.asset('assets/images/sapalyLogo.png'),
|
|
SizedBox(width: 20.adaptedPx()),
|
|
Text(
|
|
AppConstants.kAppName,
|
|
style:
|
|
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
|
|
color: AppTheme.blackColor,
|
|
fontWeight: FontWeight.w600,
|
|
fontSize: 20.adaptedPx(),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
SizedBox(height: 20.adaptedPx()),
|
|
customTextField(
|
|
title: 'Your email',
|
|
context: context,
|
|
controller: _email,
|
|
hint: '',
|
|
),
|
|
SizedBox(height: 15.adaptedPx()),
|
|
customTextField(title: 'Phone number', context: context),
|
|
SizedBox(height: 15.adaptedPx()),
|
|
customTextField(title: 'Password', context: context),
|
|
SizedBox(height: 15.adaptedPx()),
|
|
customTextField(title: 'Password confirmation', context: context),
|
|
SizedBox(height: 15.adaptedPx()),
|
|
customButton(
|
|
text: 'Register',
|
|
context: context,
|
|
status: false,
|
|
statusText: 'Registering...',
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.symmetric(vertical: 15.adaptedPx()),
|
|
child: Text(
|
|
'Or',
|
|
textAlign: TextAlign.center,
|
|
style:
|
|
Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
|
|
color: AppTheme.blackColor,
|
|
fontSize: 18.adaptedPx(),
|
|
),
|
|
),
|
|
),
|
|
customButton(
|
|
text: 'Login',
|
|
context: context,
|
|
tap: () {
|
|
PageNavigator(ctx: context).nextPageOnly(
|
|
page: const LoginScreen(),
|
|
);
|
|
},
|
|
statusText: 'Loggin in...',
|
|
status: true,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|