mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-15 17:47:53 +00:00
fix the string for motor without underscore
This commit is contained in:
@ -69,7 +69,8 @@ class CurtainModulePrefrencesDialog extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
PrefReversCardWidget(
|
PrefReversCardWidget(
|
||||||
title: state.curtainModuleStatus.elecMachineryMode,
|
title: formatDeviceType(
|
||||||
|
state.curtainModuleStatus.elecMachineryMode),
|
||||||
body: 'Motor Mode',
|
body: 'Motor Mode',
|
||||||
onTap: () => context.read<CurtainModuleBloc>().add(
|
onTap: () => context.read<CurtainModuleBloc>().add(
|
||||||
ChangeElecMachineryModeEvent(
|
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