pushing again with main activity

aamir_dev
Faiz Hashmi 1 year ago
parent b38a5e4b69
commit 3ccb9d4955

@ -0,0 +1,7 @@
package com.cloud.solutions.mowater.ksa.provider
import io.flutter.embedding.android.FlutterFragmentActivity
class MainActivity: FlutterFragmentActivity() {
}

@ -1,7 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:car_provider_app/config/provider_routes.dart'; import 'package:car_provider_app/config/provider_routes.dart';
import 'package:car_provider_app/views/settings/branch/dealer/widget/assign_dealer_user_sheet.dart'; import 'package:car_provider_app/views/settings/branch/dealer/widget/assign_dealer_user_sheet.dart';
import 'package:flutter/cupertino.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/view_models/service_view_model.dart'; import 'package:mc_common_app/view_models/service_view_model.dart';
import 'package:car_provider_app/views/settings/services/services_list_page.dart'; import 'package:car_provider_app/views/settings/services/services_list_page.dart';
@ -96,21 +95,31 @@ class BranchDetailPage extends StatelessWidget {
actionWidget = Column( actionWidget = Column(
children: [ children: [
Row( Row(
children: [ children: [('${LocaleKeys.rejectionComments.tr()}:').toText(fontSize: 16, color: MyColors.darkTextColor, textAlign: TextAlign.right)],
('${LocaleKeys.rejectionComments.tr()}:').toText(fontSize: 16, color: MyColors.darkTextColor),
],
), ),
Row( Row(
children: [ children: [
if (branchData.branchAuditTrial != null && branchData.branchAuditTrial!.isNotEmpty) ...[
Flexible( Flexible(
child: ('These are some dummy static comments from the Admin. Which will guide you regarding the next steps to resubmit.').toText( child: ("${branchData.branchAuditTrial!.first.comment}").toText(
fontSize: 14, fontSize: 14,
color: MyColors.primaryColor, color: MyColors.primaryColor,
isItalic: true, isItalic: true,
), ),
), ),
]
], ],
), ),
12.height,
ShowFillButton(
title: LocaleKeys.rejectedFormAdmin.tr(),
maxWidth: double.infinity,
backgroundColor: MyColors.darkWhiteColor,
borderColor: MyColors.darkPrimaryColor,
txtColor: MyColors.lightTextColor,
isFilled: true,
onPressed: () {},
),
], ],
); );
} }
@ -120,7 +129,7 @@ class BranchDetailPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
filterBranch(); filterBranch();
getBranchUsers(context); // getBranchUsers(context);
return Scaffold( return Scaffold(
appBar: CustomAppBar(title: LocaleKeys.branchDetail.tr()), appBar: CustomAppBar(title: LocaleKeys.branchDetail.tr()),
body: Consumer<ServiceVM>(builder: (context, model, _) { body: Consumer<ServiceVM>(builder: (context, model, _) {
@ -140,8 +149,11 @@ class BranchDetailPage extends StatelessWidget {
Expanded( Expanded(
child: Row( child: Row(
children: [ children: [
branchData.branchProfileImage.buildNetworkImage(), branchData.branchProfileImage.buildNetworkImage(
12.width, height: 55,
width: 50,
),
10.width,
LocaleKeys.branchInfo.tr().toText(fontSize: 16, color: Colors.black, isBold: true), LocaleKeys.branchInfo.tr().toText(fontSize: 16, color: Colors.black, isBold: true),
], ],
), ),
@ -162,9 +174,11 @@ class BranchDetailPage extends StatelessWidget {
showData("${LocaleKeys.city.tr()}:", branchData.cityName.toString()), showData("${LocaleKeys.city.tr()}:", branchData.cityName.toString()),
showData("${LocaleKeys.branchName.tr()}:", branchData.branchName.toString()), showData("${LocaleKeys.branchName.tr()}:", branchData.branchName.toString()),
showData("${LocaleKeys.branchDescription.tr()}:", branchData.branchDescription.toString()), showData("${LocaleKeys.branchDescription.tr()}:", branchData.branchDescription.toString()),
showData("${LocaleKeys.branchDescription.tr()}:", branchData.branchDescription.toString()),
showData("${LocaleKeys.time.tr()}:", "${branchData.openTime.toString()} - ${branchData.closeTime.toString()}"),
showData("${LocaleKeys.address.tr()}:", branchData.address.toString()), showData("${LocaleKeys.address.tr()}:", branchData.address.toString()),
], ],
), ).paddingOnly(left: 60),
], ],
).horPaddingMain(), ).horPaddingMain(),
10.height, 10.height,
@ -281,10 +295,7 @@ class BranchDetailPage extends StatelessWidget {
child: ListView.builder( child: ListView.builder(
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
child: (EasyLocalization child: (EasyLocalization.of(context)?.currentLocale?.countryCode == "SA"
.of(context)
?.currentLocale
?.countryCode == "SA"
? categories[pIndex].services![index].serviceDescriptionN.toString() ? categories[pIndex].services![index].serviceDescriptionN.toString()
: categories[pIndex].services![index].serviceDescription.toString()) : categories[pIndex].services![index].serviceDescription.toString())
.toText( .toText(
@ -348,9 +359,7 @@ class BranchDetailPage extends StatelessWidget {
bool validation(BuildContext context) { bool validation(BuildContext context) {
bool isValid = false; bool isValid = false;
for (var element in context for (var element in context.read<ServiceVM>().allProviderDealersList) {
.read<ServiceVM>()
.allProviderDealersList) {
if (element.isBranchUser ?? false) { if (element.isBranchUser ?? false) {
isValid = true; isValid = true;
} }

@ -45,9 +45,7 @@ class _CreateBranchViewState extends State<CreateBranchView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(title: LocaleKeys.defineBranches.tr()),
title: LocaleKeys.createBranch.tr(),
),
body: Consumer<ServiceVM>(builder: (context, serviceVM, _) { body: Consumer<ServiceVM>(builder: (context, serviceVM, _) {
return SizedBox( return SizedBox(
width: double.infinity, width: double.infinity,
@ -56,12 +54,9 @@ class _CreateBranchViewState extends State<CreateBranchView> {
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column( child: Column(
children: [ children: [
// LocaleKeys.chooseCountry.tr().toText(fontSize: 14, color: MyColors.lightTextColor), 12.height,
// 8.height,
serviceVM.country != null serviceVM.country != null
? DropdownField( ? DropdownField(
(DropValue value) { (DropValue value) {
@ -193,15 +188,14 @@ class _CreateBranchViewState extends State<CreateBranchView> {
], ],
), ),
], ],
), ).horPaddingMain(),
),
), ),
), ),
if (widget.branchData == null || widget.branchData!.id == null) ...[ if (widget.branchData == null || widget.branchData!.id == null) ...[
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 20), padding: const EdgeInsets.only(left: 20, right: 20, bottom: 10),
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: LocaleKeys.createBranch.tr(), title: LocaleKeys.createBranch.tr(),
@ -222,25 +216,24 @@ class _CreateBranchViewState extends State<CreateBranchView> {
] else ...[ ] else ...[
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
child: Padding(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 20),
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: widget.branchData != null ? (widget.branchData!.id == null ? LocaleKeys.createBranch.tr() : LocaleKeys.updateBranch.tr()) : LocaleKeys.createBranch.tr(), title: LocaleKeys.updateBranch.tr(),
onPressed: () async { onPressed: () async {
await serviceVM.updateBranch( await serviceVM.onUpdateBranchPressed(
widget.branchData!.id ?? 0, context: context,
serviceVM.branchName, branchID: widget.branchData!.id ?? 0,
serviceVM.branchDescription, branchName: widget.branchData!.branchName ?? "",
serviceVM.cityId.toString(), branchDesc: widget.branchData!.branchDescription ?? "",
serviceVM.address, cityID: widget.branchData!.cityId ?? 0,
serviceVM.latitude.toString(), address: widget.branchData!.address ?? "",
serviceVM.longitude.toString(), latitude: widget.branchData!.latitude ?? "0",
longitude: widget.branchData!.longitude ?? "0",
); );
}, },
).horPaddingMain(),
), ),
), 12.height,
),
], ],
], ],
), ),

Loading…
Cancel
Save