Ad Creation View
parent
1dc922b4d5
commit
68fdbbd86b
@ -0,0 +1,43 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:mc_common_app/services/services.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
import 'package:mc_common_app/view_models/base_view_model.dart';
|
||||||
|
|
||||||
|
class AdVM extends BaseVM {
|
||||||
|
final CommonServices commonServices;
|
||||||
|
|
||||||
|
AdVM({required this.commonServices});
|
||||||
|
|
||||||
|
AdCreationStepsEnum currentProgressStep = AdCreationStepsEnum.vehicleDetails;
|
||||||
|
|
||||||
|
void updateCurrentStep(AdCreationStepsEnum stepsEnum) {
|
||||||
|
currentProgressStep = stepsEnum;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool financeAvailableStatus = false;
|
||||||
|
|
||||||
|
void updateFinanceAvailableStatus(bool status) {
|
||||||
|
financeAvailableStatus = status;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<File> pickedImages = [];
|
||||||
|
|
||||||
|
void removeImageFromList(int index) {
|
||||||
|
pickedImages.removeAt(index);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
// sourceFlag for Camera = 0
|
||||||
|
// sourceFlag for Gallery = 1
|
||||||
|
void pickImageFromPhone(int sourceFlag) async {
|
||||||
|
File? file = await commonServices.pickImageFromPhone(1);
|
||||||
|
|
||||||
|
if (file != null) {
|
||||||
|
pickedImages.add(file);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,130 @@
|
|||||||
|
import 'package:car_customer_app/views/advertisement/ads_images_slider.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mc_common_app/classes/consts.dart';
|
||||||
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/theme/colors.dart';
|
||||||
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||||
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||||
|
|
||||||
|
class AdsDetailView extends StatelessWidget {
|
||||||
|
const AdsDetailView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: CustomAppBar(
|
||||||
|
backgroundColor: MyColors.backgroundColor,
|
||||||
|
title: "Ads",
|
||||||
|
profileImageUrl: MyAssets.bnCar,
|
||||||
|
isRemoveBackButton: false,
|
||||||
|
isDrawerEnabled: false,
|
||||||
|
),
|
||||||
|
body: Container(
|
||||||
|
padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
CarouselWithIndicatorDemo(),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
"Toyota Corolla | Silver".toText(fontSize: 18, isBold: true),
|
||||||
|
"Jeddah".toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
"Model: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||||
|
"2019".toText(
|
||||||
|
fontSize: 14,
|
||||||
|
isBold: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
"Saudi Arabia".toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
"Mileage: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||||
|
"10928Km".toText(
|
||||||
|
fontSize: 14,
|
||||||
|
isBold: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
"5 Hours ago".toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
"Transmission: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||||
|
"Automatic".toText(
|
||||||
|
fontSize: 14,
|
||||||
|
isBold: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
"Description: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||||
|
"No Issue in the car. All parts are genuine with no major accident. ".toText(
|
||||||
|
fontSize: 14,
|
||||||
|
isBold: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).toWhiteContainer(width: double.infinity, allPading: 12),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Container(
|
||||||
|
height: 150,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Divider(thickness: 1, height: 1),
|
||||||
|
18.height,
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
"35,000".toText(fontSize: 30, isBold: true),
|
||||||
|
"SAR".toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
14.height,
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ShowFillButton(
|
||||||
|
maxHeight: 55,
|
||||||
|
title: "Reserve Ad",
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
12.width,
|
||||||
|
Container(
|
||||||
|
height: 55,
|
||||||
|
width: 55,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(border: Border.all(color: MyColors.black, width: 3)),
|
||||||
|
child: Icon(Icons.phone, color: MyColors.black),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:carousel_slider/carousel_slider.dart';
|
||||||
|
import 'package:mc_common_app/classes/consts.dart';
|
||||||
|
import 'package:mc_common_app/theme/colors.dart';
|
||||||
|
|
||||||
|
class CarouselWithIndicatorDemo extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
State<StatefulWidget> createState() => _CarouselWithIndicatorState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CarouselWithIndicatorState extends State<CarouselWithIndicatorDemo> {
|
||||||
|
int _current = 0;
|
||||||
|
final CarouselController _controller = CarouselController();
|
||||||
|
|
||||||
|
final imgList = [
|
||||||
|
MyAssets.bnCar,
|
||||||
|
MyAssets.bnCar,
|
||||||
|
MyAssets.bnCar,
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(children: [
|
||||||
|
CarouselSlider(
|
||||||
|
items: imgList
|
||||||
|
.map((item) => Container(
|
||||||
|
margin: EdgeInsets.all(5.0),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||||
|
child: Image.asset(item, fit: BoxFit.cover),
|
||||||
|
),
|
||||||
|
))
|
||||||
|
.toList(),
|
||||||
|
carouselController: _controller,
|
||||||
|
options: CarouselOptions(
|
||||||
|
autoPlay: false,
|
||||||
|
enlargeCenterPage: false,
|
||||||
|
aspectRatio: 1.8,
|
||||||
|
onPageChanged: (index, reason) {
|
||||||
|
setState(() {
|
||||||
|
_current = index;
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: imgList.asMap().entries.map((entry) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () => _controller.animateToPage(entry.key),
|
||||||
|
child: Container(
|
||||||
|
width: 12.0,
|
||||||
|
height: 12.0,
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: _current == entry.key ? MyColors.darkPrimaryColor : MyColors.lightTextColor.withOpacity(0.5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
import 'package:car_customer_app/view_models/ad_view_model.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mc_common_app/classes/consts.dart';
|
||||||
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/theme/colors.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class CreateAdProgressSteps extends StatelessWidget {
|
||||||
|
const CreateAdProgressSteps({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
Widget buildStep(String icon, String title, bool isSelected) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 50,
|
||||||
|
width: 50,
|
||||||
|
padding: EdgeInsets.all(08),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: isSelected ? MyColors.darkPrimaryColor : MyColors.white,
|
||||||
|
border: Border.all(
|
||||||
|
color: isSelected ? MyColors.darkPrimaryColor : MyColors.lightIconColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: icon.buildSvg(color: isSelected ? MyColors.white : MyColors.lightIconColor,),
|
||||||
|
),
|
||||||
|
5.height,
|
||||||
|
title.toText(
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
isBold: true,
|
||||||
|
fontSize: 12,
|
||||||
|
color: isSelected ? MyColors.black : MyColors.lightIconColor,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
AdVM adVM = context.watch<AdVM>();
|
||||||
|
return Stack(
|
||||||
|
// alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
Divider(thickness: 2).paddingOnly(left: 21, right: 21, top: 15),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
buildStep(MyAssets.carIcon, "Vehicle \n Details", adVM.currentProgressStep == AdCreationStepsEnum.vehicleDetails),
|
||||||
|
buildStep(MyAssets.carHitIcon, "Damage \n Parts", adVM.currentProgressStep == AdCreationStepsEnum.damageParts),
|
||||||
|
buildStep(MyAssets.clockIcon, "Ad \n Duration", adVM.currentProgressStep == AdCreationStepsEnum.adDuration),
|
||||||
|
buildStep(MyAssets.reviewIcon, "Review \n Ad", adVM.currentProgressStep == AdCreationStepsEnum.reviewAd),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,218 @@
|
|||||||
|
import 'package:car_customer_app/main.dart';
|
||||||
|
import 'package:car_customer_app/view_models/ad_view_model.dart';
|
||||||
|
import 'package:car_customer_app/views/advertisement/create_ad_progress_steps.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mc_common_app/classes/consts.dart';
|
||||||
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/theme/colors.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||||
|
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
|
||||||
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||||
|
import 'package:mc_common_app/widgets/txt_field.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/dotted_rect.dart';
|
||||||
|
|
||||||
|
class CreateAdView extends StatelessWidget {
|
||||||
|
CreateAdView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: CustomAppBar(
|
||||||
|
title: "Create Ad",
|
||||||
|
isRemoveBackButton: false,
|
||||||
|
isDrawerEnabled: false,
|
||||||
|
),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
CreateAdProgressSteps(),
|
||||||
|
22.height,
|
||||||
|
//TODO: Need to add a Widget Builder here, based on the Enums
|
||||||
|
VehicleDetails().toWhiteContainer(width: double.infinity, allPading: 12, margin: EdgeInsets.symmetric(horizontal: 21, vertical: 10)),
|
||||||
|
10.height,
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: ShowFillButton(
|
||||||
|
title: "Next",
|
||||||
|
onPressed: () {
|
||||||
|
context.read<AdVM>().updateCurrentStep(AdCreationStepsEnum.damageParts);
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
10.height,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class VehicleDetails extends StatelessWidget {
|
||||||
|
const VehicleDetails({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
List<DropValue> dropList = [
|
||||||
|
DropValue(0, "Maintenance", ""),
|
||||||
|
DropValue(1, "Car Wash", ""),
|
||||||
|
DropValue(2, "Monthly Checkup", ""),
|
||||||
|
DropValue(3, "Friendly Visit", ""),
|
||||||
|
DropValue(4, "Muftaa", ""),
|
||||||
|
];
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
"Vehicle Detail".toText(fontSize: 18, isBold: true),
|
||||||
|
8.height,
|
||||||
|
DropdownField(
|
||||||
|
(DropValue value) {},
|
||||||
|
list: dropList,
|
||||||
|
hint: "Vehicle Type",
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
DropdownField(
|
||||||
|
(DropValue value) {},
|
||||||
|
list: dropList,
|
||||||
|
hint: "Vehicle Model",
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
DropdownField(
|
||||||
|
(DropValue value) {},
|
||||||
|
list: dropList,
|
||||||
|
hint: "Vehicle Model Year",
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
DropdownField(
|
||||||
|
(DropValue value) {},
|
||||||
|
list: dropList,
|
||||||
|
hint: "Vehicle Color",
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
DropdownField(
|
||||||
|
(DropValue value) {},
|
||||||
|
list: dropList,
|
||||||
|
hint: "Vehicle Condition",
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
DropdownField(
|
||||||
|
(DropValue value) {},
|
||||||
|
list: dropList,
|
||||||
|
hint: "Vehicle Category",
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
TxtField(
|
||||||
|
hint: "Vehicle Mileage",
|
||||||
|
// onChanged: (v) => email = v,
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
DropdownField(
|
||||||
|
(DropValue value) {},
|
||||||
|
list: dropList,
|
||||||
|
hint: "Vehicle Transmission",
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
DropdownField(
|
||||||
|
(DropValue value) {},
|
||||||
|
list: dropList,
|
||||||
|
hint: "Vehicle Seller Type",
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
DropdownField(
|
||||||
|
(DropValue value) {},
|
||||||
|
list: dropList,
|
||||||
|
hint: "Vehicle Country",
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
DropdownField(
|
||||||
|
(DropValue value) {},
|
||||||
|
list: dropList,
|
||||||
|
hint: "Vehicle City",
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
TxtField(
|
||||||
|
hint: "Demand Amount",
|
||||||
|
// onChanged: (v) => email = v,
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
TxtField(
|
||||||
|
hint: "Vehicle VIN",
|
||||||
|
// onChanged: (v) => email = v,
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
TxtField(
|
||||||
|
hint: "Vehicle Title",
|
||||||
|
// onChanged: (v) => email = v,
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
TxtField(
|
||||||
|
hint: "Warranty Available (No. of Years)",
|
||||||
|
// onChanged: (v) => email = v,
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
TxtField(
|
||||||
|
hint: "Vehicle Description",
|
||||||
|
maxLines: 5,
|
||||||
|
// onChanged: (v) => email = v,
|
||||||
|
),
|
||||||
|
22.height,
|
||||||
|
"Finance Available".toText(fontSize: 16),
|
||||||
|
8.height,
|
||||||
|
Consumer(builder: (BuildContext context, AdVM adVm, Widget? child) {
|
||||||
|
return Container(
|
||||||
|
width: 65,
|
||||||
|
height: 37,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: adVm.financeAvailableStatus ? MyColors.darkPrimaryColor : MyColors.white,
|
||||||
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
|
border: Border.all(color: MyColors.black, width: 1.5),
|
||||||
|
),
|
||||||
|
child: CupertinoSwitch(
|
||||||
|
activeColor: MyColors.darkPrimaryColor,
|
||||||
|
trackColor: MyColors.white,
|
||||||
|
thumbColor: MyColors.grey98Color,
|
||||||
|
value: adVm.financeAvailableStatus,
|
||||||
|
onChanged: (value) {
|
||||||
|
adVm.updateFinanceAvailableStatus(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
28.height,
|
||||||
|
"Vehicle Pictures".toText(fontSize: 18, isBold: true),
|
||||||
|
8.height,
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
context.read<AdVM>().pickImageFromPhone(1);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: 46,
|
||||||
|
width: double.infinity,
|
||||||
|
color: MyColors.white,
|
||||||
|
child: DashedRect(
|
||||||
|
color: MyColors.lightIconColor,
|
||||||
|
strokeWidth: 2.0,
|
||||||
|
gap: 4.0,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
MyAssets.attachmentIcon.buildSvg(),
|
||||||
|
"Attach Image".toText(
|
||||||
|
fontSize: 15,
|
||||||
|
isBold: true,
|
||||||
|
color: MyColors.darkPrimaryColor,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
20.height,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,124 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mc_common_app/classes/consts.dart';
|
||||||
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/theme/colors.dart';
|
||||||
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||||
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/card_button_with_icon.dart';
|
||||||
|
|
||||||
|
class AppointmentDetailView extends StatelessWidget {
|
||||||
|
AppointmentDetailView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
final List<String> servicesList = [
|
||||||
|
"Mechanic",
|
||||||
|
"Electrician",
|
||||||
|
" Car Denting",
|
||||||
|
"Oil Change",
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: CustomAppBar(
|
||||||
|
backgroundColor: MyColors.backgroundColor,
|
||||||
|
title: "Appointment",
|
||||||
|
profileImageUrl: MyAssets.bnCar,
|
||||||
|
isRemoveBackButton: false,
|
||||||
|
isDrawerEnabled: false,
|
||||||
|
),
|
||||||
|
body: Container(
|
||||||
|
padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
"Al Ahmad Maintenance".toText(fontSize: 18, isBold: true),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
MyAssets.miniClockDark.buildSvg(
|
||||||
|
height: 10,
|
||||||
|
width: 10,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
|
10.width,
|
||||||
|
"08:00 to 09:00 at 23 July, 2023".toText(fontSize: 12, isBold: true, color: MyColors.lightTextColor),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
13.height,
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
MyAssets.maintenanceIcon.buildSvg(
|
||||||
|
height: 10,
|
||||||
|
width: 10,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
|
10.width,
|
||||||
|
"Maintenance".toText(fontSize: 18, isBold: true),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: servicesList
|
||||||
|
.map((e) => e
|
||||||
|
.toText(
|
||||||
|
textAlign: TextAlign.start,
|
||||||
|
fontSize: 13,
|
||||||
|
isBold: true,
|
||||||
|
color: MyColors.lightTextColor,
|
||||||
|
)
|
||||||
|
.paddingOnly(bottom: 5))
|
||||||
|
.toList(),
|
||||||
|
).paddingOnly(left: 15),
|
||||||
|
15.height,
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
CardButtonWithIcon(
|
||||||
|
title: "Reschedule Appointment",
|
||||||
|
onCardTapped: () {},
|
||||||
|
icon: MyAssets.scheduleAppointmentIcon.buildSvg(),
|
||||||
|
),
|
||||||
|
10.width,
|
||||||
|
CardButtonWithIcon(
|
||||||
|
title: "Pay for Appointment",
|
||||||
|
onCardTapped: () {},
|
||||||
|
icon: MyAssets.creditCardIcon.buildSvg(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
15.height,
|
||||||
|
],
|
||||||
|
).toWhiteContainer(width: double.infinity, allPading: 12),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ShowFillButton(
|
||||||
|
maxHeight: 55,
|
||||||
|
title: "Cancel",
|
||||||
|
onPressed: () {},
|
||||||
|
backgroundColor: MyColors.redColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
12.width,
|
||||||
|
Expanded(
|
||||||
|
child: ShowFillButton(
|
||||||
|
maxHeight: 55,
|
||||||
|
title: "Confirm",
|
||||||
|
onPressed: () {},
|
||||||
|
backgroundColor: MyColors.greenColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,11 +1,93 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mc_common_app/config/routes.dart';
|
||||||
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mc_common_app/theme/colors.dart';
|
||||||
|
import 'package:mc_common_app/utils/navigator.dart';
|
||||||
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/ads_list.dart';
|
||||||
|
|
||||||
|
class AdsFragment extends StatefulWidget {
|
||||||
|
AdsFragment({Key? key}) : super(key: key);
|
||||||
|
|
||||||
class AdsFragment extends StatelessWidget {
|
@override
|
||||||
const AdsFragment({Key? key}) : super(key: key);
|
State<AdsFragment> createState() => _AdsFragmentState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AdsFragmentState extends State<AdsFragment> {
|
||||||
|
bool isExploreAdsTapped = true;
|
||||||
|
|
||||||
|
bool isMyAdsTapped = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container();
|
return Scaffold(
|
||||||
|
body: Container(
|
||||||
|
color: MyColors.backgroundColor,
|
||||||
|
width: double.infinity,
|
||||||
|
height: double.infinity,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
16.height,
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ShowFillButton(
|
||||||
|
isFilled: isExploreAdsTapped,
|
||||||
|
maxHeight: 55,
|
||||||
|
title: "Explore Ads",
|
||||||
|
txtColor: isExploreAdsTapped ? MyColors.white : MyColors.darkTextColor,
|
||||||
|
onPressed: () {
|
||||||
|
if (!isExploreAdsTapped) {
|
||||||
|
isExploreAdsTapped = true;
|
||||||
|
isMyAdsTapped = false;
|
||||||
|
}
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
12.width,
|
||||||
|
Expanded(
|
||||||
|
child: ShowFillButton(
|
||||||
|
isFilled: isMyAdsTapped,
|
||||||
|
txtColor: isMyAdsTapped ? MyColors.white : MyColors.darkTextColor,
|
||||||
|
maxHeight: 55,
|
||||||
|
title: "My Ads",
|
||||||
|
onPressed: () {
|
||||||
|
if (!isMyAdsTapped) {
|
||||||
|
isMyAdsTapped = true;
|
||||||
|
isExploreAdsTapped = false;
|
||||||
|
}
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
24.height,
|
||||||
|
Expanded(
|
||||||
|
child: BuildAdsList(
|
||||||
|
count: 20,
|
||||||
|
onAdPressed: () {
|
||||||
|
navigateWithName(
|
||||||
|
context,
|
||||||
|
AppRoutes.adsDetailView,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
onPressed: () {
|
||||||
|
navigateWithName(context, AppRoutes.createAdView);
|
||||||
|
},
|
||||||
|
backgroundColor: MyColors.darkPrimaryColor,
|
||||||
|
child: Icon(
|
||||||
|
Icons.add,
|
||||||
|
color: MyColors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,41 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mc_common_app/config/routes.dart';
|
||||||
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mc_common_app/theme/colors.dart';
|
||||||
|
import 'package:mc_common_app/utils/navigator.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/customer_appointment_slider_widget.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/categories_list.dart';
|
||||||
|
|
||||||
class AppointmentsFragment extends StatelessWidget {
|
class AppointmentsFragment extends StatelessWidget {
|
||||||
const AppointmentsFragment({Key? key}) : super(key: key);
|
const AppointmentsFragment({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container();
|
return Container(
|
||||||
|
color: MyColors.backgroundColor,
|
||||||
|
width: double.infinity,
|
||||||
|
height: double.infinity,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
16.height,
|
||||||
|
CategoriesList(name: "Upcoming", onTapped: () {}),
|
||||||
|
16.height,
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: ListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: 30,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return BuildAppointmentContainerForCustomer(
|
||||||
|
onTapped: () {
|
||||||
|
navigateWithName(context, AppRoutes.appointmentDetailView);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue