Changes to be committed:

modified:   lib/assets/logos/logo_letra_branca.png
	modified:   lib/assets/logos/logo_letra_primary.png
	new file:   lib/src/app/auth/screens/cadastro.dart
	new file:   lib/src/app/auth/screens/codigoverifica.dart
	modified:   lib/src/app/auth/screens/login.dart
	modified:   lib/src/router.dart
This commit is contained in:
steeve 2024-01-27 17:19:03 -03:00
parent 382a2a4255
commit 1b1d633732
6 changed files with 514 additions and 121 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 KiB

After

Width:  |  Height:  |  Size: 170 KiB

View File

@ -0,0 +1,211 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:recomendagro/assets/theme/colors.dart';
import 'package:recomendagro/src/app/auth/screens/codigoverifica.dart';
import 'package:recomendagro/src/shared/utils/responsive/responsive_metrics.dart';
import 'package:recomendagro/src/shared/widgets/buttons/simple_button.dart';
import 'package:recomendagro/src/shared/widgets/inputs/password_input.dart';
import '../../../shared/widgets/inputs/simple_input.dart';
class CadastroScreen extends ConsumerStatefulWidget {
static String path = '/cadastro';
const CadastroScreen({ Key? key }) : super(key: key);
@override
ConsumerState<CadastroScreen> createState() => _CadastroScreenState();
}
class _CadastroScreenState extends ConsumerState<CadastroScreen> {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
bool showpass = false;
TextEditingController emailController = TextEditingController();
TextEditingController senhaController = TextEditingController();
TextEditingController codeController = TextEditingController();
TextEditingController nomeCompletoController = TextEditingController();
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final GlobalKey<FormState> _form2Key = GlobalKey<FormState>();
bool firstStep = true;
bool isloading = false;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
Radius radius = const Radius.circular(20);
return WillPopScope(
onWillPop: () async {
return Future.value(false);
},
child: Scaffold(
key: _scaffoldKey,
extendBodyBehindAppBar: true,
appBar: const PreferredSize(child: SizedBox(), preferredSize: Size.fromHeight(0)),
body: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
image: DecorationImage(
image: AssetImage('lib/assets/images/bg_header.png'),
fit: BoxFit.cover,
)
),
child: Column(
children: [
const SizedBox(height: 30),
SizedBox(
height: Metrics.height(context)/6,
child: Center(
child: SizedBox(
child: Image.asset(
'lib/assets/logos/logo_branca.png',
fit: BoxFit.fill,
width: 100
)
)
),
),
ClipRRect(
borderRadius: BorderRadius.only(
topLeft: radius,
topRight: radius
),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 35),
decoration: BoxDecoration(
color: Theme.of(context).scaffoldBackgroundColor
),
child:
Center(
child: Form(
key: _formKey,
child: FocusTraversalGroup(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 30),
Row(
children: [
GestureDetector(
onTap: (){
context.pop();
},
child: Container(
decoration: BoxDecoration(
border: Border.all(width: 1, color: AppColorLight.text04Color),
borderRadius: BorderRadius.circular(10)
),
child: Icon(Icons.chevron_left)
),
),
SizedBox(width: 10),
SizedBox(
child: Text(
"Cadastro",
textAlign: TextAlign.start,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: AppColorLight.text01Color,
fontSize: 26
)
)
),
],
),
const SizedBox(height: 20),
// SizedBox(
// width: double.infinity,
// child: Text(
// "Dados de acesso",
// textAlign: TextAlign.start,
// style: Theme.of(context).textTheme.bodyMedium?.copyWith(
// fontWeight: FontWeight.w600,
// color: AppColorLight.text01Color,
// fontSize: 17
// )
// )
// ),
// const SizedBox(height: 20),
SimpleInput(
hintText: '',
title: 'Nome completo*',
controller: nomeCompletoController,
validator: true,
),
const SizedBox(height: 20),
SimpleInput(
title: 'Email',
hintText: 'Informe seu email',
typeInput: TypInputText.EMAIL,
controller: emailController,
validator: true,
),
const SizedBox(height: 20),
PasswordInput(
title: 'Senha',
hintText: 'Informe sua senha',
controller: senhaController,
validator: true,
),
const SizedBox(height: 20),
ButtonWidget(
label: 'Criar conta',
isloading: isloading,
onTap: (){
context.push(CodigoVerificacaoScreen.path);
}
),
// const SizedBox(height: 20),
// ButtonWidget(
// label: 'Fazer Login',
// type: TypeButton.secondary,
// onTap: (){
// }
// ),
const SizedBox(height: 30),
]
)
)
)
),
)
)
],
),
),
)
));
}
void doLogin() async {
// if(_formKey.currentState!.validate()){
// setState(() {
// isloading = true;
// });
// await ref.read(authController.notifier).fazerLogin({
// 'email': emailController.text,
// 'senha': senhaController.text
// });
// setState(() {
// isloading = false;
// });
// if(!mounted)return;
// if((ref.read(authController).hasError == false)){
// context.go(ListDocumentosScreen.path);
// }else{
// dialogToastMessage(
// context,
// message: 'Usuário ou senha inválidos.',
// dialogColorType: DialogColorType.WARNING
// );
// }
// }
}
}

