123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- import 'package:fis_measure/interfaces/process/workspace/application.dart';
- import 'package:fis_measure/process/primitives/single_straightline.dart';
- import 'package:fis_ui/index.dart';
- import 'package:flutter/material.dart';
- import 'package:fis_theme/theme.dart';
- import 'package:get/get.dart';
- class SpecialCombo extends FStatefulWidget {
- const SpecialCombo({Key? key}) : super(key: key);
- @override
- FState<SpecialCombo> createState() => _SpecialComboState();
- }
- class _SpecialComboState extends FState<SpecialCombo> {
- final application = Get.find<IApplication>();
- late final item = application.activeMeasureItem!;
- late int selectedIndex = 1;
- FWidget buildHRButton(int index) {
- return FInkWell(
- onTap: () {
- final hRFeature = item.feature as StraightLineHeartRateFeature;
- hRFeature.setHeartRate(index);
- application.updateRenderReady.emit(this, null);
- setState(() {
- selectedIndex = index;
- });
- },
- child: FContainer(
- decoration: BoxDecoration(
- color:
- selectedIndex == index ? Colors.greenAccent : Colors.transparent,
- border: Border.all(color: Colors.grey),
- borderRadius: BorderRadius.circular(5),
- ),
- margin: const EdgeInsets.symmetric(horizontal: 11, vertical: 5),
- padding: const EdgeInsets.all(8),
- child: FCenter(
- child: FText(
- index.toString(),
- style: const TextStyle(
- color: Colors.white,
- ),
- ),
- ),
- ),
- );
- }
- @override
- FWidget build(BuildContext context) {
- return FColumn(
- children: [
- FContainer(
- padding: const EdgeInsets.symmetric(
- vertical: 6,
- ),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(4),
- color: FTheme.ins.colorScheme.primary,
- ),
- margin: const EdgeInsets.symmetric(
- horizontal: 11,
- ),
- width: double.infinity,
- child: const FCenter(
- child: FText(
- 'Time',
- style: TextStyle(
- color: Colors.white,
- ),
- ),
- ),
- ),
- FColumn(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- FRow(
- children: const [
- FSizedBox(
- width: 11,
- ),
- FText(
- 'Heart Cycle',
- textAlign: TextAlign.start,
- style: TextStyle(
- color: Colors.white,
- ),
- ),
- ],
- ),
- FGridView.count(
- shrinkWrap: true,
- crossAxisCount: 2,
- childAspectRatio: 3,
- children: [1, 2, 3, 4, 5].map((e) {
- return buildHRButton(e);
- }).toList(),
- ),
- ],
- ),
- ],
- );
- }
- }
|