improvements

main_production_RSG
Sikander Saleem 2 months ago
parent c12a0ce88d
commit 5a61d52455

@ -92,7 +92,7 @@ class _AssetInventoryFormViewState extends State<AssetInventoryFormView> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
'Not Registered'.addTranslation.heading5(context),
'Not Registered'.addTranslation.heading5(context).custom(color: AppColor.textStyleColor(context)),
AdvancedSwitch(
controller: registeredController,
activeColor: AppColor.green50.withOpacity(0.5),

@ -23,7 +23,7 @@ class CleanerRequestItemView extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (result.taskNo != null && result.taskNo!.isNotEmpty) result.taskNo!.heading5(context),
if (result.taskNo != null && result.taskNo!.isNotEmpty) result.taskNo!.heading5(context).custom(color: AppColor.textStyleColor(context)),
if (result.createdDate != null)
Text(
result.createdDate!.split('T').first,

@ -137,7 +137,7 @@ class _SparePartRequestState extends State<SparePartRequest> with TickerProvider
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
context.translation.sparePartDetails.heading5(context),
context.translation.sparePartDetails.heading5(context).custom(color: AppColor.textStyleColor(context)),
// 12.height,
// SingleItemDropDownMenu<Lookup, ActivityStatusProvider>(
// context: context,

@ -90,7 +90,7 @@ class _PpmDetailsPageState extends State<PpmDetailsPage> {
],
),
8.height,
planPreventiveVisit.assetName!.cleanupWhitespace.capitalizeFirstOfEach.heading5(context),
planPreventiveVisit.assetName!.cleanupWhitespace.capitalizeFirstOfEach.heading5(context).custom(color: AppColor.textStyleColor(context)),
8.height,
'${context.translation.assetNumber}: ${planPreventiveVisit.asset!.assetNumber}'.bodyText(context),
'${context.translation.assetSN}: ${planPreventiveVisit.asset!.assetSerialNo}'.bodyText(context),

@ -80,7 +80,7 @@ class _PpmCalibrationToolsFormState extends State<PpmCalibrationToolsForm> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
(index == 0 ? "$currentIndex /$totalTabs . Calibration Tools" : "").heading5(context),
(index == 0 ? "$currentIndex /$totalTabs . Calibration Tools" : "").heading5(context).custom(color: AppColor.textStyleColor(context)),
"trash".toSvgAsset(height: 20, width: 15).onPress(() {
widget.models!.remove(model);
setState(() {});

@ -134,7 +134,7 @@ class _ExternalDetailItemState extends State<ExternalDetailItem> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
(widget.index == 0 ? "1 /4 . External Details" : "").heading5(context),
(widget.index == 0 ? "1 /4 . External Details" : "").heading5(context).custom(color: AppColor.textStyleColor(context)),
Container(
height: 32,
width: 32,

@ -50,7 +50,7 @@ class _PpmPmChecklistFormState extends State<PpmPmChecklistForm> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (index == 0) ...[
"$currentIndex /$totalTabs . PM Checklist".heading5(context),
"$currentIndex /$totalTabs . PM Checklist".heading5(context).custom(color: AppColor.textStyleColor(context)),
16.height,
],
AppTextFormField(

@ -78,7 +78,7 @@ class _PpmPMKitsFormState extends State<PpmPMKitsForm> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
(index == 0 ? "$currentIndex /$totalTabs . PM Kits" : "").heading5(context),
(index == 0 ? "$currentIndex /$totalTabs . PM Kits" : "").heading5(context).custom(color: AppColor.textStyleColor(context)),
Container(
height: 32,
width: 32,

@ -7,13 +7,14 @@ import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/models/lookup.dart';
import 'package:test_sa/models/new_models/site.dart';
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
import 'package:test_sa/new_views/common_widgets/multiple_item_drop_down_menu.dart';
import 'package:test_sa/providers/department_provider.dart';
import 'package:test_sa/providers/gas_request_providers/site_provider.dart';
import 'package:test_sa/views/widgets/date_and_time/date_picker.dart';
import 'package:test_sa/views/widgets/equipment/commissioning_status_buttons.dart';
import 'package:test_sa/views/widgets/equipment/asset_status_buttons.dart';
import '../../../models/device/asset_search.dart';
import '../../../new_views/common_widgets/app_lazy_loading.dart';
@ -69,115 +70,110 @@ class _DeviceFilterScreenState extends State<DeviceFilterScreen> {
@override
Widget build(BuildContext context) {
return SafeArea(
top: false,
child: Scaffold(
appBar: DefaultAppBar(
title: context.translation.filter,
actions: [
if (loading == false && _showResetButton())
TextButton(
onPressed: () {
setState(() {
startDate = null;
endDate = null;
_selectedDepartments = [];
_selectedSites = [];
_commissioningStatus = null;
});
return Scaffold(
appBar: DefaultAppBar(
title: context.translation.filter,
actions: [
if (loading == false && _showResetButton())
TextButton(
onPressed: () {
setState(() {
startDate = null;
endDate = null;
_selectedDepartments = [];
_selectedSites = [];
_commissioningStatus = null;
});
},
style: TextButton.styleFrom(padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap),
child: Text(
'Clear Filters',
style: AppTextStyles.bodyText2.copyWith(color: AppColor.primary10),
),
).paddingOnly(start: 16, end: 16)
],
),
body: Column(
children: [
ListView(
padding: const EdgeInsets.all(16),
children: [
AssetStatusButtons(
initialValue: _commissioningStatus,
onSelect: (value) {
if (value != null) {
_commissioningStatus = value;
}
},
),
16.height,
MultipleItemDropDownMenu<Lookup, DepartmentProvider>(
context: context,
title: context.translation.byDepartment,
showAsBottomSheet: true,
backgroundColor: context.isDark ? AppColor.neutral60 : Colors.white,
// backgroundColor: AppColor.fieldBgColor(context),
showShadow: true,
height: 56.toScreenHeight,
showCancel: true,
onSelect: (value) {
if (value != null) {
setState(() {
_selectedDepartments = value;
});
}
},
style: TextButton.styleFrom(padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap),
child: Text(
'Clear Filters',
style: AppTextStyles.bodyText2.copyWith(color: AppColor.primary10),
),
).paddingOnly(start: 16, end: 16)
],
),
body: Column(
children: [
SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
),
12.height,
MultipleItemDropDownMenu<Site, SiteProvider>(
context: context,
title: context.translation.bySite,
showAsBottomSheet: true,
// backgroundColor: AppColor.fieldBgColor(context),
backgroundColor: context.isDark ? AppColor.neutral60 : Colors.white,
showShadow: true,
height: 56.toScreenHeight,
showCancel: true,
onSelect: (value) {
if (value != null) {
setState(() {
_selectedSites = value;
});
}
},
),
16.height,
context.translation.pmDateRange.heading5(context).custom(color: AppColor.textStyleColor(context)),
8.height,
Row(
children: [
CommissioningStatusButtons(
initialValue: _commissioningStatus,
onSelect: (value) {
if (value != null) {
_commissioningStatus = value;
}
},
),
16.height,
MultipleItemDropDownMenu<Lookup, DepartmentProvider>(
context: context,
title: context.translation.byDepartment,
showAsBottomSheet: true,
backgroundColor: context.isDark ? AppColor.neutral60 : Colors.white,
// backgroundColor: AppColor.fieldBgColor(context),
showShadow: true,
height: 56.toScreenHeight,
showCancel: true,
onSelect: (value) {
if (value != null) {
setState(() {
_selectedDepartments = value;
});
}
ADatePicker(
label: context.translation.to,
from: DateTime(2000),
date: DateTime.tryParse(startDate ?? ""),
onDatePicker: (date) {
setState(() {
startDate = date.toIso8601String();
});
},
).paddingOnly(start: 16, end: 16),
8.height,
MultipleItemDropDownMenu<Site, SiteProvider>(
context: context,
title: context.translation.bySite,
showAsBottomSheet: true,
// backgroundColor: AppColor.fieldBgColor(context),
backgroundColor: context.isDark ? AppColor.neutral60 : Colors.white,
showShadow: true,
height: 56.toScreenHeight,
showCancel: true,
onSelect: (value) {
if (value != null) {
setState(() {
_selectedSites = value;
});
}
).expanded,
8.width,
ADatePicker(
label: context.translation.to,
from: DateTime(2000),
date: DateTime.tryParse(endDate ?? ""),
onDatePicker: (date) {
setState(() {
endDate = date.toIso8601String();
});
},
).paddingOnly(start: 16, end: 16),
16.height,
context.translation.pmDateRange.heading5(context).paddingOnly(start: 16, end: 16),
8.height,
Row(
children: [
ADatePicker(
label: context.translation.to,
from: DateTime(2000),
date: DateTime.tryParse(startDate ?? ""),
onDatePicker: (date) {
setState(() {
startDate = date.toIso8601String();
});
},
).expanded,
8.width,
ADatePicker(
label: context.translation.to,
from: DateTime(2000),
date: DateTime.tryParse(endDate ?? ""),
onDatePicker: (date) {
setState(() {
endDate = date.toIso8601String();
});
},
).expanded,
],
).paddingOnly(start: 16, end: 16),
).expanded,
],
),
).expanded,
AppFilledButton(onPressed: _search, label: context.translation.applyFilter).paddingOnly(start: 16, end: 16),
],
).paddingOnly(top: 16, bottom: 16),
],
).expanded,
FooterActionButton.footerContainer(context: context, child: AppFilledButton(onPressed: _search, label: context.translation.applyFilter)),
],
),
);
}

@ -5,6 +5,8 @@ import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart';
@ -62,39 +64,38 @@ class _DeviceSearchScreenState extends State<DeviceSearchScreen> {
title: context.translation.search,
actions: [
if (_showResetButton())
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
context.translation.reset,
style: AppTextStyles.bodyText2.copyWith(color: const Color(0xFF4A8DB7)),
).paddingAll(8).onPress(() {
setState(() {
_assetNameController.text = "";
_assetNumberController.text = "";
_snController.text = "";
_modelController.text = "";
_supplierController.text = "";
_siteController.text = "";
_manufactureController.text = "";
_mdController.text = "";
});
}),
],
)
TextButton(
onPressed: () {
setState(() {
_assetNameController.text = "";
_assetNumberController.text = "";
_snController.text = "";
_modelController.text = "";
_supplierController.text = "";
_siteController.text = "";
_manufactureController.text = "";
_mdController.text = "";
});
},
style: TextButton.styleFrom(padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap),
child: Text(
'Clear Filters',
style: AppTextStyles.bodyText2.copyWith(color: AppColor.primary10),
),
).paddingOnly(start: 16, end: 16),
],
),
body: Form(
key: _formKey,
child: Column(
children: [
SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
child: SafeArea(
child: Column(
children: [
ListView(
padding: const EdgeInsets.all(16),
children: [
context.translation.searchBy.heading5(context),
8.height,
context.translation.searchByDesc.bodyText(context),
context.translation.searchBy.heading5(context).custom(color: AppColor.textStyleColor(context)),
4.height,
context.translation.searchByDesc.bodyText2(context).custom(color: AppColor.lightTextColor(context)),
16.height,
AppTextFormField(
controller: _assetNameController,
@ -215,11 +216,11 @@ class _DeviceSearchScreenState extends State<DeviceSearchScreen> {
),
8.height,
],
),
).expanded,
AppFilledButton(onPressed: _search, label: context.translation.search),
],
).paddingAll(16),
).expanded,
FooterActionButton.footerContainer(context: context, child: AppFilledButton(onPressed: _search, label: context.translation.search)),
],
),
),
),
);
}

@ -252,7 +252,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
],
),
8.height,
context.translation.workOrderDetails.heading5(context),
context.translation.workOrderDetails.heading5(context).custom(color: AppColor.textStyleColor(context)),
infoText(label: context.translation.destinationSite, value: _model?.senderSiteName),
// infoText(label: "Sender Building".addTranslation, value: _model?.senderBuildingName),
// infoText(label: "Sender Floor".addTranslation, value: _model?.senderFloorName),
@ -332,7 +332,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
children: [
statusLabel ?? Container(),
if (statusLabel != null) 8.height,
isSender ? context.translation.senderDetails.heading5(context) : context.translation.receiverDetails.heading5(context),
isSender ? context.translation.senderDetails.heading5(context) : context.translation.receiverDetails.heading5(context).custom(color: AppColor.textStyleColor(context)),
],
).expanded,
if (context.userProvider.isEngineer || context.userProvider.isNurse)

@ -242,7 +242,7 @@ class _RequestGasRefillState extends State<CreateGasRefillRequest> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
context.translation.gasRefill.heading5(context),
context.translation.gasRefill.heading5(context).custom(color: AppColor.textStyleColor(context)),
8.height,
'${context.translation.gasRequest}: ${widget.gasRefillModel!.gasRefillDetails![0].gasType!.name}'.bodyText(context),
'${context.translation.cylinderType}: ${widget.gasRefillModel!.gasRefillDetails![0].cylinderType!.name}'.bodyText(context),

@ -300,7 +300,7 @@ class _GasRefillRequestFormState extends State<GasRefillRequestForm> {
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// (_gasModel.gasRefillDetails![index].gasType?.name ?? "").heading5(context),
// (_gasModel.gasRefillDetails![index].gasType?.name ?? "").heading5(context).custom(color: AppColor.textStyleColor(context)),
// 8.height,
// ("${context.translation.quantity}: ${_gasModel.gasRefillDetails![index].requestedQty}").bodyText(context),
// ("${context.translation.cylinderSize}: ${_gasModel.gasRefillDetails![index].cylinderSize?.name}").bodyText(context),
@ -655,7 +655,7 @@ class _GasRefillRequestFormState extends State<GasRefillRequestForm> {
// // Column(
// // crossAxisAlignment: CrossAxisAlignment.start,
// // children: [
// // (_gasModel.gasRefillDetails![index].gasType?.name ?? "").heading5(context),
// // (_gasModel.gasRefillDetails![index].gasType?.name ?? "").heading5(context).custom(color: AppColor.textStyleColor(context)),
// // 8.height,
// // ("${context.translation.quantity}: ${_gasModel.gasRefillDetails![index].requestedQty}").bodyText(context),
// // ("${context.translation.cylinderSize}: ${_gasModel.gasRefillDetails![index].cylinderSize?.name}").bodyText(context),

@ -16,7 +16,7 @@ class AssetInfoCard extends StatelessWidget {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
(asset.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "").heading5(context),
(asset.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "").heading5(context).custom(color: AppColor.textStyleColor(context)),
8.height,
"${context.translation.assetNo}: ${asset.assetNumber}".bodyText(context),
"${context.translation.manufacture}: ${asset.modelDefinition?.manufacturerName}".bodyText(context),

@ -41,7 +41,7 @@ class HelpCenterPage extends StatelessWidget {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
title.heading5(context),
title.heading5(context).custom(color: AppColor.textStyleColor(context)),
"arrow_right".toSvgAsset(width: 17),
],
);

@ -19,7 +19,7 @@ class CalendarHeader extends StatelessWidget {
children: [
Row(
children: [
dateFormat.format(dateTime).heading5(context),
dateFormat.format(dateTime).heading5(context).custom(color: AppColor.textStyleColor(context)),
6.width,
Align(alignment: AlignmentDirectional.centerEnd, child: Icon(Icons.keyboard_arrow_down_sharp, color: context.isDark ? AppColor.neutral10 : AppColor.neutral60, size: 24)),
const Spacer(),

@ -166,7 +166,7 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
"WO Status".heading5(context),
"WO Status".heading5(context).custom(color: AppColor.textStyleColor(context)),
8.height,
RequestsTypeFilter(
initialValues: search?.statuses ?? [],
@ -183,7 +183,7 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
},
),
16.height,
"Type of WO".heading5(context),
"Type of WO".heading5(context).custom(color: AppColor.textStyleColor(context)),
8.height,
RequestsTypeFilter(
initialValues: search?.typeTransaction ?? [],
@ -194,7 +194,7 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
},
),
16.height,
context.translation.pickDate.heading5(context),
context.translation.pickDate.heading5(context).custom(color: AppColor.textStyleColor(context)),
8.height,
Row(
children: [
@ -226,7 +226,7 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
],
),
16.height,
// "Archived WO".heading5(context),
// "Archived WO".heading5(context).custom(color: AppColor.textStyleColor(context)),
// // 8.height,
// Row(
// children: [

@ -31,7 +31,7 @@ class ReportBugPage extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
user.clientName!.heading5(context),
user.clientName!.heading5(context).custom(color: AppColor.textStyleColor(context)),
8.height,
"Call ID: ${0}".bodyText(context),
"Date of Survey: ${DateFormat("dd MMM, yyyy").format(DateTime.now())}".bodyText(context),

@ -105,7 +105,7 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
context.translation.arabic.heading5(context),
context.translation.arabic.heading5(context).custom(color: AppColor.textStyleColor(context)),
AdvancedSwitch(
controller: langController,
activeColor: AppColor.green50.withOpacity(0.5),
@ -127,7 +127,7 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
context.translation.lightTheme.heading5(context),
context.translation.lightTheme.heading5(context).custom(color: AppColor.textStyleColor(context)),
AdvancedSwitch(
controller: themeController,
activeColor: AppColor.green50.withOpacity(0.5),
@ -158,7 +158,7 @@ class _SettingsPageState extends State<SettingsPage> {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Fingerprint/Face ID".heading5(context),
"Fingerprint/Face ID".heading5(context).custom(color: AppColor.textStyleColor(context)),
customSwitch(localAuth).onPress(() {
checkForLocalAuth(localAuth);
}),

@ -32,7 +32,7 @@ class _UnsafeDeviceScreenState extends State<UnsafeDeviceScreen> {
// Center(child: Image.asset("assets/images/logos/main_mohemm_logo.png", width: 200, height: 50)),
"logo".toSvgAsset(height: 64),
50.height,
"Sorry".heading5(context),
"Sorry".heading5(context).custom(color: AppColor.textStyleColor(context)),
21.height,
"You are using Atoms app on an unsafe device. To be able to use the app with all it's features, Please make sure that the below points are considered: "
.heading5(context).paddingOnly(start: 20, end: 20),

@ -144,7 +144,7 @@
// mainAxisSize: MainAxisSize.min,
// children: [
// 20.height,
// 'click me '.heading5(context),
// 'click me '.heading5(context).custom(color: AppColor.textStyleColor(context)),
// // LocaleKeys.markAttendance.tr().toSectionHeading(),
// // LocaleKeys.selectMethodOfAttendance.tr().toText11(color: const Color(0xff535353)),
// GridView(

@ -163,13 +163,13 @@ class _ProfilePageState extends State<ProfilePage> {
// if ((_user.phoneNumber ?? "").isNotEmpty) ...[
// const Divider().defaultStyle(context),
// 8.height,
// (_user.phoneNumber??"").heading5(context),
// (_user.phoneNumber??"").heading5(context).custom(color: AppColor.textStyleColor(context)),
// 8.height,
// ],
// if ((_user.extensionNo ?? "").isNotEmpty) ...[
// const Divider().defaultStyle(context),
// 8.height,
// _user.extensionNo!.heading5(context),
// _user.extensionNo!.heading5(context).custom(color: AppColor.textStyleColor(context)),
// 8.height,
// ],
if ((_user.departmentName?.length ?? 0) > 0) const Divider().defaultStyle(context),

@ -291,7 +291,7 @@
//
// // Align(
// // alignment: AlignmentDirectional.centerStart,
// // child: context.translation.callComments.heading5(context),
// // child: context.translation.callComments.heading5(context).custom(color: AppColor.textStyleColor(context)),
// // ),
// 8.height,
// // SpeechToTextButton(

@ -23,7 +23,7 @@ class AssetDetailBottomSheet extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
(asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context),
(asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context).custom(color: AppColor.textStyleColor(context)),
16.height,
AspectRatio(
aspectRatio: 358 / 136,

@ -96,7 +96,7 @@ class _AssetDetailPageState extends State<AssetDetailPage> {
backgroundColor: AppColor.getRequestStatusColorByName(context, assetModel.commissioningStatus!.name!),
),
if (assetModel.commissioningStatus != null) 8.height,
(assetModel.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context),
(assetModel.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context).custom(color: AppColor.textStyleColor(context)),
8.height,
Row(
crossAxisAlignment: CrossAxisAlignment.start,

@ -10,17 +10,17 @@ import '../../../models/lookup.dart';
import '../../../new_views/app_style/app_color.dart';
import '../../../providers/service_request_providers/commissioning_status_provider.dart';
class CommissioningStatusButtons extends StatefulWidget {
class AssetStatusButtons extends StatefulWidget {
final Function(Lookup?)? onSelect;
final Lookup? initialValue;
const CommissioningStatusButtons({Key? key, this.onSelect, this.initialValue}) : super(key: key);
const AssetStatusButtons({Key? key, this.onSelect, this.initialValue}) : super(key: key);
@override
State<CommissioningStatusButtons> createState() => _CommissioningStatusButtonsState();
State<AssetStatusButtons> createState() => _AssetStatusButtonsState();
}
class _CommissioningStatusButtonsState extends State<CommissioningStatusButtons> {
class _AssetStatusButtonsState extends State<AssetStatusButtons> {
int _selectedIndex = 0;
@override
@ -36,7 +36,7 @@ class _CommissioningStatusButtonsState extends State<CommissioningStatusButtons>
}
@override
void didUpdateWidget(covariant CommissioningStatusButtons oldWidget) {
void didUpdateWidget(covariant AssetStatusButtons oldWidget) {
if (widget.initialValue != oldWidget.initialValue) {
final provider = Provider.of<CommissioningStatusProvider>(context, listen: false);
if (widget.initialValue != null) {
@ -54,7 +54,7 @@ class _CommissioningStatusButtonsState extends State<CommissioningStatusButtons>
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
context.translation.assetStatus.heading5(context).paddingOnly(start: 16, end: 16),
context.translation.assetStatus.heading5(context).custom(color: AppColor.textStyleColor(context)),
8.height,
Consumer<CommissioningStatusProvider>(
builder: (context, snapshot, _) {
@ -69,17 +69,18 @@ class _CommissioningStatusButtonsState extends State<CommissioningStatusButtons>
8.width,
const _Skelton().expanded,
],
).paddingOnly(start: 16, end: 16),
),
)
: SizedBox(
height: 36.toScreenHeight,
child: ListView.builder(
child: ListView.separated(
itemCount: snapshot.items.length + 1,
scrollDirection: Axis.horizontal,
shrinkWrap: true,
padding: EdgeInsetsDirectional.only(start: 16.toScreenWidth),
padding: EdgeInsetsDirectional.only(start: 0.toScreenWidth),
separatorBuilder: (cxt, index) => 8.width,
itemBuilder: (context, index) => Container(
margin: EdgeInsets.symmetric(horizontal: 4.toScreenWidth),
margin: EdgeInsets.symmetric(horizontal: 0.toScreenWidth),
padding: EdgeInsets.symmetric(vertical: 8.toScreenHeight, horizontal: 12.toScreenWidth),
alignment: Alignment.center,
// foregroundDecoration: _selectedIndex != index
@ -104,8 +105,7 @@ class _CommissioningStatusButtonsState extends State<CommissioningStatusButtons>
// color: AppColor.filterButtonTextColor(context)
color: _selectedIndex == index ? AppColor.primary10 : AppColor.filterButtonTextColor(context)
),
color: _selectedIndex == index ? AppColor.primary10 : AppColor.filterButtonTextColor(context)),
).onPress(() {
setState(() {
_selectedIndex = index;

@ -54,7 +54,7 @@ class _SelectionBottomSheetState<T extends Base> extends State<MultipleSelection
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: widget.title.heading5(context),
title: widget.title.heading5(context).custom(color: AppColor.textStyleColor(context)),
actions: [
if (widget.showCancel)
AnimatedContainer(

@ -51,7 +51,7 @@ class _SelectionBottomSheetState<T extends Base> extends State<SelectionFullScre
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: widget.title.heading5(context),
title: widget.title.heading5(context).custom(color: AppColor.textStyleColor(context)),
actions: [
if (widget.showCancel)
AnimatedContainer(

Loading…
Cancel
Save