|
|
|
|
@ -1,9 +1,15 @@
|
|
|
|
|
import 'package:clipboard/clipboard.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
|
import 'package:provider/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/int_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:test_sa/models/site_contact_info_model.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/loaders/no_data_found.dart';
|
|
|
|
|
import 'package:url_launcher/url_launcher_string.dart';
|
|
|
|
|
|
|
|
|
|
import '../../app_style/app_color.dart';
|
|
|
|
|
@ -15,8 +21,11 @@ class ContactUsBottomSheet extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
// String contactNumber = "+966 546345567";
|
|
|
|
|
String contactNumber = "";
|
|
|
|
|
List<SiteContactInfoModel> sites = Provider.of<UserProvider>(context, listen: false).siteContactList;
|
|
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
height: MediaQuery.sizeOf(context).height * .5,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
borderRadius: const BorderRadius.only(
|
|
|
|
|
@ -25,6 +34,7 @@ class ContactUsBottomSheet extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
|
|
|
|
|
child: SafeArea(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
@ -41,7 +51,43 @@ class ContactUsBottomSheet extends StatelessWidget {
|
|
|
|
|
style: AppTextStyles.heading3.copyWith(fontWeight: FontWeight.w600, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
16.height,
|
|
|
|
|
4.height,
|
|
|
|
|
if (sites.isNotEmpty)
|
|
|
|
|
ListView.separated(
|
|
|
|
|
padding: const EdgeInsets.only(top: 12, bottom: 12),
|
|
|
|
|
itemBuilder: (cxt, index) => Row(
|
|
|
|
|
children: [
|
|
|
|
|
8.width,
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).expanded,
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: const Icon(Icons.copy_rounded),
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
iconSize: 20,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
FlutterClipboard.copy('Hello Flutter friends');
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context, padding: 8),
|
|
|
|
|
separatorBuilder: (cxt, index) => 12.height,
|
|
|
|
|
itemCount: sites.length)
|
|
|
|
|
.expanded
|
|
|
|
|
else
|
|
|
|
|
const NoDataFound().paddingOnly(top: 80).center
|
|
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// contactItem(context, context.isDark, "phone", context.translation.callUs, contactNumber).onPress(() {
|
|
|
|
|
@ -55,9 +101,10 @@ class ContactUsBottomSheet extends StatelessWidget {
|
|
|
|
|
// }).expanded,
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
32.height,
|
|
|
|
|
// 32.height,
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|