Added select_ad_type_view.dart
parent
fb9db7fb0b
commit
ba0b66d7e5
@ -0,0 +1,122 @@
|
|||||||
|
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/models/advertisment_models/vehicle_details_models.dart';
|
||||||
|
import 'package:mc_common_app/theme/colors.dart';
|
||||||
|
import 'package:mc_common_app/view_models/ad_view_model.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||||
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:sizer/sizer.dart';
|
||||||
|
|
||||||
|
class SelectAdTypeView extends StatelessWidget {
|
||||||
|
final bool isProvider;
|
||||||
|
|
||||||
|
const SelectAdTypeView({
|
||||||
|
Key? key,
|
||||||
|
this.isProvider = true,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: CustomAppBar(
|
||||||
|
title: "Select Ad Type",
|
||||||
|
profileImageUrl: MyAssets.bnCar,
|
||||||
|
isRemoveBackButton: false,
|
||||||
|
isDrawerEnabled: false,
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Consumer(builder: (BuildContext context, AdVM adVM, Widget? child) {
|
||||||
|
return ListView.separated(
|
||||||
|
itemCount: adVM.vehicleTypes.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
VehicleTypeModel vehicleTypeModel = adVM.vehicleTypes[index];
|
||||||
|
return SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
vehicleTypeModel.vehicleTypeName.toString().toText(fontSize: 16, isBold: true),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
"Duration: ".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
||||||
|
"7 Days".toText(fontSize: 13, isBold: true),
|
||||||
|
const Icon(Icons.keyboard_arrow_down_sharp, color: MyColors.darkPrimaryColor, size: 20),
|
||||||
|
],
|
||||||
|
).paddingOnly(top: 5, bottom: 5),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
"1056".toText(fontSize: 22, isBold: true),
|
||||||
|
2.width,
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 4),
|
||||||
|
child: "SAR".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
).toWhiteContainer(width: double.infinity, allPading: 10);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return 9.height;
|
||||||
|
},
|
||||||
|
padding: const EdgeInsets.all(20),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
if (isProvider) ...[
|
||||||
|
SizedBox(
|
||||||
|
height: 12.h,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
"5 of 10 ".toText(fontSize: 29, isBold: true, letterSpacing: 0, height: 1),
|
||||||
|
"Ads Remaining ".toText(fontSize: 17, color: MyColors.lightTextColor, isBold: true),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Text.rich(
|
||||||
|
TextSpan(
|
||||||
|
children: [
|
||||||
|
TextSpan(
|
||||||
|
text: "You have left with 05 out of 50 ads given in the subscription. ",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: MyColors.lightTextColor,
|
||||||
|
)),
|
||||||
|
TextSpan(
|
||||||
|
text: "Update Subscription",
|
||||||
|
style: TextStyle(
|
||||||
|
decoration: TextDecoration.underline,
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: MyColors.darkPrimaryColor,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
).toContainer(paddingAll: 20, backgroundColor: Colors.white),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue