subscription 2.0
parent
be15a74274
commit
ed2a1eedc6
@ -0,0 +1,122 @@
|
||||
import 'package:flutter/material.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/extensions/extensions_widget.dart';
|
||||
|
||||
class DegradePackageSheet extends StatelessWidget {
|
||||
const DegradePackageSheet({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
"Deactivate the branches & users".toText(
|
||||
fontSize: 18,
|
||||
isBold: true,
|
||||
),
|
||||
"To select this subscription you need to deactivate your branches and users as this package only supports 1 branch and 2 users per branch. You can reactivate these branches later after upgrading the package"
|
||||
.toText(
|
||||
fontSize: 14,
|
||||
color: MyColors.lightTextColor,
|
||||
),
|
||||
12.height,
|
||||
showBranchList(),
|
||||
12.height,
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget showBranchList() {
|
||||
return ListView.separated(
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
customCheckBox(true),
|
||||
12.width,
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
"Olaya Branch".toText(
|
||||
fontSize: 16,
|
||||
isBold: true,
|
||||
),
|
||||
"3 Users".toText(
|
||||
fontSize: 10,
|
||||
color: MyColors.lightTextColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.keyboard_arrow_down,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
showUser("Mirza"),
|
||||
12.height,
|
||||
showUser("Shafique"),
|
||||
],
|
||||
).toContainer(
|
||||
isShadowEnabled: true,
|
||||
borderRadius: 0,
|
||||
paddingAll: 12,
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) {
|
||||
return 12.height;
|
||||
},
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: 2,
|
||||
);
|
||||
}
|
||||
|
||||
Widget showUser(String user) {
|
||||
return Row(
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 24,
|
||||
),
|
||||
customCheckBox(false),
|
||||
12.width,
|
||||
user.toText(fontSize: 14),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget customCheckBox(bool isChecked) {
|
||||
return SizedBox(
|
||||
height: 18,
|
||||
width: 18,
|
||||
child: isChecked
|
||||
? const Icon(
|
||||
Icons.done,
|
||||
color: Colors.white,
|
||||
size: 14,
|
||||
)
|
||||
: const SizedBox(),
|
||||
).toContainer(
|
||||
isEnabledBorder: true,
|
||||
paddingAll: 0,
|
||||
borderRadius: 0,
|
||||
borderWidget: 1,
|
||||
borderColor: MyColors.primaryColor,
|
||||
backgroundColor: isChecked ? MyColors.primaryColor : Colors.transparent,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
import 'package:car_provider_app/views/subscriptions/sheet/degrage_package_sheet.dart';
|
||||
import 'package:flutter/material.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/bottom_sheet.dart';
|
||||
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||
|
||||
class SelectPackageSheet extends StatelessWidget {
|
||||
const SelectPackageSheet({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
"When do you want to upgrade".toText(
|
||||
fontSize: 19,
|
||||
isBold: true,
|
||||
),
|
||||
12.height,
|
||||
showPackage(),
|
||||
12.height,
|
||||
showPackage(),
|
||||
12.height,
|
||||
ShowFillButton(
|
||||
title: "Upgrade",
|
||||
maxWidth: double.infinity,
|
||||
onPressed: () {
|
||||
showMyBottomSheet(context, child: const DegradePackageSheet());
|
||||
},
|
||||
),
|
||||
12.height,
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget showPackage() {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Checkbox(
|
||||
value: false,
|
||||
onChanged: (v) {},
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
"Now".toText(
|
||||
fontSize: 16,
|
||||
isBold: true,
|
||||
),
|
||||
"Your subscription will upgrade now. Affecting from 23 January, 2024"
|
||||
.toText(
|
||||
fontSize: 12,
|
||||
color: MyColors.lightTextColor,
|
||||
),
|
||||
12.height,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
"175".toText(
|
||||
fontSize: 26,
|
||||
isBold: true,
|
||||
),
|
||||
2.width,
|
||||
"SAR".toText(
|
||||
color: MyColors.lightTextColor,
|
||||
fontSize: 16,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
).toContainer(isShadowEnabled: true);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue