mailto url launcher added

This commit is contained in:
meylis98 2023-03-09 14:12:07 +05:00
parent c6dc8bce58
commit 156e241994
3 changed files with 48 additions and 46 deletions

View File

@ -8,6 +8,7 @@ import 'package:sapaly_shop/features/screens/drawer/sapaly_drawer.dart';
import 'package:sapaly_shop/features/widgets/sapaly_app_bar.dart';
import 'package:sapaly_shop/models/settings_model.dart';
import 'package:sapaly_shop/providers/user_provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
import '../../../themes/app_theme.dart';
@ -24,6 +25,7 @@ class _ProfileScreenState extends State<SettingsScreen> {
Widget build(BuildContext context) {
var me = Provider.of<UserProvider>(context, listen: false);
final GlobalKey<ScaffoldState> _key = GlobalKey();
String email = 'demir.at@gmail.com';
return Scaffold(
drawer: SapalyDrawer(),
backgroundColor: AppTheme.lightBackgroundColor,
@ -185,54 +187,54 @@ class _ProfileScreenState extends State<SettingsScreen> {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
GestureDetector(
onTap: () {
launchUrlString('tel://+99361445445');
Navigator.of(context).pop();
},
child: const Icon(Icons.phone_outlined,
GestureDetector(
onTap: () {
launchUrlString('tel://+99361445445');
},
child: Row(
children: [
const Icon(Icons.phone_outlined,
color: AppTheme.lightPrimaryColor),
),
SizedBox(width: 10.adaptedPx()),
Text(
'+993 61 445445',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
],
SizedBox(width: 10.adaptedPx()),
Text(
'+993 61 445445',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
],
),
),
SizedBox(height: 15.adaptedPx()),
Row(
children: [
GestureDetector(
onTap: () {
launchUrlString('mailto://demir.at@gmail.com');
Navigator.of(context).pop();
},
child: const Icon(Icons.mail_outline,
GestureDetector(
onTap: () async {
if (await canLaunchUrlString("mailto:$email")) {
await launchUrlString("mailto:$email");
}
},
child: Row(
children: [
const Icon(Icons.mail_outline,
color: AppTheme.lightPrimaryColor),
),
SizedBox(width: 10.adaptedPx()),
Text(
'demir.at@gmail.com',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
],
SizedBox(width: 10.adaptedPx()),
Text(
'demir.at@gmail.com',
style: Theme.of(context)
.primaryTextTheme
.bodyMedium
?.copyWith(
fontSize: 15.adaptedPx(),
fontWeight: FontWeight.w600,
color: AppTheme.blackColor,
),
),
],
),
),
SizedBox(height: 15.adaptedPx()),
Row(

View File

@ -20,7 +20,7 @@ import 'models/settings_model.dart';
Future<void> main() async {
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
Future.delayed(const Duration(seconds: 3));
Future.delayed(const Duration(seconds: 5));
SharedPreferences prefs = await SharedPreferences.getInstance();
await SettingsModel.initLocalization(
prefs.getString('language') ?? kDefaultLanguage);

View File

@ -54,7 +54,7 @@ dependencies:
photo_view: ^0.14.0
flutter_native_splash:
color: "#5677fc"
color: "#728efd"
image: "assets/images/logoBig.png"
# android_gravity: center
fullscreen: true