You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
123 lines
3.4 KiB
Dart
123 lines
3.4 KiB
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/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,
|
|
);
|
|
}
|
|
}
|