123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- import 'package:fis_i18n/i18n.dart';
- import 'package:fis_measure/process/workspace/measure_handler.dart';
- import 'package:fis_theme/theme.dart';
- import 'package:fis_ui/index.dart';
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- /// 下拉选择的类
- class MeasureSelectModel {
- MeasureSelectModel({required this.name, required this.code});
- final String name;
- final String code;
- }
- enum TagEnum {
- MeasureTool,
- NodesTool,
- }
- /// 工具箱 样式配置之类
- class LeftSiderHold extends StatelessWidget implements FWidget {
- const LeftSiderHold({Key? key}) : super(key: key);
- @override
- FWidget build(BuildContext context) {
- return FContainer(
- width: 300,
- padding: const EdgeInsets.symmetric(
- horizontal: 10,
- vertical: 15,
- ),
- child: FColumn(
- key: UniqueKey(),
- mainAxisSize: MainAxisSize.max,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- FRow(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- // 工具箱文案
- FText(
- i18nBook.measure.toolbox.t,
- style: const TextStyle(
- color: Colors.white,
- ),
- ),
- _LeftSiderHoldAllStyleConfig(),
- ],
- ),
- _LeftSiderTabBar(),
- _LeftMeasureTools(),
- _LeftSelectInput(),
- _LeftPulldown(),
- ],
- ),
- );
- }
- }
- /// 测量样式 和配置
- class _LeftSiderHoldAllStyleConfig extends StatelessWidget implements FWidget {
- @override
- FWidget build(BuildContext context) {
- return FRow(
- children: [
- FTextButton(
- onPressed: () {
- // router.dialog(
- // () => PatternDialog(),
- // );
- },
- child: FText(
- i18nBook.measure.style.t,
- style: TextStyle(
- color: FTheme.ins.colorScheme.primary,
- ),
- ),
- ),
- FTextButton(
- onPressed: () {
- // router.dialog(
- // () => MeasureconfigurationPage(),
- // );
- },
- child: FText(
- i18nBook.measure.config.t,
- style: TextStyle(
- color: FTheme.ins.colorScheme.primary,
- ),
- ),
- ),
- ],
- );
- }
- }
- /// 测量工具 注释工具Tab
- class _LeftSiderTabBar extends StatefulWidget implements FWidget {
- @override
- State<_LeftSiderTabBar> createState() => _LeftSiderTabBarState();
- }
- class _LeftSiderTabBarState extends State<_LeftSiderTabBar> {
- final measureHandler = Get.find<MeasureHandler>();
- @override
- FWidget build(BuildContext context) {
- return FRow(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- _buildTab(
- TagEnum.MeasureTool,
- i18nBook.measure.measureTool.t,
- ),
- _buildTab(
- TagEnum.NodesTool,
- i18nBook.measure.annotationTool.t,
- ),
- ],
- );
- }
- FWidget _buildTab(TagEnum tag, String title) {
- return FTextButton(
- style: ButtonStyle(
- padding: MaterialStateProperty.all(
- const EdgeInsets.all(
- 6,
- ),
- ),
- ),
- onPressed: () {
- print(tag);
- measureHandler.changedTab = tag;
- setState(() {});
- },
- child: FText(
- title,
- style: TextStyle(
- color: measureHandler.changedTab == tag
- ? FTheme.ins.colorScheme.primary
- : Colors.white,
- ),
- ),
- );
- }
- }
- /// 测量方法 Har
- class _LeftMeasureTools extends StatelessWidget implements FWidget {
- @override
- FWidget build(BuildContext context) {
- return FContainer(
- width: 300,
- height: 50,
- alignment: Alignment.topCenter,
- padding: const EdgeInsets.symmetric(vertical: 8),
- child: FGridView.count(
- shrinkWrap: true,
- crossAxisCount: 4,
- crossAxisSpacing: 10,
- mainAxisSpacing: 10,
- childAspectRatio: 1 / 0.5,
- children: [
- 'HAR',
- ]
- .map(
- (e) => FContainer(
- alignment: Alignment.center,
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.grey,
- ),
- ),
- child: FText(
- e.toString(),
- style: const TextStyle(
- color: Colors.white,
- ),
- ),
- ),
- )
- .toList(),
- ),
- );
- }
- }
- class _LeftSelectInput extends StatelessWidget implements FWidget {
- @override
- FWidget build(BuildContext context) {
- return FContainer(
- child: FRow(
- children: [
- FExpanded(
- child: FContainer(
- child: FRow(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- FBorderInput(
- hintSize: 16,
- contentSize: 16,
- maxLength: 20,
- borderColor: const Color.fromARGB(255, 187, 180, 180),
- suffixIcon: FMaterial(
- color: Colors.transparent,
- child: FIconButton(
- onPressed: () {},
- icon: const FIcon(
- Icons.search,
- ),
- ),
- ),
- hintText: i18nBook.common.search.t,
- onChanged: (value) {},
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- );
- }
- }
- class _LeftPulldown extends StatelessWidget implements FWidget {
- @override
- FWidget build(BuildContext context) {
- return FContainer(
- margin: const EdgeInsets.symmetric(vertical: 4),
- child: FSelect<MeasureSelectModel, String>(
- source: [
- MeasureSelectModel(
- name: 'General',
- code: 'General',
- )
- ],
- hintText: i18nBook.measure.selectMeasureItem.t,
- value: 'General',
- clearable: false,
- height: 36,
- width: 400,
- optionLabelExtractor: (data) => data.name,
- optionValueExtractor: (data) => data.code,
- onSelectChanged: (value, index) {},
- ),
- );
- }
- }
|