|
@@ -35,6 +35,7 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
final HomeFunction homeFunc = HomeFunction();
|
|
final HomeFunction homeFunc = HomeFunction();
|
|
|
final SharedPreferencesManager sharedPreferencesManager = locator<SharedPreferencesManager>();
|
|
final SharedPreferencesManager sharedPreferencesManager = locator<SharedPreferencesManager>();
|
|
|
bool _timeLimit = false;
|
|
bool _timeLimit = false;
|
|
|
|
|
+ String _localeIndex = 'id';
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
void initState() {
|
|
void initState() {
|
|
@@ -65,15 +66,9 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
|
|
+ _localeIndex = U.newServerVersion(1754624839) ? U.getLangIndex(context.locale.toString()) : context.locale.toString();
|
|
|
return Provider.of<UserModule>(context).user().isNotEmpty?Scaffold(
|
|
return Provider.of<UserModule>(context).user().isNotEmpty?Scaffold(
|
|
|
backgroundColor: backgroundColor,
|
|
backgroundColor: backgroundColor,
|
|
|
- // appBar: PreferredSize(
|
|
|
|
|
- // preferredSize: Size.fromHeight(0),
|
|
|
|
|
- // child: AppBar(
|
|
|
|
|
- // elevation: 0,
|
|
|
|
|
- // backgroundColor: primaryColor,
|
|
|
|
|
- // )
|
|
|
|
|
- // ),
|
|
|
|
|
body: Column(
|
|
body: Column(
|
|
|
children: [
|
|
children: [
|
|
|
Container(
|
|
Container(
|
|
@@ -310,7 +305,12 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
- Padding(padding: EdgeInsets.only(left: 16), child: Text(Provider.of<UserModule>(context).profile()['specialOffer']['label'][context.locale.toString()]??'Not Set', style: TextStyle(color: textColor, fontSize: 17, fontWeight: FontWeight.w500))),
|
|
|
|
|
|
|
+ Padding(
|
|
|
|
|
+ padding: EdgeInsetsDirectional.only(start: 16),
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ Provider.of<UserModule>(context).profile()['specialOffer']['label'][_localeIndex]??'Not Set',
|
|
|
|
|
+ style: TextStyle(color: textColor, fontSize: 17, fontWeight: FontWeight.w500),
|
|
|
|
|
+ )),
|
|
|
SizedBox(height: 12),
|
|
SizedBox(height: 12),
|
|
|
Provider.of<ServiceModule>(context).specialOffer().length > 0 ? SingleChildScrollView(
|
|
Provider.of<ServiceModule>(context).specialOffer().length > 0 ? SingleChildScrollView(
|
|
|
scrollDirection: Axis.horizontal,
|
|
scrollDirection: Axis.horizontal,
|
|
@@ -320,6 +320,11 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
width: U.bodyWidth(context) - 60,
|
|
width: U.bodyWidth(context) - 60,
|
|
|
margin: EdgeInsets.only(left: i==0?16:0, right: 16),
|
|
margin: EdgeInsets.only(left: i==0?16:0, right: 16),
|
|
|
padding: EdgeInsets.only(right: 16),
|
|
padding: EdgeInsets.only(right: 16),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ border: Border.all(color: textColor.withValues(alpha: 0.15)),
|
|
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(12))
|
|
|
|
|
+ ),
|
|
|
child: Row(
|
|
child: Row(
|
|
|
children: [
|
|
children: [
|
|
|
imageTiles(imageUrl: Provider.of<ServiceModule>(context).specialOffer()[i]['_mobileImage'] ?? "null"),
|
|
imageTiles(imageUrl: Provider.of<ServiceModule>(context).specialOffer()[i]['_mobileImage'] ?? "null"),
|
|
@@ -336,11 +341,6 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- color: Colors.white,
|
|
|
|
|
- border: Border.all(color: textColor.withValues(alpha: 0.15)),
|
|
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(12))
|
|
|
|
|
- ),
|
|
|
|
|
),
|
|
),
|
|
|
onTap: ()=>navigateTo(context, MobReqCreatePage(user: Provider.of<UserModule>(context, listen: false).user(), request: Provider.of<ServiceModule>(context, listen: false).specialOffer()[i])),
|
|
onTap: ()=>navigateTo(context, MobReqCreatePage(user: Provider.of<UserModule>(context, listen: false).user(), request: Provider.of<ServiceModule>(context, listen: false).specialOffer()[i])),
|
|
|
)),
|
|
)),
|
|
@@ -355,7 +355,7 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
- Padding(padding: EdgeInsets.only(left: 16), child: Text(Provider.of<UserModule>(context).profile()['frequentlyRequested']['label'][context.locale.toString()]??'Not Set', style: TextStyle(color: textColor, fontSize: 17, fontWeight: FontWeight.w500))),
|
|
|
|
|
|
|
+ Padding(padding: EdgeInsetsDirectional.only(start: 16), child: Text(Provider.of<UserModule>(context).profile()['frequentlyRequested']['label'][_localeIndex]??'Not Set', style: TextStyle(color: textColor, fontSize: 17, fontWeight: FontWeight.w500))),
|
|
|
SizedBox(height: 12),
|
|
SizedBox(height: 12),
|
|
|
Provider.of<ServiceModule>(context).data().length > 0 ? SingleChildScrollView(
|
|
Provider.of<ServiceModule>(context).data().length > 0 ? SingleChildScrollView(
|
|
|
scrollDirection: Axis.horizontal,
|
|
scrollDirection: Axis.horizontal,
|
|
@@ -366,6 +366,11 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
child: Container(
|
|
child: Container(
|
|
|
margin: EdgeInsets.only(left: i==0?16:0, right: 16),
|
|
margin: EdgeInsets.only(left: i==0?16:0, right: 16),
|
|
|
width: U.bodyWidth(context)/(kIsWeb?3.8:2.6), height: U.bodyWidth(context)/(kIsWeb?3:2),
|
|
width: U.bodyWidth(context)/(kIsWeb?3.8:2.6), height: U.bodyWidth(context)/(kIsWeb?3:2),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ border: Border.all(color: textColor.withValues(alpha: 0.15)),
|
|
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(12))
|
|
|
|
|
+ ),
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
@@ -388,7 +393,7 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
- Text(Provider.of<ServiceModule>(context).data()[i][U.langColumn(context, 'subject')], style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ Text(Provider.of<ServiceModule>(context).data()[i][U.langColumn(context, 'subject')]??'', style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 5),
|
|
SizedBox(height: 5),
|
|
|
Text(Provider.of<ServiceModule>(context).data()[i]['_frequentlyCount'].toString() + 'times'.tr(), style: TextStyle(color: textColor, fontSize: 14, fontWeight: FontWeight.w500), overflow: TextOverflow.ellipsis)
|
|
Text(Provider.of<ServiceModule>(context).data()[i]['_frequentlyCount'].toString() + 'times'.tr(), style: TextStyle(color: textColor, fontSize: 14, fontWeight: FontWeight.w500), overflow: TextOverflow.ellipsis)
|
|
|
],
|
|
],
|
|
@@ -396,11 +401,6 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- color: Colors.white,
|
|
|
|
|
- border: Border.all(color: textColor.withValues(alpha: 0.15)),
|
|
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(12))
|
|
|
|
|
- ),
|
|
|
|
|
),
|
|
),
|
|
|
onTap: ()=>navigateTo(context, MobReqCreatePage(user: Provider.of<UserModule>(context, listen: false).user(), request: Provider.of<ServiceModule>(context, listen: false).data()[i])).then((val){
|
|
onTap: ()=>navigateTo(context, MobReqCreatePage(user: Provider.of<UserModule>(context, listen: false).user(), request: Provider.of<ServiceModule>(context, listen: false).data()[i])).then((val){
|
|
|
val = val??true;
|
|
val = val??true;
|
|
@@ -419,7 +419,7 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
- Text(Provider.of<UserModule>(context).profile()['banner']['label'][context.locale.toString()]??'Not Set', style: TextStyle(color: textColor, fontSize: 17, fontWeight: FontWeight.w500)),
|
|
|
|
|
|
|
+ Text(Provider.of<UserModule>(context).profile()['banner']['label'][_localeIndex]??'Not Set', style: TextStyle(color: textColor, fontSize: 17, fontWeight: FontWeight.w500)),
|
|
|
SizedBox(height: 12),
|
|
SizedBox(height: 12),
|
|
|
Provider.of<ServiceModule>(context).banner().isNotEmpty ? CarouselSlider.builder(
|
|
Provider.of<ServiceModule>(context).banner().isNotEmpty ? CarouselSlider.builder(
|
|
|
itemCount: Provider.of<ServiceModule>(context).banner().length,
|
|
itemCount: Provider.of<ServiceModule>(context).banner().length,
|
|
@@ -438,6 +438,11 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
itemBuilder: (BuildContext context, int i, int pageViewIndex) => GestureDetector(
|
|
itemBuilder: (BuildContext context, int i, int pageViewIndex) => GestureDetector(
|
|
|
child: Container(
|
|
child: Container(
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ border: Border.all(color: textColor.withValues(alpha: 0.15)),
|
|
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(12))
|
|
|
|
|
+ ),
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
@@ -493,11 +498,6 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- color: Colors.white,
|
|
|
|
|
- border: Border.all(color: textColor.withValues(alpha: 0.15)),
|
|
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(12))
|
|
|
|
|
- ),
|
|
|
|
|
),
|
|
),
|
|
|
onTap: ()=>navigateTo(context, MobBannerDetailPage(user: Provider.of<UserModule>(context, listen: false).user(), data: Provider.of<ServiceModule>(context, listen: false).banner()[i])).then((val){
|
|
onTap: ()=>navigateTo(context, MobBannerDetailPage(user: Provider.of<UserModule>(context, listen: false).user(), data: Provider.of<ServiceModule>(context, listen: false).banner()[i])).then((val){
|
|
|
val = val??true;
|
|
val = val??true;
|
|
@@ -514,14 +514,28 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
- Text(Provider.of<UserModule>(context).profile()['quickAction']['label'][context.locale.toString()]??'Not Set', style: TextStyle(color: textColor, fontSize: 17, fontWeight: FontWeight.w500)),
|
|
|
|
|
|
|
+ Text(Provider.of<UserModule>(context).profile()['quickAction']['label'][_localeIndex]??'Not Set', style: TextStyle(color: textColor, fontSize: 17, fontWeight: FontWeight.w500)),
|
|
|
SizedBox(height: 12),
|
|
SizedBox(height: 12),
|
|
|
Provider.of<ServiceModule>(context).quickAct().length > 0 ? Container(
|
|
Provider.of<ServiceModule>(context).quickAct().length > 0 ? Container(
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ border: Border.all(color: textColor.withValues(alpha: 0.15)),
|
|
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(12))
|
|
|
|
|
+ ),
|
|
|
child: Column(
|
|
child: Column(
|
|
|
children: List.generate(Provider.of<ServiceModule>(context).quickAct().length, (i){
|
|
children: List.generate(Provider.of<ServiceModule>(context).quickAct().length, (i){
|
|
|
return GestureDetector(
|
|
return GestureDetector(
|
|
|
child: Container(
|
|
child: Container(
|
|
|
padding: EdgeInsets.all(12),
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
|
|
+ topLeft: Radius.circular(i==0?12:0),
|
|
|
|
|
+ topRight: Radius.circular(i==0?12:0),
|
|
|
|
|
+ bottomLeft: Radius.circular(i==Provider.of<ServiceModule>(context).quickAct().length-1?12:0),
|
|
|
|
|
+ bottomRight: Radius.circular(i==Provider.of<ServiceModule>(context).quickAct().length-1?12:0),
|
|
|
|
|
+ )
|
|
|
|
|
+ ),
|
|
|
child: Row(
|
|
child: Row(
|
|
|
children: [
|
|
children: [
|
|
|
imageTiles(imageUrl: Provider.of<ServiceModule>(context).quickAct()[i]['_mobileImage'] ?? "null", width: 50, height: 40, radius: 5),
|
|
imageTiles(imageUrl: Provider.of<ServiceModule>(context).quickAct()[i]['_mobileImage'] ?? "null", width: 50, height: 40, radius: 5),
|
|
@@ -532,25 +546,11 @@ class _MobHomePageState extends State<MobHomePage> with WidgetsBindingObserver {
|
|
|
U.iconsax('arrow-right-3', size: 14, color: textColor.withValues(alpha: 0.75)),
|
|
U.iconsax('arrow-right-3', size: 14, color: textColor.withValues(alpha: 0.75)),
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- color: Colors.white,
|
|
|
|
|
- borderRadius: BorderRadius.only(
|
|
|
|
|
- topLeft: Radius.circular(i==0?12:0),
|
|
|
|
|
- topRight: Radius.circular(i==0?12:0),
|
|
|
|
|
- bottomLeft: Radius.circular(i==Provider.of<ServiceModule>(context).quickAct().length-1?12:0),
|
|
|
|
|
- bottomRight: Radius.circular(i==Provider.of<ServiceModule>(context).quickAct().length-1?12:0),
|
|
|
|
|
- )
|
|
|
|
|
- ),
|
|
|
|
|
),
|
|
),
|
|
|
onTap: ()=>navigateTo(context, MobReqCreatePage(user: Provider.of<UserModule>(context, listen: false).user(), request: Provider.of<ServiceModule>(context, listen: false).quickAct()[i])),
|
|
onTap: ()=>navigateTo(context, MobReqCreatePage(user: Provider.of<UserModule>(context, listen: false).user(), request: Provider.of<ServiceModule>(context, listen: false).quickAct()[i])),
|
|
|
);
|
|
);
|
|
|
}),
|
|
}),
|
|
|
),
|
|
),
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- color: Colors.white,
|
|
|
|
|
- border: Border.all(color: textColor.withValues(alpha: 0.15)),
|
|
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(12))
|
|
|
|
|
- ),
|
|
|
|
|
) : emptyWidget(left: 0)
|
|
) : emptyWidget(left: 0)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
@@ -638,11 +638,11 @@ class _MobMenuDisplayPageState extends State<MobMenuDisplayPage> {
|
|
|
child: Container(
|
|
child: Container(
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
|
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
|
|
margin: EdgeInsets.only(right: 15),
|
|
margin: EdgeInsets.only(right: 15),
|
|
|
- child: Text('customize'.tr(), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
|
color: primaryColor.withValues(alpha: 0.1),
|
|
color: primaryColor.withValues(alpha: 0.1),
|
|
|
borderRadius: BorderRadius.all(Radius.circular(50))
|
|
borderRadius: BorderRadius.all(Radius.circular(50))
|
|
|
),
|
|
),
|
|
|
|
|
+ child: Text('customize'.tr(), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
),
|
|
),
|
|
|
onTap: (){
|
|
onTap: (){
|
|
|
navigateTo(context, MobMenuEditorPage(scope: widget.scope));
|
|
navigateTo(context, MobMenuEditorPage(scope: widget.scope));
|