fist commit ftc staff app clone
This commit is contained in:
89
lib/view/screens/auth_module/agency_sign_in.dart
Normal file
89
lib/view/screens/auth_module/agency_sign_in.dart
Normal file
@@ -0,0 +1,89 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class AgencySignIn extends StatefulWidget {
|
||||
const AgencySignIn({super.key});
|
||||
|
||||
@override
|
||||
State<AgencySignIn> createState() => _AgencySignInState();
|
||||
}
|
||||
|
||||
class _AgencySignInState extends State<AgencySignIn> {
|
||||
final AgencySignInController _controller = Get.put(AgencySignInController());
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomScaffold(
|
||||
screenKey: _controller.screenKey,
|
||||
onScreenTap: _controller.removeFocus,
|
||||
showAppBar: true,
|
||||
titleText: "",
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15.0.w),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
CustomImageWidget(
|
||||
imagePath: AssetsManager.kAppIcon,
|
||||
imageColor: CustomAppColors.kIconColor,
|
||||
height: 132.h,
|
||||
width: 203.w,
|
||||
),
|
||||
|
||||
CustomTextWidget(
|
||||
text: ConstantText.kAgencyLogin,
|
||||
fontColor: CustomAppColors.kIconColor,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
|
||||
CustomTextWidget(
|
||||
text: ConstantText.kPleaseLoginToContinue,
|
||||
fontColor: CustomAppColors.kIconColor,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 14.sp,
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 30.0.h),
|
||||
child: CustomTextFieldWidget(
|
||||
controller: _controller.emailPhoneController,
|
||||
hintText: ConstantText.kInputEmailOrPhone,
|
||||
heading: ConstantText.kEmailOrPhoneHeading,
|
||||
onChange: (_){
|
||||
_controller.validateEmailPhone();
|
||||
},
|
||||
),
|
||||
),
|
||||
Obx((){
|
||||
return CustomErrorMsg(
|
||||
message: _controller.emailPhoneErrorMsg.value,
|
||||
);
|
||||
}),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 25.0.h),
|
||||
child: Obx((){
|
||||
return CustomAppButton(
|
||||
isLoading: _controller.isLoading.value,
|
||||
buttonText: ConstantText.kSendCode.toUpperCase(),
|
||||
onTap: _controller.onSendCodeButton,
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
4
lib/view/screens/auth_module/export_auth_module.dart
Normal file
4
lib/view/screens/auth_module/export_auth_module.dart
Normal file
@@ -0,0 +1,4 @@
|
||||
export 'splash_screen.dart';
|
||||
export 'sign_in_screen.dart';
|
||||
export 'agency_sign_in.dart';
|
||||
export 'otp_screen.dart';
|
||||
124
lib/view/screens/auth_module/otp_screen.dart
Normal file
124
lib/view/screens/auth_module/otp_screen.dart
Normal file
@@ -0,0 +1,124 @@
|
||||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||
|
||||
class OTPScreen extends StatefulWidget {
|
||||
const OTPScreen({super.key});
|
||||
|
||||
@override
|
||||
State<OTPScreen> createState() => _OTPScreenState();
|
||||
}
|
||||
|
||||
class _OTPScreenState extends State<OTPScreen> {
|
||||
final OTPScreenController _controller = Get.put(OTPScreenController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomScaffold(
|
||||
screenKey: _controller.screenKey,
|
||||
onScreenTap: _controller.removeFocus,
|
||||
avoidBottomInsets: false,
|
||||
showAppBar: true,
|
||||
titleText: "",
|
||||
body: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15.0.w),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
CustomImageWidget(
|
||||
imagePath: AssetsManager.kLockIcon,
|
||||
imageColor: CustomAppColors.kIconColor,
|
||||
height: 84.h,
|
||||
width: 75.w,
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 30.0.h),
|
||||
child: CustomTextWidget(
|
||||
text: ConstantText.kTwoFactorAuth,
|
||||
fontColor: CustomAppColors.kIconColor,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 24.sp,
|
||||
alignment: Alignment.centerLeft,
|
||||
),
|
||||
),
|
||||
|
||||
CustomTextWidget(
|
||||
text: ConstantText.kOTPScreenMsg,
|
||||
fontColor: CustomAppColors.kIconColor,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 14.sp,
|
||||
alignment: Alignment.centerLeft,
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 20.0.h),
|
||||
child: PinCodeTextField(
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.done,
|
||||
autoDisposeControllers: false,
|
||||
controller: _controller.otpController,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
],
|
||||
onAutoFillDisposeAction: AutofillContextAction.cancel,
|
||||
appContext: context,
|
||||
length: 6,
|
||||
onChanged: (otp) {
|
||||
_controller.validateOTP();
|
||||
},
|
||||
cursorColor: CustomAppColors.kIconColor,
|
||||
textStyle: TextStyle(
|
||||
color: CustomAppColors.kIconColor.withOpacity(0.6),
|
||||
),
|
||||
pinTheme: PinTheme(
|
||||
shape: PinCodeFieldShape.box,
|
||||
borderRadius: BorderRadius.circular(2.r),
|
||||
fieldHeight: 56.0.h,
|
||||
fieldWidth: 43.33.w,
|
||||
borderWidth: 0.5.w,
|
||||
fieldOuterPadding: EdgeInsets.symmetric(vertical: 10.0.h,),
|
||||
activeFillColor: CustomAppColors.kIconColor.withOpacity(0.6),
|
||||
activeColor: CustomAppColors.kIconColor.withOpacity(0.6),
|
||||
errorBorderColor: CustomAppColors.kIconColor.withOpacity(0.6),
|
||||
selectedColor: CustomAppColors.kIconColor.withOpacity(0.6),
|
||||
inactiveColor: CustomAppColors.kIconColor.withOpacity(0.6),
|
||||
selectedFillColor: CustomAppColors.kIconColor.withOpacity(0.6),
|
||||
),
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
return CustomErrorMsg(
|
||||
message: _controller.otpErrorMsg.value,
|
||||
);
|
||||
}),
|
||||
const Spacer(),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: Platform.isIOS ? 30.0.h : 20.0.h,
|
||||
),
|
||||
child: Obx((){
|
||||
return CustomAppButton(
|
||||
isLoading: _controller.isLoading.value,
|
||||
buttonText: ConstantText.kSubmit.toUpperCase(),
|
||||
onTap: _controller.onSubmitButton,
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
160
lib/view/screens/auth_module/sign_in_screen.dart
Normal file
160
lib/view/screens/auth_module/sign_in_screen.dart
Normal file
@@ -0,0 +1,160 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class SignInScreen extends StatefulWidget {
|
||||
const SignInScreen({super.key});
|
||||
|
||||
@override
|
||||
State<SignInScreen> createState() => _SignInScreenState();
|
||||
}
|
||||
|
||||
class _SignInScreenState extends State<SignInScreen> {
|
||||
final SignInScreenController _controller = Get.put(SignInScreenController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomScaffold(
|
||||
screenKey: _controller.screenKey,
|
||||
onScreenTap: _controller.removeFocus,
|
||||
showAppBar: true,
|
||||
titleText: "",
|
||||
body: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15.0.w),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
CustomImageWidget(
|
||||
imagePath: AssetsManager.kAppIcon,
|
||||
imageColor: CustomAppColors.kIconColor,
|
||||
height: 132.h,
|
||||
width: 203.w,
|
||||
),
|
||||
|
||||
CustomTextWidget(
|
||||
text: ConstantText.kWelcomeBack,
|
||||
fontColor: CustomAppColors.kIconColor,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
|
||||
CustomTextWidget(
|
||||
text: ConstantText.kPleaseLoginToContinue,
|
||||
fontColor: CustomAppColors.kIconColor,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 14.sp,
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 30.0.h),
|
||||
child: CustomTextFieldWidget(
|
||||
controller: _controller.emailController,
|
||||
hintText: ConstantText.kPleaseInputEmail,
|
||||
heading: ConstantText.kEmailHeading,
|
||||
onChange: (_){
|
||||
_controller.validateEmail();
|
||||
},
|
||||
),
|
||||
),
|
||||
Obx((){
|
||||
return CustomErrorMsg(
|
||||
message: _controller.emailErrorMsg.value,
|
||||
);
|
||||
}),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 15.0.h),
|
||||
child: CustomTextFieldWidget(
|
||||
controller: _controller.passwordController,
|
||||
hintText: "******",
|
||||
heading: ConstantText.kPasswordHeading,
|
||||
onChange: (_){
|
||||
_controller.validatePassword();
|
||||
},
|
||||
isObscure: true,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
Obx((){
|
||||
return CustomErrorMsg(
|
||||
message: _controller.passwordErrorMsg.value,
|
||||
);
|
||||
}),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 15.0.h,
|
||||
bottom: 25.h,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
// Obx((){
|
||||
// return CustomCheckBox(
|
||||
// checkBoxValue: _controller.isRememberMe.value,
|
||||
// titleText: ConstantText.kRememberMe,
|
||||
// onTap: () {
|
||||
// _controller.isRememberMe.toggle();
|
||||
// },
|
||||
// );
|
||||
// }),
|
||||
|
||||
// const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: _controller.onForgotButton,
|
||||
child: CustomTextWidget(
|
||||
text: ConstantText.kForgotPassword,
|
||||
isExpanded: false,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 8.0.h),
|
||||
child: Obx((){
|
||||
return CustomAppButton(
|
||||
isLoading: _controller.isLoading.value,
|
||||
buttonText: ConstantText.kLogIn.toUpperCase(),
|
||||
onTap: _controller.onLogInButton,
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// Padding(
|
||||
// padding: EdgeInsets.only(
|
||||
// bottom: Platform.isIOS ? 30.0.h : 20.0.h,
|
||||
// ),
|
||||
// child: CustomAppButton(
|
||||
// buttonText: ConstantText.kAgencyLogin.toUpperCase(),
|
||||
// buttonColor: CustomAppColors.kPrimaryColor,
|
||||
// textColor: CustomAppColors.kSecondaryColor,
|
||||
// onTap: _controller.onAgencyLogInButton,
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
41
lib/view/screens/auth_module/splash_screen.dart
Normal file
41
lib/view/screens/auth_module/splash_screen.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
||||
import 'package:ftc_mobile_app/utilities/notification_util.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class SplashScreen extends StatefulWidget {
|
||||
const SplashScreen({super.key});
|
||||
|
||||
@override
|
||||
State<SplashScreen> createState() => _SplashScreenState();
|
||||
}
|
||||
|
||||
class _SplashScreenState extends State<SplashScreen> {
|
||||
final _controller = Get.put(SplashScreenController());
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
requestNotificationPermissions();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomScaffold(
|
||||
screenKey: _controller.screenKey,
|
||||
backgroundColor: CustomAppColors.kSecondaryColor,
|
||||
body: const Center(
|
||||
child: CustomImageWidget(
|
||||
imagePath: AssetsManager.kAppIcon,
|
||||
height: 200,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user