|
|
|
@ -5,9 +5,12 @@ import 'package:provider/provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/extensions/string_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
import 'package:test_sa/models/site_contact_info_model.dart';
|
|
|
|
import 'package:test_sa/models/site_contact_info_model.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/item_views/info_text_widget.dart';
|
|
|
|
import 'package:test_sa/views/widgets/loaders/no_data_found.dart';
|
|
|
|
import 'package:test_sa/views/widgets/loaders/no_data_found.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
import 'package:url_launcher/url_launcher_string.dart';
|
|
|
|
import 'package:url_launcher/url_launcher_string.dart';
|
|
|
|
@ -60,21 +63,18 @@ class ContactUsBottomSheet extends StatelessWidget {
|
|
|
|
8.width,
|
|
|
|
8.width,
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
spacing: 4,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
InfoHeaderWidget(
|
|
|
|
sites[index].siteName ?? "",
|
|
|
|
sites[index].siteName ?? "",
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
4.height,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
sites[index].phoneNumber ?? "",
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
InfoTextWidget(label: sites[index].phoneNumber ?? "", isMsg: true, showEmptyValue: true),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).expanded,
|
|
|
|
).expanded,
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
icon: const Icon(Icons.copy_rounded),
|
|
|
|
icon: const Icon(Icons.copy_rounded),
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
color: AppColor.icon2Color(context),
|
|
|
|
iconSize: 20,
|
|
|
|
iconSize: 20,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
Clipboard.setData(ClipboardData(text: sites[index].phoneNumber!));
|
|
|
|
Clipboard.setData(ClipboardData(text: sites[index].phoneNumber!));
|
|
|
|
@ -83,6 +83,7 @@ class ContactUsBottomSheet extends StatelessWidget {
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
icon: const Icon(Icons.call),
|
|
|
|
icon: const Icon(Icons.call),
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
color: AppColor.icon2Color(context),
|
|
|
|
iconSize: 20,
|
|
|
|
iconSize: 20,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
final Uri launchUri = Uri(scheme: 'tel', path: sites[index].phoneNumber!);
|
|
|
|
final Uri launchUri = Uri(scheme: 'tel', path: sites[index].phoneNumber!);
|
|
|
|
@ -90,7 +91,7 @@ class ContactUsBottomSheet extends StatelessWidget {
|
|
|
|
if (await canLaunchUrl(launchUri)) {
|
|
|
|
if (await canLaunchUrl(launchUri)) {
|
|
|
|
await launchUrl(launchUri);
|
|
|
|
await launchUrl(launchUri);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// Handle error, e.g., show a snackbar
|
|
|
|
"You don't have any calling supported application, Please install.".showToast;
|
|
|
|
throw 'Could not launch $launchUri';
|
|
|
|
throw 'Could not launch $launchUri';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|