mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
fix the string for motor without underscore
This commit is contained in:
@ -69,7 +69,8 @@ class CurtainModulePrefrencesDialog extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
PrefReversCardWidget(
|
||||
title: state.curtainModuleStatus.elecMachineryMode,
|
||||
title: formatDeviceType(
|
||||
state.curtainModuleStatus.elecMachineryMode),
|
||||
body: 'Motor Mode',
|
||||
onTap: () => context.read<CurtainModuleBloc>().add(
|
||||
ChangeElecMachineryModeEvent(
|
||||
@ -136,4 +137,13 @@ class CurtainModulePrefrencesDialog extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String formatDeviceType(String raw) {
|
||||
return raw
|
||||
.split('_')
|
||||
.map((word) => word.isNotEmpty
|
||||
? '${word[0].toUpperCase()}${word.substring(1)}'
|
||||
: '')
|
||||
.join(' ');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user