update
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:animate_do/animate_do.dart';
|
||||||
|
|
||||||
class BottomSheetExpanded extends StatelessWidget {
|
class BottomSheetExpanded extends StatelessWidget {
|
||||||
final List<Widget> children;
|
final List<Widget> children;
|
||||||
@@ -12,6 +13,56 @@ class BottomSheetExpanded extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
body: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
colors: [
|
||||||
|
Color.fromARGB(255, 87, 210, 255),
|
||||||
|
Color.fromARGB(255, 137, 224, 255),
|
||||||
|
Color(0xFFD6F4FF),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
const SizedBox(height: 50),
|
||||||
|
Center(
|
||||||
|
child: FadeInLeft(
|
||||||
|
duration: const Duration(milliseconds: 1000),
|
||||||
|
child: const Image(
|
||||||
|
image: AssetImage('images/logo_prosapp.png'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 30),
|
||||||
|
Expanded(
|
||||||
|
child: FadeInUpBig(
|
||||||
|
duration: const Duration(milliseconds: 1000),
|
||||||
|
child: Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(60),
|
||||||
|
topRight: Radius.circular(60))),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: horizontalPadding,
|
||||||
|
vertical: 15,
|
||||||
|
),
|
||||||
|
child: Column(children: children),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: const Color(0xFFD6F4FF),
|
backgroundColor: const Color(0xFFD6F4FF),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl_phone_field/intl_phone_field.dart';
|
import 'package:intl_phone_field/intl_phone_field.dart';
|
||||||
import 'package:prosappco/src/components/bottom_sheet.dart';
|
import 'package:prosappco/src/components/bottom_sheet.dart';
|
||||||
import 'package:prosappco/src/components/primary_btn.dart';
|
import 'package:prosappco/src/presentation/widgets/shared/primary_button.dart';
|
||||||
import 'package:prosappco/src/controllers/phone_auth_controller.dart';
|
import 'package:prosappco/src/controllers/phone_auth_controller.dart';
|
||||||
import 'package:prosappco/src/models/setting_model.dart';
|
import 'package:prosappco/src/models/setting_model.dart';
|
||||||
import 'package:prosappco/src/providers/user_provider.dart';
|
import 'package:prosappco/src/providers/user_provider.dart';
|
||||||
@@ -180,7 +180,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
PrimaryButtom(
|
PrimaryButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (_formKey.currentState!.validate()) {
|
if (_formKey.currentState!.validate()) {
|
||||||
PhoneAuthController.instance.phoneAuthentication(
|
PhoneAuthController.instance.phoneAuthentication(
|
||||||
@@ -196,8 +196,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
.initUserProvider();
|
.initUserProvider();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
text: 'Enviar código',
|
||||||
isEnabled: _isChecked,
|
isEnabled: _isChecked,
|
||||||
label: 'Enviar código',
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
GestureBottom(clearPhoneNumber: _clearPhoneNumber),
|
GestureBottom(clearPhoneNumber: _clearPhoneNumber),
|
||||||
@@ -353,7 +353,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
PrimaryButtom(
|
PrimaryButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (_formKey.currentState!.validate()) {
|
if (_formKey.currentState!.validate()) {
|
||||||
PhoneAuthController.instance.phoneAuthentication(
|
PhoneAuthController.instance.phoneAuthentication(
|
||||||
@@ -369,8 +369,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
.initUserProvider();
|
.initUserProvider();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
text: 'Enviar código',
|
||||||
isEnabled: _isChecked,
|
isEnabled: _isChecked,
|
||||||
label: 'Enviar código',
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
GestureBottom(clearPhoneNumber: _clearPhoneNumber),
|
GestureBottom(clearPhoneNumber: _clearPhoneNumber),
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||||
import 'package:prosappco/src/components/primary_btn.dart';
|
import 'package:prosappco/src/components/bottom_sheet.dart';
|
||||||
|
import 'package:prosappco/src/presentation/widgets/shared/primary_button.dart';
|
||||||
import 'package:prosappco/src/controllers/login_email_controller.dart';
|
import 'package:prosappco/src/controllers/login_email_controller.dart';
|
||||||
import 'package:prosappco/src/models/setting_model.dart';
|
import 'package:prosappco/src/models/setting_model.dart';
|
||||||
import 'package:prosappco/src/providers/user_provider.dart';
|
import 'package:prosappco/src/providers/user_provider.dart';
|
||||||
@@ -47,39 +48,10 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
|||||||
Widget _mobileView(BuildContext context) {
|
Widget _mobileView(BuildContext context) {
|
||||||
bool isIOS = Theme.of(context).platform == TargetPlatform.iOS;
|
bool isIOS = Theme.of(context).platform == TargetPlatform.iOS;
|
||||||
|
|
||||||
return SafeArea(
|
return BottomSheetExpanded(
|
||||||
child: Scaffold(
|
horizontalPadding: 10,
|
||||||
backgroundColor: const Color(0xFFD6F4FF),
|
|
||||||
body: SingleChildScrollView(
|
|
||||||
reverse: true,
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Row(
|
||||||
margin: const EdgeInsets.only(top: 130),
|
|
||||||
width: double.infinity,
|
|
||||||
height: 700,
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topRight: Radius.circular(50),
|
|
||||||
topLeft: Radius.circular(50))),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
margin: const EdgeInsets.only(top: 20, left: 30),
|
|
||||||
child: const Image(
|
|
||||||
image: AssetImage('images/logo_prosapp.png'),
|
|
||||||
width: 180,
|
|
||||||
height: 100,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
|
|
||||||
margin: const EdgeInsets.only(
|
|
||||||
top: 125,
|
|
||||||
left: 25,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
@@ -101,13 +73,12 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
Form(
|
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||||
|
child: Form(
|
||||||
key: _formKey,
|
key: _formKey,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding:
|
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
|
||||||
const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
|
|
||||||
margin: const EdgeInsets.only(top: 210, left: 50, right: 50),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
!isIOS && !kIsWeb && settings?.google == true
|
!isIOS && !kIsWeb && settings?.google == true
|
||||||
@@ -160,8 +131,7 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
child: Text("ó"),
|
child: Text("ó"),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -219,8 +189,8 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
|||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
errorBorder: const OutlineInputBorder(
|
errorBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide:
|
||||||
color: Color.fromARGB(255, 184, 0, 0)),
|
BorderSide(color: Color.fromARGB(255, 184, 0, 0)),
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
@@ -267,10 +237,8 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,7 +487,7 @@ class PaddingButtomBottom extends StatelessWidget {
|
|||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 40),
|
padding: const EdgeInsets.only(bottom: 40),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: PrimaryButtom(
|
child: PrimaryButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (_formKey.currentState!.validate()) {
|
if (_formKey.currentState!.validate()) {
|
||||||
LoginEmailController.instance
|
LoginEmailController.instance
|
||||||
@@ -533,8 +501,9 @@ class PaddingButtomBottom extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
label: 'Iniciar',
|
text: 'Iniciar',
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
import 'package:firebase_auth/firebase_auth.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:prosappco/main.dart';
|
|
||||||
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||||
import 'package:prosappco/src/components/primary_btn.dart';
|
import 'package:prosappco/src/components/bottom_sheet.dart';
|
||||||
|
import 'package:prosappco/src/components/column_padding.dart';
|
||||||
|
import 'package:prosappco/src/presentation/widgets/shared/primary_button.dart';
|
||||||
import 'package:prosappco/src/controllers/register_controller.dart';
|
import 'package:prosappco/src/controllers/register_controller.dart';
|
||||||
import 'package:prosappco/src/models/setting_model.dart';
|
import 'package:prosappco/src/models/setting_model.dart';
|
||||||
import 'package:prosappco/src/providers/user_provider.dart';
|
import 'package:prosappco/src/providers/user_provider.dart';
|
||||||
import 'package:prosappco/src/presentation/screens/login/login.dart';
|
|
||||||
import 'package:prosappco/src/presentation/screens/web_view.dart';
|
import 'package:prosappco/src/presentation/screens/web_view.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:responsive_builder/responsive_builder.dart';
|
import 'package:responsive_builder/responsive_builder.dart';
|
||||||
@@ -62,41 +61,10 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
Widget _mobileView(BuildContext context) {
|
Widget _mobileView(BuildContext context) {
|
||||||
bool isIOS = Theme.of(context).platform == TargetPlatform.iOS;
|
bool isIOS = Theme.of(context).platform == TargetPlatform.iOS;
|
||||||
|
|
||||||
return SafeArea(
|
return BottomSheetExpanded(
|
||||||
child: Scaffold(
|
horizontalPadding: 10,
|
||||||
backgroundColor: const Color(0xFFD6F4FF),
|
|
||||||
body: GestureDetector(
|
|
||||||
onTap: () => FocusScope.of(context).unfocus(),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
reverse: true,
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Row(
|
||||||
margin: const EdgeInsets.only(top: 130),
|
|
||||||
width: double.infinity,
|
|
||||||
height: 700,
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topRight: Radius.circular(50),
|
|
||||||
topLeft: Radius.circular(50))),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
margin: const EdgeInsets.only(top: 20, left: 30),
|
|
||||||
child: const Image(
|
|
||||||
image: AssetImage('images/logo_prosapp.png'),
|
|
||||||
width: 180,
|
|
||||||
height: 100,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
|
|
||||||
margin: const EdgeInsets.only(
|
|
||||||
top: 125,
|
|
||||||
left: 25,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
@@ -118,12 +86,9 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
ColumnPadding(
|
||||||
Container(
|
alineacion: MainAxisAlignment.start,
|
||||||
padding:
|
padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 20),
|
||||||
const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
|
|
||||||
margin: const EdgeInsets.only(top: 200, left: 50, right: 50),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
!isIOS && !kIsWeb && settings?.google == true
|
!isIOS && !kIsWeb && settings?.google == true
|
||||||
? Padding(
|
? Padding(
|
||||||
@@ -170,8 +135,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
child: Text("ó"),
|
child: Text("ó"),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -194,8 +158,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
alignment: Alignment.topLeft,
|
alignment: Alignment.topLeft,
|
||||||
child: Text('Email',
|
child: Text('Email',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18.0,
|
fontSize: 18.0, color: Color(0xFF65676B))),
|
||||||
color: Color(0xFF65676B))),
|
|
||||||
)),
|
)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 18),
|
padding: const EdgeInsets.only(bottom: 18),
|
||||||
@@ -205,8 +168,8 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
if (value == null || value.isEmpty) {
|
if (value == null || value.isEmpty) {
|
||||||
return 'Por favor ingresa un email';
|
return 'Por favor ingresa un email';
|
||||||
}
|
}
|
||||||
final RegExp emailRegExp = RegExp(
|
final RegExp emailRegExp =
|
||||||
r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
|
RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
|
||||||
if (!emailRegExp.hasMatch(value)) {
|
if (!emailRegExp.hasMatch(value)) {
|
||||||
return 'Por favor ingresa un email válido';
|
return 'Por favor ingresa un email válido';
|
||||||
}
|
}
|
||||||
@@ -214,27 +177,23 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
},
|
},
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderSide:
|
borderSide: BorderSide(color: Color(0xFFECECEC)),
|
||||||
BorderSide(color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide:
|
borderSide: BorderSide(color: Color(0xFFECECEC)),
|
||||||
BorderSide(color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide:
|
borderSide: BorderSide(color: Color(0xFFECECEC)),
|
||||||
BorderSide(color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: Color.fromARGB(255, 184, 0, 0)),
|
||||||
Color.fromARGB(255, 184, 0, 0)),
|
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
@@ -254,8 +213,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
alignment: Alignment.topLeft,
|
alignment: Alignment.topLeft,
|
||||||
child: Text('Password',
|
child: Text('Password',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18.0,
|
fontSize: 18.0, color: Color(0xFF65676B))),
|
||||||
color: Color(0xFF65676B))),
|
|
||||||
)),
|
)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 25),
|
padding: const EdgeInsets.only(bottom: 25),
|
||||||
@@ -274,26 +232,22 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
errorBorder: const OutlineInputBorder(
|
errorBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: Color.fromARGB(255, 184, 0, 0)),
|
||||||
Color.fromARGB(255, 184, 0, 0)),
|
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
enabledBorder: const OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide:
|
borderSide: BorderSide(color: Color(0xFFECECEC)),
|
||||||
BorderSide(color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
border: const OutlineInputBorder(
|
border: const OutlineInputBorder(
|
||||||
borderSide:
|
borderSide: BorderSide(color: Color(0xFFECECEC)),
|
||||||
BorderSide(color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
focusedBorder: const OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide:
|
borderSide: BorderSide(color: Color(0xFFECECEC)),
|
||||||
BorderSide(color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
@@ -301,8 +255,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
hintStyle: const TextStyle(
|
hintStyle: const TextStyle(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
fillColor:
|
fillColor: const Color.fromARGB(255, 239, 239, 239),
|
||||||
const Color.fromARGB(255, 239, 239, 239),
|
|
||||||
filled: true,
|
filled: true,
|
||||||
prefixIcon: const Icon(Icons.lock_outline),
|
prefixIcon: const Icon(Icons.lock_outline),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
@@ -327,8 +280,8 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20),
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment
|
mainAxisAlignment:
|
||||||
.center, // Centra horizontalmente
|
MainAxisAlignment.center, // Centra horizontalmente
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Checkbox(
|
Checkbox(
|
||||||
value: _isChecked,
|
value: _isChecked,
|
||||||
@@ -341,8 +294,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (kIsWeb) {
|
if (kIsWeb) {
|
||||||
_launchURL(
|
_launchURL(settings?.terminosCondiciones ?? '');
|
||||||
settings?.terminosCondiciones ?? '');
|
|
||||||
} else {
|
} else {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
@@ -350,8 +302,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return WebViewScreen(
|
return WebViewScreen(
|
||||||
label: 'Políticas de privacidad',
|
label: 'Políticas de privacidad',
|
||||||
link: settings?.terminosCondiciones ??
|
link: settings?.terminosCondiciones ?? '',
|
||||||
'',
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -372,7 +323,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 25),
|
padding: const EdgeInsets.only(bottom: 25),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: PrimaryButtom(
|
child: PrimaryButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (_formKey.currentState!.validate()) {
|
if (_formKey.currentState!.validate()) {
|
||||||
RegisterController.instance
|
RegisterController.instance
|
||||||
@@ -380,13 +331,12 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
controller.email.text.trim(),
|
controller.email.text.trim(),
|
||||||
controller.password.text.trim(),
|
controller.password.text.trim(),
|
||||||
)
|
)
|
||||||
.then((value) => Provider.of<UserProvider>(
|
.then((value) =>
|
||||||
context,
|
Provider.of<UserProvider>(context, listen: false)
|
||||||
listen: false)
|
|
||||||
.initUserProvider());
|
.initUserProvider());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
label: 'Registrarme',
|
text: 'Registrarme',
|
||||||
isEnabled: _isChecked,
|
isEnabled: _isChecked,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -403,8 +353,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushReplacementNamed(
|
Navigator.pushReplacementNamed(context, '/login');
|
||||||
context, '/login');
|
|
||||||
},
|
},
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Iniciar Sesión',
|
'Iniciar Sesión',
|
||||||
@@ -421,12 +370,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,7 +628,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 25),
|
padding: const EdgeInsets.only(bottom: 25),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: PrimaryButtom(
|
child: PrimaryButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (_formKey.currentState!.validate()) {
|
if (_formKey.currentState!.validate()) {
|
||||||
RegisterController.instance
|
RegisterController.instance
|
||||||
@@ -698,10 +642,9 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
.initUserProvider());
|
.initUserProvider());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
text: 'Registrarme',
|
||||||
isEnabled: _isChecked,
|
isEnabled: _isChecked,
|
||||||
label: 'Registrarme',
|
)),
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
RichText(
|
RichText(
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
|
|||||||
@@ -5,20 +5,23 @@ class PrimaryButton extends StatelessWidget {
|
|||||||
final String text;
|
final String text;
|
||||||
final double? minWidth;
|
final double? minWidth;
|
||||||
final double? minHeight;
|
final double? minHeight;
|
||||||
|
final bool isEnabled;
|
||||||
|
|
||||||
const PrimaryButton(
|
const PrimaryButton({
|
||||||
{super.key,
|
super.key,
|
||||||
required this.onPressed,
|
required this.onPressed,
|
||||||
required this.text,
|
required this.text,
|
||||||
this.minWidth = 200,
|
this.minWidth = 200,
|
||||||
this.minHeight = 50});
|
this.minHeight = 50,
|
||||||
|
this.isEnabled = true,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ElevatedButton(
|
return ElevatedButton(
|
||||||
onPressed: onPressed,
|
onPressed: isEnabled ? onPressed : null,
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: const Color(0xFF2BA4EC),
|
backgroundColor: isEnabled ? const Color(0xFF2BA4EC) : Colors.grey,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(50),
|
borderRadius: BorderRadius.circular(50),
|
||||||
),
|
),
|
||||||
@@ -27,11 +30,12 @@ class PrimaryButton extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
text,
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: isEnabled ? Colors.white : Colors.black,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 17,
|
fontSize: 17,
|
||||||
),
|
),
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.13.0"
|
version: "5.13.0"
|
||||||
|
animate_do:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: animate_do
|
||||||
|
sha256: "9aeacc1a7238f971c039bdf45d13c628be554a242e0251c4ddda09d19a1a923f"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.2"
|
||||||
animated_splash_screen:
|
animated_splash_screen:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ dependencies:
|
|||||||
universal_html: ^2.2.3
|
universal_html: ^2.2.3
|
||||||
firebase_messaging: ^14.6.3
|
firebase_messaging: ^14.6.3
|
||||||
animated_splash_screen: ^1.3.0
|
animated_splash_screen: ^1.3.0
|
||||||
|
animate_do: ^3.0.2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in New Issue
Block a user