diff --git a/lib/assets/logos/logo_letra_branca.png b/lib/assets/logos/logo_letra_branca.png index 98a0a59..a55f290 100644 Binary files a/lib/assets/logos/logo_letra_branca.png and b/lib/assets/logos/logo_letra_branca.png differ diff --git a/lib/assets/logos/logo_letra_primary.png b/lib/assets/logos/logo_letra_primary.png index 2022bbb..21c0ab5 100644 Binary files a/lib/assets/logos/logo_letra_primary.png and b/lib/assets/logos/logo_letra_primary.png differ diff --git a/lib/src/app/auth/screens/cadastro.dart b/lib/src/app/auth/screens/cadastro.dart new file mode 100644 index 0000000..39b0ecb --- /dev/null +++ b/lib/src/app/auth/screens/cadastro.dart @@ -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 createState() => _CadastroScreenState(); +} + +class _CadastroScreenState extends ConsumerState { + + + final GlobalKey _scaffoldKey = GlobalKey(); + bool showpass = false; + TextEditingController emailController = TextEditingController(); + TextEditingController senhaController = TextEditingController(); + TextEditingController codeController = TextEditingController(); + TextEditingController nomeCompletoController = TextEditingController(); + final GlobalKey _formKey = GlobalKey(); + final GlobalKey _form2Key = GlobalKey(); + 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 + // ); + // } + // } + } +} \ No newline at end of file diff --git a/lib/src/app/auth/screens/codigoverifica.dart b/lib/src/app/auth/screens/codigoverifica.dart new file mode 100644 index 0000000..1e89152 --- /dev/null +++ b/lib/src/app/auth/screens/codigoverifica.dart @@ -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 createState() => _CodigoVerificacaoScreenState(); +} + +class _CodigoVerificacaoScreenState extends ConsumerState { + + + final GlobalKey _scaffoldKey = GlobalKey(); + bool showpass = false; + TextEditingController emailController = TextEditingController(); + TextEditingController senhaController = TextEditingController(); + TextEditingController codeController = TextEditingController(); + TextEditingController nomeCompletoController = TextEditingController(); + final GlobalKey _formKey = GlobalKey(); + final GlobalKey _form2Key = GlobalKey(); + 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( + 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 + // ); + // } + // } + } +} \ No newline at end of file diff --git a/lib/src/app/auth/screens/login.dart b/lib/src/app/auth/screens/login.dart index 4145bba..a5cd8ae 100644 --- a/lib/src/app/auth/screens/login.dart +++ b/lib/src/app/auth/screens/login.dart @@ -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,130 +44,126 @@ class _LoginScreenState extends ConsumerState { @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: const DecorationImage( - image: AssetImage('lib/assets/images/bg_header.png'), - fit: BoxFit.cover, - ) - ), - child: Column( - children: [ - const SizedBox(height: 25), - SizedBox( - height: Metrics.height(context)/3, - child: Center( - child: SizedBox( - child: Image.asset( - 'lib/assets/logos/logo_letra_branca.png', - fit: BoxFit.fill, - width: 200 - ) + return 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: const DecorationImage( + image: AssetImage('lib/assets/images/bg_header.png'), + fit: BoxFit.cover, + ) + ), + child: Column( + children: [ + const SizedBox(height: 25), + SizedBox( + height: Metrics.height(context)/3, + child: Center( + child: SizedBox( + child: Image.asset( + 'lib/assets/logos/logo_letra_branca.png', + fit: BoxFit.fill, + width: 250 ) - ), + ) ), - ClipRRect( - borderRadius: BorderRadius.only( - topLeft: radius, - topRight: radius + ), + ClipRRect( + borderRadius: BorderRadius.only( + topLeft: radius, + topRight: radius + ), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 35), + decoration: BoxDecoration( + color: Theme.of(context).scaffoldBackgroundColor ), - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 35), - decoration: BoxDecoration( - color: Theme.of(context).scaffoldBackgroundColor - ), - child: Form( - key: _formKey, - child: Center( - child: Column( - children: [ - const SizedBox(height: 30), - SizedBox( + child: Form( + key: _formKey, + child: Center( + child: Column( + children: [ + const SizedBox(height: 30), + SizedBox( + width: double.infinity, + child: Text( + "Fazer Login", + textAlign: TextAlign.start, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w600, + color: AppColorLight.text01Color, + fontSize: 26 + ) + ) + ), + const SizedBox(height: 20), + SimpleInput( + title: 'Email', + hintText: 'Informe seu email', + typeInput: TypInputText.EMAIL, + controller: emailController, + validator: true, + ), + const SizedBox(height: 30), + PasswordInput( + title: 'Senha', + hintText: 'Informe sua senha', + controller: senhaController, + validator: true, + onFieldSubmitted: (value) { + // onTapLogin(); + } + ), + const SizedBox(height: 20), + InkWell( + onTap: (){ + }, + child: SizedBox( width: double.infinity, child: Text( - "Fazer Login", - textAlign: TextAlign.start, - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - fontWeight: FontWeight.w600, - color: AppColorLight.text01Color, - fontSize: 26 + 'Esqueceu a senha?', + textAlign: TextAlign.end, + style: Theme.of(context).textTheme.bodyLarge?.copyWith( + fontWeight: FontWeight.w400, + decoration: TextDecoration.underline, + color: Theme.of(context).primaryColor, + fontSize: AppFontSize.fontSize15 ) ) ), - const SizedBox(height: 20), - SimpleInput( - title: 'Email', - hintText: 'Informe seu email', - typeInput: TypInputText.EMAIL, - controller: emailController, - validator: true, - ), - const SizedBox(height: 30), - PasswordInput( - title: 'Senha', - hintText: 'Informe sua senha', - controller: senhaController, - validator: true, - onFieldSubmitted: (value) { - // onTapLogin(); - } - ), - const SizedBox(height: 20), - InkWell( - onTap: (){ - }, - child: SizedBox( - width: double.infinity, - child: Text( - 'Esqueceu a senha?', - textAlign: TextAlign.end, - style: Theme.of(context).textTheme.bodyLarge?.copyWith( - fontWeight: FontWeight.w400, - decoration: TextDecoration.underline, - color: Theme.of(context).primaryColor, - fontSize: AppFontSize.fontSize15 - ) - ) - ), - ), - const SizedBox(height: 20), - ButtonWidget( - label: 'Fazer login', - isloading: isloading, - onTap: (){ - - } - ), - const SizedBox(height: 20), - ButtonWidget( - label: 'Não possui conta? Cadastre-se', - type: TypeButton.secondary, - onTap: (){ - // context.push(CadastreseScreen.path); - } - ), - const SizedBox(height: 30), - ] - ) + ), + const SizedBox(height: 20), + ButtonWidget( + label: 'Fazer login', + isloading: isloading, + onTap: (){ + + } + ), + const SizedBox(height: 20), + ButtonWidget( + label: 'Não possui conta? Cadastre-se', + type: TypeButton.secondary, + onTap: (){ + context.push(CadastroScreen.path); + } + ), + const SizedBox(height: 30), + ] ) ) ) ) - ], - ), + ) + ], ), - ) - )); + ), + ) + ); } void doLogin() async { diff --git a/lib/src/router.dart b/lib/src/router.dart index 811ce21..8df6e5e 100644 --- a/lib/src/router.dart +++ b/lib/src/router.dart @@ -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((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,