configuracion - sugerencias - soporte
This commit is contained in:
@@ -1,12 +1,28 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:prosappco/components/general_drawer_header.dart';
|
||||
import 'package:prosappco/components/general_drawer_item.dart';
|
||||
import 'package:prosappco/screens/configuration/configuration_screen.dart';
|
||||
import 'package:prosappco/screens/configuration/configuration_support_screen.dart';
|
||||
import 'package:prosappco/screens/web/web_view_screen.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class GeneralDrawer extends StatelessWidget {
|
||||
const GeneralDrawer({super.key});
|
||||
|
||||
Future<void> _irSugerencias() async {
|
||||
const url = 'https://admin.prosapp.co/sugerencias';
|
||||
|
||||
final Uri _url = Uri.parse(url);
|
||||
|
||||
if (await canLaunchUrl(_url)) {
|
||||
await launchUrl(_url);
|
||||
} else {
|
||||
throw 'No se pudo abrir la URL $url';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
@@ -49,13 +65,33 @@ class GeneralDrawer extends StatelessWidget {
|
||||
label: 'Soporte',
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) =>
|
||||
const ConfigurationSupportScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
GeneralDrawerItem(
|
||||
leading: Icons.campaign_outlined,
|
||||
label: 'Sugerencias',
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
if (kIsWeb) {
|
||||
_irSugerencias();
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebViewScreen(
|
||||
label: 'Sugerencias',
|
||||
link: 'https://admin.prosapp.co/sugerencias');
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -2,24 +2,26 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class GeneralDrawerItem extends StatelessWidget {
|
||||
final String label;
|
||||
final String? subtitle;
|
||||
final IconData? leading;
|
||||
final bool trailing;
|
||||
final Color? color;
|
||||
final VoidCallback onTap;
|
||||
final VoidCallback? onTap;
|
||||
|
||||
const GeneralDrawerItem({
|
||||
super.key,
|
||||
required this.label,
|
||||
this.subtitle,
|
||||
this.leading,
|
||||
this.trailing = false,
|
||||
this.color,
|
||||
required this.onTap,
|
||||
this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
onTap: onTap,
|
||||
onTap: onTap == null ? null : () => onTap!(),
|
||||
leading: leading == null
|
||||
? null
|
||||
: Icon(
|
||||
@@ -36,6 +38,10 @@ class GeneralDrawerItem extends StatelessWidget {
|
||||
label,
|
||||
style: TextStyle(fontSize: 15, color: color),
|
||||
),
|
||||
subtitle: subtitle == null
|
||||
? null
|
||||
: Text(subtitle ?? "", style: const TextStyle(color: Colors.black54)),
|
||||
// dense: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user