terminos y condiciones clikeables
This commit is contained in:
+81
-14
@@ -1,3 +1,5 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -5,8 +7,11 @@ import 'package:intl_phone_field/intl_phone_field.dart';
|
||||
import 'package:prosappco/src/components/bottom_sheet.dart';
|
||||
import 'package:prosappco/src/components/primary_btn.dart';
|
||||
import 'package:prosappco/src/controllers/phone_auth_controller.dart';
|
||||
import 'package:prosappco/src/models/setting_model.dart';
|
||||
import 'package:prosappco/src/screens/code_validation.dart';
|
||||
import 'package:prosappco/src/screens/web_view.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class LoginScreen extends StatefulWidget {
|
||||
const LoginScreen({super.key});
|
||||
@@ -20,6 +25,27 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
String completePhoneNumber = '';
|
||||
bool _isChecked = false;
|
||||
SettingModel? settings;
|
||||
|
||||
void _launchURL(String url) async {
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url, forceSafariVC: false, forceWebView: false);
|
||||
} else {
|
||||
throw 'No se pudo abrir el enlace $url';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (settings == null) {
|
||||
SettingModel.getSettings().then(
|
||||
(SettingModel value) => setState(() {
|
||||
settings = value;
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -102,8 +128,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center, // Centra horizontalmente
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Checkbox(
|
||||
value: _isChecked,
|
||||
@@ -113,11 +138,31 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
});
|
||||
},
|
||||
),
|
||||
const Text(
|
||||
'Acepto los términos y condiciones.',
|
||||
style: TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Color(0xFF65676B),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (kIsWeb) {
|
||||
_launchURL(settings?.proliticasPrivacidad ?? '');
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebViewScreen(
|
||||
label: 'Políticas de privacidad',
|
||||
link: settings?.proliticasPrivacidad ?? '',
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: const Text(
|
||||
'Acepto los términos y condiciones.',
|
||||
style: TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Color(0xFF65676B),
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -251,8 +296,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center, // Centra horizontalmente
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Checkbox(
|
||||
value: _isChecked,
|
||||
@@ -262,11 +306,34 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
});
|
||||
},
|
||||
),
|
||||
const Text(
|
||||
'Acepto los términos y condiciones.',
|
||||
style: TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Color(0xFF65676B),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (kIsWeb) {
|
||||
_launchURL(
|
||||
settings?.proliticasPrivacidad ?? '');
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebViewScreen(
|
||||
label: 'Políticas de privacidad',
|
||||
link: settings?.proliticasPrivacidad ??
|
||||
'',
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: const Text(
|
||||
'Acepto los términos y condiciones.',
|
||||
style: TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Color(0xFF65676B),
|
||||
decoration: TextDecoration
|
||||
.underline, // Add underline style
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -7,8 +8,11 @@ import 'package:prosappco/main.dart';
|
||||
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||
import 'package:prosappco/src/components/primary_btn.dart';
|
||||
import 'package:prosappco/src/controllers/register_controller.dart';
|
||||
import 'package:prosappco/src/models/setting_model.dart';
|
||||
import 'package:prosappco/src/screens/login.dart';
|
||||
import 'package:prosappco/src/screens/web_view.dart';
|
||||
import 'package:responsive_builder/responsive_builder.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class RegisterScreen extends StatefulWidget {
|
||||
const RegisterScreen({super.key});
|
||||
@@ -22,6 +26,27 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
||||
final controller = Get.put(RegisterController());
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
bool _isChecked = false;
|
||||
SettingModel? settings;
|
||||
|
||||
void _launchURL(String url) async {
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url, forceSafariVC: false, forceWebView: false);
|
||||
} else {
|
||||
throw 'No se pudo abrir el enlace $url';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (settings == null) {
|
||||
SettingModel.getSettings().then(
|
||||
(SettingModel value) => setState(() {
|
||||
settings = value;
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -305,10 +330,33 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
||||
});
|
||||
},
|
||||
),
|
||||
const Text(
|
||||
'Acepto los términos y condiciones.',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF65676B),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (kIsWeb) {
|
||||
_launchURL(
|
||||
settings?.proliticasPrivacidad ?? '');
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebViewScreen(
|
||||
label: 'Políticas de privacidad',
|
||||
link:
|
||||
settings?.proliticasPrivacidad ??
|
||||
'',
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: const Text(
|
||||
'Acepto los términos y condiciones.',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF65676B),
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -582,10 +630,33 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
||||
});
|
||||
},
|
||||
),
|
||||
const Text(
|
||||
'Acepto los términos y condiciones.',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF65676B),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (kIsWeb) {
|
||||
_launchURL(
|
||||
settings?.proliticasPrivacidad ?? '');
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebViewScreen(
|
||||
label: 'Políticas de privacidad',
|
||||
link: settings
|
||||
?.proliticasPrivacidad ??
|
||||
'',
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: const Text(
|
||||
'Acepto los términos y condiciones.',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF65676B),
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user