|
@@ -25,50 +25,59 @@ class LeftSiderSelectMeasure extends FStatefulWidget {
|
|
|
}
|
|
|
|
|
|
class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
- final ScrollController scrollController = ScrollController();
|
|
|
-
|
|
|
- late final application = Get.find<IApplication>();
|
|
|
- late final measureHandler = Get.find<MeasureHandler>();
|
|
|
-
|
|
|
|
|
|
- late final measureData = Get.find<MeasureDataController>();
|
|
|
+ final application = Get.find<IApplication>();
|
|
|
+ final measureHandler = Get.find<MeasureHandler>();
|
|
|
+ final measureData = Get.find<MeasureDataController>();
|
|
|
final playerController = Get.find<IPlayerController>() as VidPlayerController;
|
|
|
-
|
|
|
-
|
|
|
final measureMetaController = Get.find<MeasureMetaController>();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- late String activeName = measureData.getItemMetaList[0].description;
|
|
|
-
|
|
|
-
|
|
|
- ItemMeta? comboItemMeta;
|
|
|
|
|
|
- int? comboItemMetaActivedIndex;
|
|
|
+
|
|
|
+ int activeItemIndex = 0;
|
|
|
|
|
|
-
|
|
|
- bool isCombo = false;
|
|
|
-
|
|
|
-
|
|
|
- late bool isSpecialCombo = false;
|
|
|
+
|
|
|
+ int activeChildItemIndex = 0;
|
|
|
|
|
|
+
|
|
|
late String fontFamily;
|
|
|
+ static const Color buttonBackgroundColor = Color.fromRGBO(70, 70, 70, 1);
|
|
|
+ static const Color buttonBorderColor = Color.fromRGBO(124, 124, 124, 1);
|
|
|
+ static const Color buttonBorderHighlight = Color.fromRGBO(124, 124, 124, 1);
|
|
|
+ static const Color buttonTextColor = Colors.white;
|
|
|
+ static const Color childButtonHighlight = Color.fromRGBO(84, 144, 249, 1);
|
|
|
+ static const Color childContainerBackground = Color.fromRGBO(60, 60, 60, 1);
|
|
|
+ static const double buttonBorderHighlightWidth = 1.0;
|
|
|
+
|
|
|
+
|
|
|
+ void selectItem(int selectIndex) {
|
|
|
+ if (selectIndex == activeItemIndex) return;
|
|
|
+ final itemMeta = measureData.curItemMetaList[selectIndex];
|
|
|
+ changeItem(itemMeta);
|
|
|
+ setState(() {
|
|
|
+ activeItemIndex = selectIndex;
|
|
|
+ activeChildItemIndex = 0;
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- void workingChildChanged(sender, int e) {
|
|
|
- comboItemMetaActivedIndex = e;
|
|
|
+
|
|
|
+ void selectChildItem(int selectIndex) {
|
|
|
+ if (selectIndex == activeChildItemIndex) return;
|
|
|
+ final item = application.activeMeasureItem!;
|
|
|
+ if (item is ITopMeasureItem) {
|
|
|
+ item.switchChild(selectIndex);
|
|
|
+ activeChildItemIndex = selectIndex;
|
|
|
+ }
|
|
|
setState(() {});
|
|
|
}
|
|
|
|
|
|
|
|
|
void changeItem(ItemMeta itemMeta) {
|
|
|
- activeName = itemMeta.description;
|
|
|
- isSpecialCombo = MeasurespecialsupportedTerms.items.contains(activeName);
|
|
|
try {
|
|
|
application.switchItem(itemMeta);
|
|
|
final item = application.activeMeasureItem!;
|
|
|
if (item is ITopMeasureItem) {
|
|
|
item.switchChild(0);
|
|
|
- item.workingChildChanged.addListener(workingChildChanged);
|
|
|
+ item.workingChildChanged.addListener(_onWorkingChildChanged);
|
|
|
}
|
|
|
} catch (e) {
|
|
|
logger.e("changeItem failed", e);
|
|
@@ -78,19 +87,28 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- void itemMetaList(Object s, dynamic e) {
|
|
|
+
|
|
|
+ void _onWorkingChildChanged(sender, int e) {
|
|
|
+ setState(() {
|
|
|
+ activeChildItemIndex = e;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ void _onItemMetaListChanged(Object s, dynamic e) {
|
|
|
+ print("测量项变更_onItemMetaListChanged");
|
|
|
try {
|
|
|
if (e != null) {
|
|
|
setState(() {});
|
|
|
}
|
|
|
} catch (e) {
|
|
|
- debugPrint("callmethod fail " + e.toString());
|
|
|
+ debugPrint("ItemMetaListChanged fail " + e.toString());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- void firstFrameLoaded(Object sender, VidUsImage e) async {
|
|
|
+
|
|
|
+ void _onFirstFrameLoaded(Object sender, VidUsImage e) async {
|
|
|
+ print("onFirstFrameLoaded");
|
|
|
List<String> getModes = [];
|
|
|
for (var element in e.visuals[0].modes) {
|
|
|
getModes.add(element.type.toString().split('.')[1]);
|
|
@@ -106,7 +124,6 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
var measureApplicationDTO =
|
|
|
await measureData.getMeasureApplication.call(measureModeSelection);
|
|
|
if (measureApplicationDTO != null) {
|
|
|
-
|
|
|
measureData.measureApplicationVersion =
|
|
|
measureApplicationDTO.version ?? '';
|
|
|
measureData.availableModes = measureApplicationDTO.availableModes ?? [];
|
|
@@ -114,8 +131,6 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
measureData.currentMode = 'TPPTissue';
|
|
|
}
|
|
|
measureMetaController.setAvailableModes(measureData.currentMode);
|
|
|
-
|
|
|
- activeName = measureData.getItemMetaList[0].description;
|
|
|
setState(() {});
|
|
|
}
|
|
|
getNoteCommentsList();
|
|
@@ -131,289 +146,218 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
);
|
|
|
measureData.measureCommentItemResult =
|
|
|
measureCommentItemResult?.commentItems ?? [];
|
|
|
-
|
|
|
measureCommentItemResult?.commentItems?.forEach((element) {
|
|
|
commentsList.add(element.text ?? '');
|
|
|
});
|
|
|
measureData.getCommentsList = commentsList;
|
|
|
}
|
|
|
|
|
|
- void getItemMetaListChanged(sender, e) {
|
|
|
- isCombo = false;
|
|
|
- measureData.getTopItemMetaList = measureData.getItemMetaList;
|
|
|
- measureData.getBottomItemMetaList = [];
|
|
|
- if (measureData.getItemMetaList.isNotEmpty) {
|
|
|
- changeItem(measureData.getItemMetaList[0]);
|
|
|
+
|
|
|
+ void _onCurItemMetaListChanged(sender, e) {
|
|
|
+ print("_onCurItemMetaListChanged");
|
|
|
+ if (measureData.curItemMetaList.isNotEmpty) {
|
|
|
+ changeItem(measureData.curItemMetaList[0]);
|
|
|
}
|
|
|
setState(() {});
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
void initState() {
|
|
|
- playerController.firstFrameLoaded.addListener(
|
|
|
- (firstFrameLoaded),
|
|
|
- );
|
|
|
- measureData.getItemMetaListChanged.addListener(getItemMetaListChanged);
|
|
|
- measureData.itemMetaListChanged.addListener(itemMetaList);
|
|
|
-
|
|
|
+ playerController.firstFrameLoaded.addListener(_onFirstFrameLoaded);
|
|
|
+ measureData.curItemMetaListChanged.addListener(_onCurItemMetaListChanged);
|
|
|
+ measureData.itemMetaListChanged.addListener(_onItemMetaListChanged);
|
|
|
super.initState();
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
dispose() {
|
|
|
super.dispose();
|
|
|
- playerController.firstFrameLoaded.removeListener(
|
|
|
- (firstFrameLoaded),
|
|
|
- );
|
|
|
- measureData.getItemMetaListChanged.removeListener(getItemMetaListChanged);
|
|
|
- measureData.itemMetaListChanged.removeListener(itemMetaList);
|
|
|
-
|
|
|
+ playerController.firstFrameLoaded.removeListener(_onFirstFrameLoaded);
|
|
|
+ measureData.curItemMetaListChanged
|
|
|
+ .removeListener(_onCurItemMetaListChanged);
|
|
|
+ measureData.itemMetaListChanged.removeListener(_onItemMetaListChanged);
|
|
|
final item = application.activeMeasureItem;
|
|
|
if (item != null && item is ITopMeasureItem) {
|
|
|
- item.workingChildChanged.removeListener(workingChildChanged);
|
|
|
+ item.workingChildChanged.removeListener(_onWorkingChildChanged);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
FWidget build(BuildContext context) {
|
|
|
fontFamily = Theme.of(context).textTheme.labelLarge!.fontFamily!;
|
|
|
- return FSingleChildScrollView(
|
|
|
- controller: ScrollController(),
|
|
|
- key: UniqueKey(),
|
|
|
- child: FColumn(
|
|
|
- children: [
|
|
|
- _buildFGridView(measureData.getTopItemMetaList),
|
|
|
- if (isCombo && !isSpecialCombo) _buildCombo(),
|
|
|
- if (isCombo && isSpecialCombo) const SpecialCombo(),
|
|
|
- _buildFGridView(measureData.getBottomItemMetaList),
|
|
|
- ],
|
|
|
- ),
|
|
|
- );
|
|
|
+ return buildItemsListView(measureData.curItemMetaList);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- void chooseMeasure(ItemMeta itemMeta) {
|
|
|
- isCombo = false;
|
|
|
- changeItem(itemMeta);
|
|
|
- measureData.getTopItemMetaList = measureData.getItemMetaList;
|
|
|
- measureData.getBottomItemMetaList = [];
|
|
|
+
|
|
|
+ FWidget buildItemsListView(List<ItemMeta> itemMetaList) {
|
|
|
+ return FListView(
|
|
|
+ shrinkWrap: true,
|
|
|
+ controller: ScrollController(),
|
|
|
+ children: List.generate(itemMetaList.length, (i) {
|
|
|
+ return _buildItemContainer(i);
|
|
|
+ }));
|
|
|
}
|
|
|
|
|
|
- void chooseComboMeasure(ItemMeta itemMeta) {
|
|
|
- isCombo = true;
|
|
|
- changeItem(itemMeta);
|
|
|
- List<ItemMeta> top = [];
|
|
|
- List<ItemMeta> bottom = [];
|
|
|
- List<ItemMeta> getItemMetaList = measureData.getItemMetaList;
|
|
|
- for (int i = 0; i < getItemMetaList.length; i++) {
|
|
|
- if (i <= getItemMetaList.indexOf(itemMeta)) {
|
|
|
- top.add(getItemMetaList[i]);
|
|
|
- } else {
|
|
|
- bottom.add(getItemMetaList[i]);
|
|
|
- }
|
|
|
- measureData.getTopItemMetaList = top.toSet().toList();
|
|
|
- measureData.getBottomItemMetaList = bottom.toSet().toList();
|
|
|
- if (i == getItemMetaList.indexOf(itemMeta)) {
|
|
|
- comboItemMeta = getItemMetaList[i];
|
|
|
- comboItemMetaActivedIndex = 0;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- FWidget _buildComboItem(ItemMeta itemMeta, int index) {
|
|
|
- FWidget child;
|
|
|
- if (comboItemMetaActivedIndex == index) {
|
|
|
- child = FElevatedButton(
|
|
|
- onPressed: () {
|
|
|
- final item = application.activeMeasureItem!;
|
|
|
- if (item is ITopMeasureItem) {
|
|
|
- item.switchChild(index);
|
|
|
- comboItemMetaActivedIndex = index;
|
|
|
- }
|
|
|
- setState(() {});
|
|
|
- },
|
|
|
- child: FText(
|
|
|
- itemMeta.description,
|
|
|
- style: const TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- ),
|
|
|
- ),
|
|
|
- );
|
|
|
- } else {
|
|
|
- child = FOutlinedButton(
|
|
|
- onPressed: () {
|
|
|
- final item = application.activeMeasureItem!;
|
|
|
- if (item is ITopMeasureItem) {
|
|
|
- item.switchChild(index);
|
|
|
- comboItemMetaActivedIndex = index;
|
|
|
- }
|
|
|
- setState(() {});
|
|
|
- },
|
|
|
- style: OutlinedButton.styleFrom(
|
|
|
- side: const BorderSide(
|
|
|
- color: Color.fromRGBO(124, 124, 124, 1),
|
|
|
- ),
|
|
|
- ),
|
|
|
- child: FText(
|
|
|
- itemMeta.description,
|
|
|
- style: const TextStyle(
|
|
|
- color: Colors.white,
|
|
|
+
|
|
|
+ FWidget _buildItemContainer(int itemMetaIndex) {
|
|
|
+ final itemMeta = measureData.curItemMetaList[itemMetaIndex];
|
|
|
+ final isActived = itemMetaIndex == activeItemIndex;
|
|
|
+ final hasChildItem = itemMeta.childItems.isNotEmpty;
|
|
|
+ return FContainer(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(5),
|
|
|
+ border: isActived && hasChildItem
|
|
|
+ ? Border.all(
|
|
|
+ color: buttonBorderHighlight, width: buttonBorderHighlightWidth)
|
|
|
+ : null,
|
|
|
+ ),
|
|
|
+ margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
|
|
|
+ child: FColumn(children: [
|
|
|
+ if (isActived && hasChildItem) ...[
|
|
|
+ _buildItemTitle(itemMetaIndex),
|
|
|
+ _buildChildItemContainer(itemMeta),
|
|
|
+ ] else
|
|
|
+ FContainer(
|
|
|
+ width: double.infinity,
|
|
|
+ child: _buildItemButton(itemMetaIndex),
|
|
|
),
|
|
|
- ),
|
|
|
- );
|
|
|
- }
|
|
|
- return child;
|
|
|
+ ]),
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- FWidget _buildCombo() {
|
|
|
- return FColumn(
|
|
|
- mainAxisSize: MainAxisSize.max,
|
|
|
- children: [
|
|
|
- FContainer(
|
|
|
- padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
|
|
|
- color: const Color.fromRGBO(70, 70, 70, 1),
|
|
|
- child: FColumn(
|
|
|
- children: (comboItemMeta?.childItems ?? [])
|
|
|
- .asMap()
|
|
|
- .entries
|
|
|
- .map(
|
|
|
- (e) => FContainer(
|
|
|
- width: double.infinity,
|
|
|
- padding: const EdgeInsets.symmetric(
|
|
|
- vertical: 2,
|
|
|
- ),
|
|
|
- child: _buildComboItem(
|
|
|
- e.value,
|
|
|
- e.key,
|
|
|
- ),
|
|
|
- ),
|
|
|
- )
|
|
|
- .toList(),
|
|
|
+
|
|
|
+ FWidget _buildItemButton(int itemIndex) {
|
|
|
+ final itemMeta = measureData.curItemMetaList[itemIndex];
|
|
|
+ final ifShowCN = i18nBook.isCurrentChinese &&
|
|
|
+ MeasureLanguage.t(itemMeta.description) != itemMeta.description;
|
|
|
+ final isActived = itemIndex == activeItemIndex;
|
|
|
+ return FElevatedButton(
|
|
|
+ onPressed: () => selectItem(itemIndex),
|
|
|
+ child: FColumn(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ if (ifShowCN)
|
|
|
+ FText(
|
|
|
+ MeasureLanguage.t(itemMeta.description),
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ style: TextStyle(
|
|
|
+ color: isActived ? null : buttonTextColor,
|
|
|
+ fontFamily: fontFamily,
|
|
|
+ fontSize: 12,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ FText(
|
|
|
+ itemMeta.description,
|
|
|
+ style: TextStyle(
|
|
|
+ color: isActived ? null : buttonTextColor,
|
|
|
+ ),
|
|
|
),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ style: ElevatedButton.styleFrom(
|
|
|
+ backgroundColor: isActived ? null : buttonBackgroundColor,
|
|
|
+ fixedSize: const Size.fromHeight(
|
|
|
+ 50,
|
|
|
+ ),
|
|
|
+ side: BorderSide(
|
|
|
+ color: isActived ? Colors.transparent : buttonBorderColor,
|
|
|
),
|
|
|
- ],
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- FWidget _buildFGridView(List<ItemMeta> itemMeta) {
|
|
|
- return FGridView.count(
|
|
|
- shrinkWrap: true,
|
|
|
- crossAxisCount: 1,
|
|
|
- childAspectRatio: 5,
|
|
|
- controller: ScrollController(),
|
|
|
- children: itemMeta.map((e) {
|
|
|
- if (e.description == activeName) {
|
|
|
-
|
|
|
- return _buildItemMetaContainer(e, () {});
|
|
|
- } else {
|
|
|
- if (e.childItems.isEmpty) {
|
|
|
- return _buildItemMetaContainer(
|
|
|
- e,
|
|
|
- () => chooseMeasure(e),
|
|
|
- );
|
|
|
- } else {
|
|
|
- return _buildItemMetaContainer(
|
|
|
- e,
|
|
|
- () => chooseComboMeasure(e),
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- }).toList(),
|
|
|
+
|
|
|
+ FWidget _buildItemTitle(int itemIndex) {
|
|
|
+ final itemMeta = measureData.curItemMetaList[itemIndex];
|
|
|
+ final ifShowCN = i18nBook.isCurrentChinese &&
|
|
|
+ MeasureLanguage.t(itemMeta.description) != itemMeta.description;
|
|
|
+ return FContainer(
|
|
|
+ decoration: const BoxDecoration(
|
|
|
+ border: Border(
|
|
|
+ bottom: BorderSide(
|
|
|
+ color: buttonBorderHighlight, width: buttonBorderHighlightWidth),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: FSizedBox(
|
|
|
+ height: 50,
|
|
|
+ width: double.infinity,
|
|
|
+ child: FColumn(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ if (ifShowCN)
|
|
|
+ FText(
|
|
|
+ MeasureLanguage.t(itemMeta.description),
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ style: TextStyle(
|
|
|
+ color: buttonTextColor,
|
|
|
+ fontFamily: fontFamily,
|
|
|
+ fontSize: 12,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ FText(
|
|
|
+ itemMeta.description,
|
|
|
+ style: const TextStyle(
|
|
|
+ color: buttonTextColor,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- FWidget _buildItemMetaContainer(ItemMeta e, Function onTap) {
|
|
|
- FWidget measure;
|
|
|
- if (e.description == activeName) {
|
|
|
- measure = FElevatedButton(
|
|
|
- onPressed: () => onTap.call(),
|
|
|
- child: i18nBook.isCurrentChinese &&
|
|
|
- MeasureLanguage.t(e.description) != e.description
|
|
|
- ? FColumn(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- FText(
|
|
|
- MeasureLanguage.t(e.description),
|
|
|
- maxLines: 1,
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- style: TextStyle(
|
|
|
- fontFamily: fontFamily,
|
|
|
- fontSize: 12,
|
|
|
- ),
|
|
|
- ),
|
|
|
- FText(
|
|
|
- e.description,
|
|
|
- ),
|
|
|
- ],
|
|
|
- )
|
|
|
- : FText(
|
|
|
- e.description,
|
|
|
- ),
|
|
|
- style: ElevatedButton.styleFrom(
|
|
|
- fixedSize: const Size.fromHeight(
|
|
|
- 50,
|
|
|
- ),
|
|
|
- ),
|
|
|
- );
|
|
|
+
|
|
|
+ FWidget _buildChildItemContainer(ItemMeta itemMeta) {
|
|
|
+ final activeName = itemMeta.description;
|
|
|
+ final isSpecial = MeasurespecialsupportedTerms.items.contains(activeName);
|
|
|
+ if (isSpecial) {
|
|
|
+
|
|
|
+ return const SpecialItemHR();
|
|
|
} else {
|
|
|
- measure = FOutlinedButton(
|
|
|
- onPressed: () => onTap.call(),
|
|
|
- child: i18nBook.isCurrentChinese &&
|
|
|
- MeasureLanguage.t(e.description) != e.description
|
|
|
- ? FColumn(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- FText(
|
|
|
- MeasureLanguage.t(e.description),
|
|
|
- maxLines: 1,
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontFamily: fontFamily,
|
|
|
- fontSize: 12,
|
|
|
- ),
|
|
|
- ),
|
|
|
- FText(
|
|
|
- e.description,
|
|
|
- style: const TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- )
|
|
|
- : FText(
|
|
|
- e.description,
|
|
|
- style: const TextStyle(
|
|
|
- color: Colors.white,
|
|
|
+ return FContainer(
|
|
|
+ decoration: const BoxDecoration(
|
|
|
+ color: childContainerBackground,
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ bottomLeft: Radius.circular(5), bottomRight: Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 5),
|
|
|
+ child: FColumn(
|
|
|
+ children: (itemMeta.childItems)
|
|
|
+ .asMap()
|
|
|
+ .entries
|
|
|
+ .map(
|
|
|
+ (e) => _buildChildItemButton(
|
|
|
+ e.value,
|
|
|
+ e.key,
|
|
|
),
|
|
|
- ),
|
|
|
- style: OutlinedButton.styleFrom(
|
|
|
- fixedSize: const Size.fromHeight(
|
|
|
- 50,
|
|
|
- ),
|
|
|
- side: const BorderSide(
|
|
|
- color: Color.fromRGBO(124, 124, 124, 1),
|
|
|
- ),
|
|
|
- textStyle: const TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- ),
|
|
|
+ )
|
|
|
+ .toList(),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- return FRow(
|
|
|
- children: [
|
|
|
- const FSizedBox(
|
|
|
- width: 12,
|
|
|
- ),
|
|
|
- FExpanded(
|
|
|
- child: measure,
|
|
|
- ),
|
|
|
- const FSizedBox(
|
|
|
- width: 12,
|
|
|
- ),
|
|
|
- ],
|
|
|
- );
|
|
|
+
|
|
|
+ FWidget _buildChildItemButton(ItemMeta itemMeta, int childItemIndex) {
|
|
|
+ final isActived = childItemIndex == activeChildItemIndex;
|
|
|
+ return FContainer(
|
|
|
+ width: double.infinity,
|
|
|
+ margin: const EdgeInsetsDirectional.all(5),
|
|
|
+ child: FElevatedButton(
|
|
|
+ onPressed: () {
|
|
|
+ selectChildItem(childItemIndex);
|
|
|
+ },
|
|
|
+ child: FText(
|
|
|
+ itemMeta.description,
|
|
|
+ ),
|
|
|
+ style: ElevatedButton.styleFrom(
|
|
|
+ backgroundColor: isActived ? null : buttonBackgroundColor,
|
|
|
+ side: BorderSide(
|
|
|
+ color: isActived ? Colors.transparent : buttonBorderColor,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ));
|
|
|
}
|
|
|
}
|