View File

@ -0,0 +1,182 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:recomendagro/assets/theme/colors.dart';
import 'package:recomendagro/src/shared/utils/responsive/responsive_metrics.dart';
import 'package:recomendagro/src/shared/widgets/buttons/simple_button.dart';
import '../../../shared/widgets/inputs/simple_input.dart';
class CodigoVerificacaoScreen extends ConsumerStatefulWidget {
static String path = '/verificacodigo';
const CodigoVerificacaoScreen({ Key? key }) : super(key: key);
@override
ConsumerState<CodigoVerificacaoScreen> createState() => _CodigoVerificacaoScreenState();
}
class _CodigoVerificacaoScreenState extends ConsumerState<CodigoVerificacaoScreen> {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
bool showpass = false;
TextEditingController emailController = TextEditingController();
TextEditingController senhaController = TextEditingController();
TextEditingController codeController = TextEditingController();
TextEditingController nomeCompletoController = TextEditingController();
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final GlobalKey<FormState> _form2Key = GlobalKey<FormState>();
bool firstStep = true;
bool isloading = false;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
Radius radius = const Radius.circular(20);
return WillPopScope(
onWillPop: () async {
return Future.value(false);
},
child: Scaffold(
key: _scaffoldKey,
extendBodyBehindAppBar: true,
appBar: const PreferredSize(child: SizedBox(), preferredSize: Size.fromHeight(0)),
body: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
image: DecorationImage(
image: AssetImage('lib/assets/images/bg_header.png'),
fit: BoxFit.cover,
)
),
child: Column(
children: [
const SizedBox(height: 30),
SizedBox(
height: Metrics.height(context)/6,
child: Center(
child: SizedBox(
child: Image.asset(
'lib/assets/logos/logo_branca.png',
fit: BoxFit.fill,
width: 100
)
)
),
),
ClipRRect(
borderRadius: BorderRadius.only(
topLeft: radius,
topRight: radius
),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 35),
decoration: BoxDecoration(
color: Theme.of(context).scaffoldBackgroundColor
),
child:Center(
child: Form(
key: _form2Key,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: double.infinity,
child: Text(
"Confirmação de conta",
textAlign: TextAlign.start,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: AppColorLight.text01Color,
fontSize: 21
)
)
),
const SizedBox(height: 30),
SizedBox(
width: double.infinity,
child: RichText(
textAlign: TextAlign.start,
maxLines: 3,
text: TextSpan(
text: 'Verifique sua conta usando o código de ativação enviado ao seu e-mail ',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
height: 1.7,
color: AppColorLight.text03Color,
fontSize: 16
),
children: <TextSpan>[
TextSpan(
text: emailController.text,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: AppColorLight.text01Color,
fontSize: 16
),
),
]
)
)
),
const SizedBox(height: 30),
SimpleInput(
title: 'Código',
hintText: 'Informe código',
controller: codeController,
validator: true,
),
// CodeInputController(
// controller: codeController,
// ),
const SizedBox(height: 30),
ButtonWidget(
label: 'Verificar conta',
isloading: isloading,
onTap: (){
}
)
]
)
),
)
),
)
],
),
),
)
));
}
void doLogin() async {
// if(_formKey.currentState!.validate()){
// setState(() {
// isloading = true;
// });
// await ref.read(authController.notifier).fazerLogin({
// 'email': emailController.text,
// 'senha': senhaController.text
// });
// setState(() {
// isloading = false;
// });
// if(!mounted)return;
// if((ref.read(authController).hasError == false)){
// context.go(ListDocumentosScreen.path);
// }else{
// dialogToastMessage(
// context,
// message: 'Usuário ou senha inválidos.',
// dialogColorType: DialogColorType.WARNING
// );
// }
// }
}
}

