mailto url launcher added
This commit is contained in:
parent
c6dc8bce58
commit
156e241994
|
|
@ -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/features/widgets/sapaly_app_bar.dart';
|
||||||
import 'package:sapaly_shop/models/settings_model.dart';
|
import 'package:sapaly_shop/models/settings_model.dart';
|
||||||
import 'package:sapaly_shop/providers/user_provider.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 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
|
||||||
import '../../../themes/app_theme.dart';
|
import '../../../themes/app_theme.dart';
|
||||||
|
|
@ -24,6 +25,7 @@ class _ProfileScreenState extends State<SettingsScreen> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var me = Provider.of<UserProvider>(context, listen: false);
|
var me = Provider.of<UserProvider>(context, listen: false);
|
||||||
final GlobalKey<ScaffoldState> _key = GlobalKey();
|
final GlobalKey<ScaffoldState> _key = GlobalKey();
|
||||||
|
String email = 'demir.at@gmail.com';
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
drawer: SapalyDrawer(),
|
drawer: SapalyDrawer(),
|
||||||
backgroundColor: AppTheme.lightBackgroundColor,
|
backgroundColor: AppTheme.lightBackgroundColor,
|
||||||
|
|
@ -185,54 +187,54 @@ class _ProfileScreenState extends State<SettingsScreen> {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
GestureDetector(
|
||||||
children: [
|
onTap: () {
|
||||||
GestureDetector(
|
launchUrlString('tel://+99361445445');
|
||||||
onTap: () {
|
},
|
||||||
launchUrlString('tel://+99361445445');
|
child: Row(
|
||||||
Navigator.of(context).pop();
|
children: [
|
||||||
},
|
const Icon(Icons.phone_outlined,
|
||||||
child: const Icon(Icons.phone_outlined,
|
|
||||||
color: AppTheme.lightPrimaryColor),
|
color: AppTheme.lightPrimaryColor),
|
||||||
),
|
SizedBox(width: 10.adaptedPx()),
|
||||||
SizedBox(width: 10.adaptedPx()),
|
Text(
|
||||||
Text(
|
'+993 61 445445',
|
||||||
'+993 61 445445',
|
style: Theme.of(context)
|
||||||
style: Theme.of(context)
|
.primaryTextTheme
|
||||||
.primaryTextTheme
|
.bodyMedium
|
||||||
.bodyMedium
|
?.copyWith(
|
||||||
?.copyWith(
|
fontSize: 15.adaptedPx(),
|
||||||
fontSize: 15.adaptedPx(),
|
fontWeight: FontWeight.w600,
|
||||||
fontWeight: FontWeight.w600,
|
color: AppTheme.blackColor,
|
||||||
color: AppTheme.blackColor,
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 15.adaptedPx()),
|
SizedBox(height: 15.adaptedPx()),
|
||||||
Row(
|
GestureDetector(
|
||||||
children: [
|
onTap: () async {
|
||||||
GestureDetector(
|
if (await canLaunchUrlString("mailto:$email")) {
|
||||||
onTap: () {
|
await launchUrlString("mailto:$email");
|
||||||
launchUrlString('mailto://demir.at@gmail.com');
|
}
|
||||||
Navigator.of(context).pop();
|
},
|
||||||
},
|
child: Row(
|
||||||
child: const Icon(Icons.mail_outline,
|
children: [
|
||||||
|
const Icon(Icons.mail_outline,
|
||||||
color: AppTheme.lightPrimaryColor),
|
color: AppTheme.lightPrimaryColor),
|
||||||
),
|
SizedBox(width: 10.adaptedPx()),
|
||||||
SizedBox(width: 10.adaptedPx()),
|
Text(
|
||||||
Text(
|
'demir.at@gmail.com',
|
||||||
'demir.at@gmail.com',
|
style: Theme.of(context)
|
||||||
style: Theme.of(context)
|
.primaryTextTheme
|
||||||
.primaryTextTheme
|
.bodyMedium
|
||||||
.bodyMedium
|
?.copyWith(
|
||||||
?.copyWith(
|
fontSize: 15.adaptedPx(),
|
||||||
fontSize: 15.adaptedPx(),
|
fontWeight: FontWeight.w600,
|
||||||
fontWeight: FontWeight.w600,
|
color: AppTheme.blackColor,
|
||||||
color: AppTheme.blackColor,
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 15.adaptedPx()),
|
SizedBox(height: 15.adaptedPx()),
|
||||||
Row(
|
Row(
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import 'models/settings_model.dart';
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
||||||
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
||||||
Future.delayed(const Duration(seconds: 3));
|
Future.delayed(const Duration(seconds: 5));
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
await SettingsModel.initLocalization(
|
await SettingsModel.initLocalization(
|
||||||
prefs.getString('language') ?? kDefaultLanguage);
|
prefs.getString('language') ?? kDefaultLanguage);
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ dependencies:
|
||||||
photo_view: ^0.14.0
|
photo_view: ^0.14.0
|
||||||
|
|
||||||
flutter_native_splash:
|
flutter_native_splash:
|
||||||
color: "#5677fc"
|
color: "#728efd"
|
||||||
image: "assets/images/logoBig.png"
|
image: "assets/images/logoBig.png"
|
||||||
# android_gravity: center
|
# android_gravity: center
|
||||||
fullscreen: true
|
fullscreen: true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue