terminos y condiciones web solucionado

This commit is contained in:
Juan Felipe Duarte
2023-06-08 14:45:19 -05:00
parent 53c948aec1
commit f97f6978df
5 changed files with 45 additions and 28 deletions
+40 -22
View File
@@ -1,8 +1,10 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:prosappco/src/components/pop_appbar.dart'; import 'package:prosappco/src/components/pop_appbar.dart';
import 'package:prosappco/src/models/setting_model.dart'; import 'package:prosappco/src/models/setting_model.dart';
import 'package:prosappco/src/screens/web_view.dart'; import 'package:prosappco/src/screens/web_view.dart';
import 'package:url_launcher/url_launcher.dart';
class AboutScreen extends StatefulWidget { class AboutScreen extends StatefulWidget {
const AboutScreen({super.key}); const AboutScreen({super.key});
@@ -26,6 +28,14 @@ class _AboutScreenState extends State<AboutScreen> {
} }
} }
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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@@ -38,17 +48,21 @@ class _AboutScreenState extends State<AboutScreen> {
children: [ children: [
ListTile( ListTile(
onTap: () { onTap: () {
Navigator.push( if (kIsWeb) {
context, _launchURL(settings?.proliticasPrivacidad ?? '');
CupertinoPageRoute( } else {
builder: (BuildContext context) { Navigator.push(
return WebViewScreen( context,
label: 'Políticas de privacidad', CupertinoPageRoute(
link: settings?.proliticasPrivacidad ?? '', builder: (BuildContext context) {
); return WebViewScreen(
}, label: 'Políticas de privacidad',
), link: settings?.proliticasPrivacidad ?? '',
); );
},
),
);
}
}, },
title: const Text('Políticas de privacidad'), title: const Text('Políticas de privacidad'),
trailing: trailing:
@@ -56,17 +70,21 @@ class _AboutScreenState extends State<AboutScreen> {
), ),
ListTile( ListTile(
onTap: () { onTap: () {
Navigator.push( if (kIsWeb) {
context, _launchURL(settings?.terminosCondiciones ?? '');
CupertinoPageRoute( } else {
builder: (BuildContext context) { Navigator.push(
return WebViewScreen( context,
label: 'Términos y condiciones', CupertinoPageRoute(
link: settings?.terminosCondiciones ?? '', builder: (BuildContext context) {
); return WebViewScreen(
}, label: 'Términos y condiciones',
), link: settings?.terminosCondiciones ?? '',
); );
},
),
);
}
}, },
title: const Text('Términos y condiciones'), title: const Text('Términos y condiciones'),
trailing: trailing:
-1
View File
@@ -5,7 +5,6 @@ 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/primary_btn.dart'; import 'package:prosappco/src/components/primary_btn.dart';
import 'package:prosappco/src/controllers/new_phone_controller.dart'; import 'package:prosappco/src/controllers/new_phone_controller.dart';
import 'package:prosappco/src/controllers/phone_auth_controller.dart';
class NewNumberScreen extends StatefulWidget { class NewNumberScreen extends StatefulWidget {
const NewNumberScreen({super.key}); const NewNumberScreen({super.key});
+2 -2
View File
@@ -115,8 +115,8 @@ class _ProfessionalInfoScreenState extends State<ProfessionalInfoScreen> {
), ),
], ],
), ),
child: Row( child: const Row(
children: const [ children: [
Icon( Icon(
Icons.error_outline, Icons.error_outline,
size: 27, size: 27,
+2 -2
View File
@@ -204,9 +204,9 @@ class _ServiceAfterScreenState extends State<ServiceAfterScreen> {
style: style:
TextStyle(color: Colors.grey[600], fontStyle: FontStyle.italic), TextStyle(color: Colors.grey[600], fontStyle: FontStyle.italic),
), ),
Center( const Center(
child: Column( child: Column(
children: const [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric(vertical: 20), padding: EdgeInsets.symmetric(vertical: 20),
child: Icon( child: Icon(
+1 -1
View File
@@ -33,7 +33,7 @@ class _WebViewScreenState extends State<WebViewScreen> {
}, },
), ),
) )
..loadRequest(Uri.parse('${widget.link}')); ..loadRequest(Uri.parse(widget.link));
return Scaffold( return Scaffold(
appBar: PopAppbar( appBar: PopAppbar(
onPressed: () { onPressed: () {