View File

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:recomendagro/assets/theme/colors.dart';
import 'package:recomendagro/src/app/auth/screens/cadastro.dart';
import 'package:recomendagro/src/shared/utils/enums.dart';
import 'package:recomendagro/src/shared/utils/responsive/responsive_metrics.dart';
import 'package:recomendagro/src/shared/widgets/buttons/simple_button.dart';
@ -42,11 +44,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
@override
Widget build(BuildContext context) {
Radius radius = const Radius.circular(20);
return WillPopScope(
onWillPop: () async {
return Future.value(false);
},
child: Scaffold(
return Scaffold(
key: _scaffoldKey,
extendBodyBehindAppBar: true,
appBar: const PreferredSize(child: SizedBox(), preferredSize: Size.fromHeight(0)),
@ -69,7 +67,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
child: Image.asset(
'lib/assets/logos/logo_letra_branca.png',
fit: BoxFit.fill,
width: 200
width: 250
)
)
),
@ -151,7 +149,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
label: 'Não possui conta? Cadastre-se',
type: TypeButton.secondary,
onTap: (){
// context.push(CadastreseScreen.path);
context.push(CadastroScreen.path);
}
),
const SizedBox(height: 30),
@ -165,7 +163,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
),
),
)
));
);
}
void doLogin() async {

View File

@ -1,3 +1,5 @@
import 'package:recomendagro/src/app/auth/screens/cadastro.dart';
import 'package:recomendagro/src/app/auth/screens/codigoverifica.dart';
import 'package:recomendagro/src/app/auth/screens/login.dart';
import 'package:recomendagro/src/app/base/screens/splash.dart';
import 'package:flutter/material.dart';
@ -18,21 +20,21 @@ final routerProvider = Provider<GoRouter>((ref) {
parentNavigatorKey: _rootNavigatorKey,
builder: (_, state) => const SlapshScreen()
),
// // GoRoute(
// // path: PageEditProfileMobile.path,
// // parentNavigatorKey: _rootNavigatorKey,
// // builder: (_, state) => const PageEditProfileMobile()
// // ),
GoRoute(
path: LoginScreen.path,
parentNavigatorKey: _rootNavigatorKey,
builder: (_, state) => const LoginScreen()
),
// GoRoute(
// path: CadastreseScreen.path,
// parentNavigatorKey: _rootNavigatorKey,
// builder: (_, state) => const CadastreseScreen()
// ),
GoRoute(
path: CadastroScreen.path,
parentNavigatorKey: _rootNavigatorKey,
builder: (_, state) => const CadastroScreen()
),
GoRoute(
path: CodigoVerificacaoScreen.path,
parentNavigatorKey: _rootNavigatorKey,
builder: (_, state) => const CodigoVerificacaoScreen()
),
// GoRoute(
// path: RecuperarContaScreen.path,
// parentNavigatorKey: _rootNavigatorKey,