Compare commits
2 Commits
main
...
feature/mi
Author | SHA1 | Date | |
---|---|---|---|
|
758a691f8d | ||
1341d9523b |
11
Makefile
11
Makefile
@ -27,18 +27,13 @@ clean:
|
|||||||
flutter clean
|
flutter clean
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
DOCKER_BUILDKIT=1 docker build -t oc-front --build-arg HOST=$(HOST) -f Dockerfile .
|
DOCKER_BUILDKIT=1 docker build -t oc/oc-front:0.0.1 --build-arg HOST=$(HOST) -f Dockerfile .
|
||||||
docker tag oc-front:latest oc/oc-front:0.0.1
|
docker tag oc/oc-front:0.0.1 oc/oc-front:latest
|
||||||
|
|
||||||
publish-kind:
|
publish-kind:
|
||||||
kind load docker-image oc/oc-front:0.0.1 --name opencloud | true
|
kind load docker-image oc/oc-front:0.0.1 --name opencloud
|
||||||
|
|
||||||
publish-registry:
|
publish-registry:
|
||||||
@echo "TODO"
|
@echo "TODO"
|
||||||
|
|
||||||
docker-deploy:
|
|
||||||
docker compose up -d
|
|
||||||
|
|
||||||
run-docker: docker publish-kind publish-registry docker-deploy
|
|
||||||
|
|
||||||
.PHONY: build run clean docker publish-kind publish-registry
|
.PHONY: build run clean docker publish-kind publish-registry
|
||||||
|
@ -42,14 +42,14 @@ class HeaderConstants {
|
|||||||
|
|
||||||
static setTitle(String? v) {
|
static setTitle(String? v) {
|
||||||
title = v;
|
title = v;
|
||||||
Future.delayed(const Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
HeaderConstants.headerWidget?.setState(() {});
|
HeaderConstants.headerWidget?.setState(() {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static setDescription(String? v) {
|
static setDescription(String? v) {
|
||||||
description = v;
|
description = v;
|
||||||
Future.delayed(const Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
HeaderConstants.headerWidget?.setState(() {});
|
HeaderConstants.headerWidget?.setState(() {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ class HeaderWidgetState extends State<HeaderWidget> {
|
|||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
if (AppRouter.currentRoute.factory.searchFill()) {
|
if (AppRouter.currentRoute.factory.searchFill()) {
|
||||||
return const DefaultWidget();
|
return DefaultWidget();
|
||||||
}
|
}
|
||||||
HeaderConstants.height = HeaderConstants.isNoHeader(AppRouter.currentRoute.route) || !AppRouter.currentRoute.factory.searchFill() ? 50 : 100;
|
HeaderConstants.height = HeaderConstants.isNoHeader(AppRouter.currentRoute.route) || !AppRouter.currentRoute.factory.searchFill() ? 50 : 100;
|
||||||
return Column( children: [
|
return Column( children: [
|
||||||
@ -78,7 +78,7 @@ class HeaderWidgetState extends State<HeaderWidget> {
|
|||||||
height: 50, width: getMainWidth(context),
|
height: 50, width: getMainWidth(context),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: midColor,
|
color: midColor,
|
||||||
border: const Border(bottom: BorderSide(color: Colors.white, width: 1),)
|
border: Border(bottom: BorderSide(color: Colors.white, width: 1),)
|
||||||
),
|
),
|
||||||
child: Row(crossAxisAlignment: CrossAxisAlignment.stretch,
|
child: Row(crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
@ -89,7 +89,7 @@ class HeaderWidgetState extends State<HeaderWidget> {
|
|||||||
child:
|
child:
|
||||||
Container(width: 50, height: 50,
|
Container(width: 50, height: 50,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
child: const Center(child: Icon(Icons.keyboard_backspace, color: Colors.white))
|
child: Center(child: Icon(Icons.keyboard_backspace, color: Colors.white))
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ShallowTextInputWidget(
|
ShallowTextInputWidget(
|
||||||
@ -112,10 +112,10 @@ class HeaderWidgetState extends State<HeaderWidget> {
|
|||||||
AppRouter.currentRoute.factory.search(context, true);
|
AppRouter.currentRoute.factory.search(context, true);
|
||||||
} : null,
|
} : null,
|
||||||
),
|
),
|
||||||
Container( padding: const EdgeInsets.only(left: 50),
|
Container( padding: EdgeInsets.only(left: 50),
|
||||||
decoration: const BoxDecoration( border: Border( left: BorderSide( color: Colors.white ))),
|
decoration: BoxDecoration( border: Border( left: BorderSide( color: Colors.white ))),
|
||||||
child: ShallowDropdownInputWidget(
|
child: ShallowDropdownInputWidget(
|
||||||
prefixIcon: const Padding( padding: EdgeInsets.only(right: 10), child: Icon(Icons.shopping_cart, color: Colors.grey)),
|
prefixIcon: Padding( padding: EdgeInsets.only(right: 10), child: Icon(Icons.shopping_cart, color: Colors.grey)),
|
||||||
current: WorkspaceLocal.current,
|
current: WorkspaceLocal.current,
|
||||||
width: 350,
|
width: 350,
|
||||||
all: () async => WorkspaceLocal.getWorkspacesShallow(),
|
all: () async => WorkspaceLocal.getWorkspacesShallow(),
|
||||||
|
@ -101,7 +101,7 @@ class AuthService {
|
|||||||
'expiresIn',
|
'expiresIn',
|
||||||
DateTime.now()
|
DateTime.now()
|
||||||
.add(Duration(seconds: token.data?.value['expires_in']) -
|
.add(Duration(seconds: token.data?.value['expires_in']) -
|
||||||
const Duration(seconds: 10))
|
Duration(seconds: 10))
|
||||||
.toIso8601String());
|
.toIso8601String());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -17,7 +17,7 @@ import 'package:go_router/go_router.dart';
|
|||||||
GlobalKey<RouterWidgetState> routerKey = GlobalKey<RouterWidgetState>();
|
GlobalKey<RouterWidgetState> routerKey = GlobalKey<RouterWidgetState>();
|
||||||
|
|
||||||
class RouterWidget extends StatefulWidget {
|
class RouterWidget extends StatefulWidget {
|
||||||
const RouterWidget({super.key});
|
const RouterWidget({Key? key}) : super(key: key);
|
||||||
@override RouterWidgetState createState() => RouterWidgetState();
|
@override RouterWidgetState createState() => RouterWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,6 +94,7 @@ class AppRouter {
|
|||||||
var url = await getRouteCookie();
|
var url = await getRouteCookie();
|
||||||
if (url != null && url != "") {
|
if (url != null && url != "") {
|
||||||
for (var zone in zones) {
|
for (var zone in zones) {
|
||||||
|
print("URL: $url ${zone.route}");
|
||||||
if (zone.route == url.replaceAll("/", "")) {
|
if (zone.route == url.replaceAll("/", "")) {
|
||||||
Map<String, String> params = {};
|
Map<String, String> params = {};
|
||||||
var srcParams = await getRouteParamsCookie();
|
var srcParams = await getRouteParamsCookie();
|
||||||
|
@ -72,6 +72,7 @@ class Log extends SerializerDeserializer<Log> {
|
|||||||
|
|
||||||
String getMessage(String mess) {
|
String getMessage(String mess) {
|
||||||
var jsonString = mess;
|
var jsonString = mess;
|
||||||
|
print(mess);
|
||||||
try {
|
try {
|
||||||
var j = JsonString(mess.replaceAll("\\", "")).decodedValue as Map<String, dynamic>;
|
var j = JsonString(mess.replaceAll("\\", "")).decodedValue as Map<String, dynamic>;
|
||||||
map = j;
|
map = j;
|
||||||
@ -80,7 +81,7 @@ class Log extends SerializerDeserializer<Log> {
|
|||||||
} else {
|
} else {
|
||||||
jsonString = "${j["Name"]} : [${j["Namespace"]}] ${j["Status"]} ${j["Progress"]} (${j["Duration"].toString()})\nCreated at ${j["Created"].toString().replaceAllMapped(RegExp(r'\(\w+\)'), (match) { return ''; }).replaceAllMapped(RegExp(r'\+\w+'), (match) { return ''; })}; Started at ${j["Created"].toString().replaceAllMapped(RegExp(r'\(\w+\)'), (match) { return ''; }).replaceAllMapped(RegExp(r'\+\w+'), (match) { return ''; })}";
|
jsonString = "${j["Name"]} : [${j["Namespace"]}] ${j["Status"]} ${j["Progress"]} (${j["Duration"].toString()})\nCreated at ${j["Created"].toString().replaceAllMapped(RegExp(r'\(\w+\)'), (match) { return ''; }).replaceAllMapped(RegExp(r'\+\w+'), (match) { return ''; })}; Started at ${j["Created"].toString().replaceAllMapped(RegExp(r'\(\w+\)'), (match) { return ''; }).replaceAllMapped(RegExp(r'\+\w+'), (match) { return ''; })}";
|
||||||
}
|
}
|
||||||
} on JsonFormatException catch (_) { /* */ }
|
} on JsonFormatException catch (e) { /* */ }
|
||||||
message = jsonString;
|
message = jsonString;
|
||||||
return jsonString;
|
return jsonString;
|
||||||
}
|
}
|
||||||
|
@ -48,10 +48,14 @@ class StorageItem extends AbstractItem<StoragePricing, StoragePartnership, Stora
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override Map<String, dynamic> serialize() {
|
@override Map<String, dynamic> serialize() {
|
||||||
var obj = infos();
|
var obj = {
|
||||||
|
"acronym": acronym,
|
||||||
|
"storage_type": typeEnum,
|
||||||
|
};
|
||||||
obj.addAll(toJSON());
|
obj.addAll(toJSON());
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class StorageInstance extends AbstractInstance<StoragePricing, StoragePartnership> {
|
class StorageInstance extends AbstractInstance<StoragePricing, StoragePartnership> {
|
||||||
|
@ -334,25 +334,24 @@ class Graph extends SerializerDeserializer<Graph> {
|
|||||||
}
|
}
|
||||||
// should find arrow env info and add it to the env
|
// should find arrow env info and add it to the env
|
||||||
List<Param> extParams = [];
|
List<Param> extParams = [];
|
||||||
// var arrows = links.where( (e) => (e.source?.id?.contains(item.id ?? "") ?? false) || (e.destination?.id?.contains(item.id ?? "") ?? false));
|
var arrows = links.where( (e) => (e.source?.id?.contains(item.id ?? "") ?? false) || (e.destination?.id?.contains(item.id ?? "") ?? false));
|
||||||
/*for (var arrow in arrows) {
|
for (var arrow in arrows) {
|
||||||
for (var info in arrow.infos) {
|
|
||||||
var i = info as Map<String, dynamic>;
|
|
||||||
for (var entry in i.entries) {
|
|
||||||
if (entry.value == null) { continue; }
|
|
||||||
|
|
||||||
var varName = "LINK_${el.getName().toUpperCase().replaceAll(" ", "_")}_${entry.key.toUpperCase()}";
|
/*var count = 0;
|
||||||
|
for (var info in arrow.infos) {
|
||||||
|
var i = info as StorageProcessingGraphLink;
|
||||||
|
var varName = "LINK_${el.getName().toUpperCase().replaceAll(" ", "_")}_${count}";
|
||||||
|
count++;
|
||||||
/*alreadySeen[varName] = (alreadySeen[varName] ?? -1) + 1;
|
/*alreadySeen[varName] = (alreadySeen[varName] ?? -1) + 1;
|
||||||
if ((alreadySeen[varName] ?? 0) > 1) {
|
if ((alreadySeen[varName] ?? 0) > 1) {
|
||||||
varName = "${varName}_${alreadySeen[varName]}";
|
varName = "${varName}_${alreadySeen[varName]}";
|
||||||
}*/
|
|
||||||
if ((entry.value is String) && !isEnvAttr(entry.value, what2)) {
|
|
||||||
extParams.add(Param( name: varName,
|
|
||||||
attr: entry.key, value: entry.value, origin: item.id, readOnly: true));
|
|
||||||
}
|
}
|
||||||
}
|
if ((entry.value is String) && !isEnvAttr(entry.value, what2)) {
|
||||||
}
|
extParams.add(Param( name: varName,
|
||||||
}*/
|
attr: entry.key, value: entry.value, origin: item.id, readOnly: true));
|
||||||
|
}*/
|
||||||
|
}*/
|
||||||
|
}
|
||||||
for ( var param in what) {
|
for ( var param in what) {
|
||||||
if (param.attr == null) { continue; }
|
if (param.attr == null) { continue; }
|
||||||
var varName = param.name != null && (param.name!.contains("LINK_")
|
var varName = param.name != null && (param.name!.contains("LINK_")
|
||||||
@ -525,6 +524,7 @@ class GraphLink extends SerializerDeserializer<GraphLink> {
|
|||||||
destination = Position(id: j["to"]["id"], x: j["to"]["x"], y: j["to"]["y"]);
|
destination = Position(id: j["to"]["id"], x: j["to"]["x"], y: j["to"]["y"]);
|
||||||
style = GraphLinkStyle();
|
style = GraphLinkStyle();
|
||||||
style!.fromDashboard(j["params"]);
|
style!.fromDashboard(j["params"]);
|
||||||
|
print(j["infos"]);
|
||||||
infos = fromListJson(j["infos"], StorageProcessingGraphLink());
|
infos = fromListJson(j["infos"], StorageProcessingGraphLink());
|
||||||
env = fromListJson(j["env"], Param());
|
env = fromListJson(j["env"], Param());
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
|
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:oc_front/core/services/specialized_services/booking_service.dart';
|
||||||
import 'package:oc_front/main.dart';
|
import 'package:oc_front/main.dart';
|
||||||
import 'package:intl/intl.dart' as intl;
|
import 'package:intl/intl.dart' as intl;
|
||||||
import 'package:oc_front/pages/abstract_page.dart';
|
import 'package:oc_front/pages/abstract_page.dart';
|
||||||
@ -21,6 +22,7 @@ class ComputePageWidget extends StatefulWidget {
|
|||||||
bool isList = true;
|
bool isList = true;
|
||||||
DateTime start = DateTime.now();
|
DateTime start = DateTime.now();
|
||||||
DateTime end = DateTime.now().add(const Duration(days: 180));
|
DateTime end = DateTime.now().add(const Duration(days: 180));
|
||||||
|
final BookingExecutionService _service = BookingExecutionService();
|
||||||
|
|
||||||
ComputePageWidget () : super(key: DatacenterFactory.key);
|
ComputePageWidget () : super(key: DatacenterFactory.key);
|
||||||
@override ComputePageWidgetState createState() => ComputePageWidgetState();
|
@override ComputePageWidgetState createState() => ComputePageWidgetState();
|
||||||
@ -64,7 +66,7 @@ class ComputePageWidgetState extends State<ComputePageWidget> {
|
|||||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
colorScheme: ColorScheme.light(
|
colorScheme: ColorScheme.light(
|
||||||
surface: midColor,
|
background: midColor,
|
||||||
tertiary: Colors.grey,
|
tertiary: Colors.grey,
|
||||||
secondary: Colors.grey,
|
secondary: Colors.grey,
|
||||||
primary: Colors.black),
|
primary: Colors.black),
|
||||||
@ -122,7 +124,7 @@ class ComputePageWidgetState extends State<ComputePageWidget> {
|
|||||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
colorScheme: ColorScheme.light(
|
colorScheme: ColorScheme.light(
|
||||||
surface: midColor,
|
background: midColor,
|
||||||
tertiary: Colors.grey,
|
tertiary: Colors.grey,
|
||||||
secondary: Colors.grey,
|
secondary: Colors.grey,
|
||||||
primary: Colors.black),
|
primary: Colors.black),
|
||||||
|
@ -6,6 +6,7 @@ import 'package:go_router/go_router.dart';
|
|||||||
import 'package:latlong2/latlong.dart';
|
import 'package:latlong2/latlong.dart';
|
||||||
import 'package:flutter_map/flutter_map.dart';
|
import 'package:flutter_map/flutter_map.dart';
|
||||||
import 'package:oc_front/core/services/specialized_services/datacenter_service.dart';
|
import 'package:oc_front/core/services/specialized_services/datacenter_service.dart';
|
||||||
|
import 'package:oc_front/main.dart';
|
||||||
import 'package:oc_front/models/resources/compute.dart';
|
import 'package:oc_front/models/resources/compute.dart';
|
||||||
import 'package:oc_front/models/resources/resources.dart';
|
import 'package:oc_front/models/resources/resources.dart';
|
||||||
import 'package:oc_front/models/resources/storage.dart';
|
import 'package:oc_front/models/resources/storage.dart';
|
||||||
@ -23,7 +24,6 @@ class MapFactory implements AbstractFactory {
|
|||||||
@override void search(BuildContext context, bool special) { }
|
@override void search(BuildContext context, bool special) { }
|
||||||
}
|
}
|
||||||
double menuSize = 0;
|
double menuSize = 0;
|
||||||
// ignore: must_be_immutable
|
|
||||||
class MapPageWidget extends StatefulWidget {
|
class MapPageWidget extends StatefulWidget {
|
||||||
bool isShowed = false;
|
bool isShowed = false;
|
||||||
final DatacenterService _service = DatacenterService();
|
final DatacenterService _service = DatacenterService();
|
||||||
@ -77,6 +77,8 @@ class MapPageWidgetState extends State<MapPageWidget> {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Rect rect = Rect.fromCenter( center: MediaQuery.of(context).size.center(Offset.zero),
|
||||||
|
width: selected ? menuSize : 0, height: (getMainHeight(context) - 50) > 0 ? (getMainHeight(context) - 50) : 0);
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child : FlutterMap(
|
child : FlutterMap(
|
||||||
mapController: _mapController,
|
mapController: _mapController,
|
||||||
@ -111,7 +113,6 @@ class HoverMenuController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class HoverMenu extends StatefulWidget {
|
class HoverMenu extends StatefulWidget {
|
||||||
final Widget title;
|
final Widget title;
|
||||||
final double? width;
|
final double? width;
|
||||||
@ -121,12 +122,12 @@ class HoverMenu extends StatefulWidget {
|
|||||||
|
|
||||||
|
|
||||||
HoverMenu({
|
HoverMenu({
|
||||||
super.key,
|
Key? key,
|
||||||
required this.title,
|
required this.title,
|
||||||
this.items = const [],
|
this.items = const [],
|
||||||
this.width,
|
this.width,
|
||||||
this.controller,
|
this.controller,
|
||||||
});
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
HoverMenuState createState() => HoverMenuState();
|
HoverMenuState createState() => HoverMenuState();
|
||||||
|
@ -2,6 +2,7 @@ import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart' as intl;
|
import 'package:intl/intl.dart' as intl;
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:oc_front/core/services/specialized_services/workflow_execution_service.dart';
|
||||||
import 'package:oc_front/main.dart';
|
import 'package:oc_front/main.dart';
|
||||||
import 'package:oc_front/pages/abstract_page.dart';
|
import 'package:oc_front/pages/abstract_page.dart';
|
||||||
import 'package:oc_front/widgets/sheduler_items/schedule.dart';
|
import 'package:oc_front/widgets/sheduler_items/schedule.dart';
|
||||||
@ -21,6 +22,7 @@ class SchedulerPageWidget extends StatefulWidget {
|
|||||||
bool isList = true;
|
bool isList = true;
|
||||||
DateTime start = DateTime.now();
|
DateTime start = DateTime.now();
|
||||||
DateTime end = DateTime.now().add(const Duration(days: 180));
|
DateTime end = DateTime.now().add(const Duration(days: 180));
|
||||||
|
final WorkflowExecutionService _service = WorkflowExecutionService();
|
||||||
SchedulerPageWidget(): super(key: SchedulerFactory.key);
|
SchedulerPageWidget(): super(key: SchedulerFactory.key);
|
||||||
@override SchedulerPageWidgetState createState() => SchedulerPageWidgetState();
|
@override SchedulerPageWidgetState createState() => SchedulerPageWidgetState();
|
||||||
static void search(BuildContext context) { }
|
static void search(BuildContext context) { }
|
||||||
@ -60,7 +62,7 @@ class SchedulerPageWidgetState extends State<SchedulerPageWidget> {
|
|||||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
colorScheme: ColorScheme.light(
|
colorScheme: ColorScheme.light(
|
||||||
surface: midColor,
|
background: midColor,
|
||||||
tertiary: Colors.grey,
|
tertiary: Colors.grey,
|
||||||
secondary: Colors.grey,
|
secondary: Colors.grey,
|
||||||
primary: Colors.black),
|
primary: Colors.black),
|
||||||
@ -118,7 +120,7 @@ class SchedulerPageWidgetState extends State<SchedulerPageWidget> {
|
|||||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
colorScheme: ColorScheme.light(
|
colorScheme: ColorScheme.light(
|
||||||
surface: midColor,
|
background: midColor,
|
||||||
tertiary: Colors.grey,
|
tertiary: Colors.grey,
|
||||||
secondary: Colors.grey,
|
secondary: Colors.grey,
|
||||||
primary: Colors.black),
|
primary: Colors.black),
|
||||||
|
@ -66,8 +66,7 @@ final WorflowService _service = WorflowService();
|
|||||||
var from = dash.getElement(arrow.fromID);
|
var from = dash.getElement(arrow.fromID);
|
||||||
var to = dash.getElement(arrow.toID);
|
var to = dash.getElement(arrow.toID);
|
||||||
if ((from?.element?.getType() == "storage" && to?.element?.getType() == "processing")
|
if ((from?.element?.getType() == "storage" && to?.element?.getType() == "processing")
|
||||||
|| (from?.element?.getType() == "processing" && to?.element?.getType() == "storage")
|
|| (from?.element?.getType() == "processing" && to?.element?.getType() == "storage")) {
|
||||||
|| (from?.element?.getType() == "processing" && to?.element?.getType() == "processing")) {
|
|
||||||
return StorageProcessingLinkFormsWidget( dash: dash, item: arrow);
|
return StorageProcessingLinkFormsWidget( dash: dash, item: arrow);
|
||||||
}
|
}
|
||||||
return Container();
|
return Container();
|
||||||
|
@ -4,7 +4,6 @@ import 'package:oc_front/widgets/items/item_row.dart';
|
|||||||
import 'package:oc_front/models/resources/resources.dart';
|
import 'package:oc_front/models/resources/resources.dart';
|
||||||
import 'package:oc_front/core/models/workspace_local.dart';
|
import 'package:oc_front/core/models/workspace_local.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class CatalogWidget extends StatefulWidget {
|
class CatalogWidget extends StatefulWidget {
|
||||||
double? itemWidth;
|
double? itemWidth;
|
||||||
bool readOnly = false;
|
bool readOnly = false;
|
||||||
|
@ -20,25 +20,14 @@ class ContainerFormsWidgetState extends State<ContainerFormsWidget> {
|
|||||||
List<Widget> widgets = [];
|
List<Widget> widgets = [];
|
||||||
var instance = widget.item.getSelectedInstance();
|
var instance = widget.item.getSelectedInstance();
|
||||||
if (instance != null && instance is ProcessingInstance && instance.access?.container != null) {
|
if (instance != null && instance is ProcessingInstance && instance.access?.container != null) {
|
||||||
List<SubExposeFormsWidget> exposes = [];
|
|
||||||
var container = instance.access!.container!;
|
var container = instance.access!.container!;
|
||||||
for (var expose in container.exposes) {
|
|
||||||
exposes.add(SubExposeFormsWidget(
|
|
||||||
readOnly: false,
|
|
||||||
width: 180,
|
|
||||||
dash: widget.dash,
|
|
||||||
empty: false,
|
|
||||||
item: expose,
|
|
||||||
elementID: widget.elementID
|
|
||||||
));
|
|
||||||
}
|
|
||||||
widgets.add(Container(
|
widgets.add(Container(
|
||||||
padding: const EdgeInsets.only(bottom: 10),
|
padding: const EdgeInsets.only(bottom: 10),
|
||||||
width: 180,
|
width: 180,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Text("<CONTAINER>", style: TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
Text("<CONTAINER>", style: const TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
||||||
SubTextInputWidget(subkey: "image", width: 180, empty: false, change: (value) { },
|
SubTextInputWidget(subkey: "image", width: 180, empty: false, change: (value) { },
|
||||||
initialValue: container.image, readOnly: true),
|
initialValue: container.image, readOnly: true),
|
||||||
SubTextInputWidget(subkey: "command", width: 180, empty: false, change: (value) {
|
SubTextInputWidget(subkey: "command", width: 180, empty: false, change: (value) {
|
||||||
@ -50,7 +39,7 @@ class ContainerFormsWidgetState extends State<ContainerFormsWidget> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
widget.dash.saveDash(widget.dash.id, context);
|
widget.dash.saveDash(widget.dash.id, context);
|
||||||
}, initialValue: container.command, readOnly: false),
|
}, initialValue: container.command, readOnly: false,),
|
||||||
SubTextInputWidget(subkey: "args", width: 180, empty: false, change: (value) {
|
SubTextInputWidget(subkey: "args", width: 180, empty: false, change: (value) {
|
||||||
container.args = value;
|
container.args = value;
|
||||||
for (var el in widget.dash.elements) {
|
for (var el in widget.dash.elements) {
|
||||||
@ -65,7 +54,7 @@ class ContainerFormsWidgetState extends State<ContainerFormsWidget> {
|
|||||||
],)
|
],)
|
||||||
));
|
));
|
||||||
widgets.add(Container(
|
widgets.add(Container(
|
||||||
width: 200, decoration: const BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
width: 200, decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
||||||
));
|
));
|
||||||
widgets.add(Container(
|
widgets.add(Container(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
@ -97,19 +86,19 @@ class ContainerFormsWidgetState extends State<ContainerFormsWidget> {
|
|||||||
setState(() {});
|
setState(() {});
|
||||||
}, child:
|
}, child:
|
||||||
Container( margin: const EdgeInsets.only(left: 5, top: 5),
|
Container( margin: const EdgeInsets.only(left: 5, top: 5),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.grey, width: 1)),
|
||||||
borderRadius: BorderRadius.circular(5),
|
|
||||||
border: Border.all(color: Colors.grey, width: 1)
|
|
||||||
),
|
|
||||||
width: 45, height: 30,
|
width: 45, height: 30,
|
||||||
child: const Row( mainAxisAlignment: MainAxisAlignment.center,
|
child: const Row( mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [ Icon(Icons.delete, color: Colors.black) ]),
|
children: [ Icon(Icons.delete, color: Colors.black) ]),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
]),
|
||||||
]),
|
],)
|
||||||
...exposes
|
|
||||||
])
|
|
||||||
));
|
));
|
||||||
|
for (var expose in container.exposes) {
|
||||||
|
widgets.add(SubExposeFormsWidget( readOnly: true, width: 180, dash: widget.dash, empty: widgets.isEmpty,
|
||||||
|
item: expose, elementID: widget.elementID));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Column(children: widgets);
|
return Column(children: widgets);
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@ class CredentialsFormsWidgetState extends State<CredentialsFormsWidget> {
|
|||||||
var instance = widget.item.getSelectedInstance();
|
var instance = widget.item.getSelectedInstance();
|
||||||
if (instance != null && instance.credential != null) {
|
if (instance != null && instance.credential != null) {
|
||||||
var creds = instance.credential!;
|
var creds = instance.credential!;
|
||||||
widgets.add(Container( margin: const EdgeInsets.only(bottom: 15),
|
widgets.add(Container( margin: EdgeInsets.only(bottom: 15),
|
||||||
width: 200, decoration: const BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
width: 200, decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
||||||
));
|
));
|
||||||
widgets.add(Container(
|
widgets.add(Container(
|
||||||
padding: const EdgeInsets.only(bottom: 10),
|
padding: const EdgeInsets.only(bottom: 10),
|
||||||
@ -28,9 +28,9 @@ class CredentialsFormsWidgetState extends State<CredentialsFormsWidget> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Text("<CREDENTIALS>", style: TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
Text("<CREDENTIALS>", style: const TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
||||||
SubTextInputWidget(subkey: "login", width: 180, empty: false, change: (value) {
|
SubTextInputWidget(subkey: "login", width: 180, empty: false, change: (value) {
|
||||||
creds.login = value;
|
creds.password = value;
|
||||||
for (var el in widget.dash.elements) {
|
for (var el in widget.dash.elements) {
|
||||||
if (el.id == widget.elementID) {
|
if (el.id == widget.elementID) {
|
||||||
el.element = widget.item;
|
el.element = widget.item;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:oc_front/main.dart';
|
import 'package:oc_front/main.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:oc_front/models/workflow.dart';
|
||||||
import 'package:oc_front/models/resources/resources.dart';
|
import 'package:oc_front/models/resources/resources.dart';
|
||||||
import 'package:oc_front/core/services/perms_service.dart';
|
import 'package:oc_front/core/services/perms_service.dart';
|
||||||
import 'package:oc_front/widgets/forms/credentials_forms.dart';
|
import 'package:oc_front/widgets/forms/credentials_forms.dart';
|
||||||
@ -36,7 +37,7 @@ class ResourceFormsWidgetState extends State<ResourceFormsWidget> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (widgets.isNotEmpty) {
|
if (widgets.isNotEmpty) {
|
||||||
widgets.add(const SizedBox( width: 200, height: 15) );
|
widgets.add(SizedBox( width: 200, height: 15) );
|
||||||
}
|
}
|
||||||
return widgets;
|
return widgets;
|
||||||
}
|
}
|
||||||
@ -54,7 +55,6 @@ class ResourceFormsWidgetState extends State<ResourceFormsWidget> {
|
|||||||
|
|
||||||
|
|
||||||
@override Widget build(BuildContext context) {
|
@override Widget build(BuildContext context) {
|
||||||
print("STATE");
|
|
||||||
List<Widget> instancesCat = [];
|
List<Widget> instancesCat = [];
|
||||||
List<Widget> childrenReadOnly = getWidgets(widget.item.infos());
|
List<Widget> childrenReadOnly = getWidgets(widget.item.infos());
|
||||||
List<DropdownMenuItem<String>> dpItems = [];
|
List<DropdownMenuItem<String>> dpItems = [];
|
||||||
@ -62,11 +62,11 @@ class ResourceFormsWidgetState extends State<ResourceFormsWidget> {
|
|||||||
dpItems.add(DropdownMenuItem(value: '$i', child: Text('${instance.name}', overflow: TextOverflow.ellipsis,)));
|
dpItems.add(DropdownMenuItem(value: '$i', child: Text('${instance.name}', overflow: TextOverflow.ellipsis,)));
|
||||||
}
|
}
|
||||||
if (dpItems.isNotEmpty) {
|
if (dpItems.isNotEmpty) {
|
||||||
childrenReadOnly.add(Padding( padding: const EdgeInsets.only(top: 20),
|
childrenReadOnly.add(Padding( padding: EdgeInsets.only(top: 20),
|
||||||
child : Container(
|
child : Container(
|
||||||
width: 200, decoration: const BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
width: 200, decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
||||||
)));
|
)));
|
||||||
childrenReadOnly.add(Padding(padding: const EdgeInsets.only(bottom: 15), child:
|
childrenReadOnly.add(Padding(padding: EdgeInsets.only(bottom: 15), child:
|
||||||
SubDropdownInputWidget( dropdownMenuEntries: dpItems, subkey: "", width: 180, empty: false,
|
SubDropdownInputWidget( dropdownMenuEntries: dpItems, subkey: "", width: 180, empty: false,
|
||||||
initialValue: "${widget.item.selectedInstance}", change: (value) {
|
initialValue: "${widget.item.selectedInstance}", change: (value) {
|
||||||
if (value != null) { setState(() { widget.item.selectedInstance = int.parse(value); }); }
|
if (value != null) { setState(() { widget.item.selectedInstance = int.parse(value); }); }
|
||||||
@ -81,7 +81,7 @@ class ResourceFormsWidgetState extends State<ResourceFormsWidget> {
|
|||||||
instancesCat.add(CredentialsFormsWidget(dash: widget.dash, item: widget.item, elementID: widget.elementID));
|
instancesCat.add(CredentialsFormsWidget(dash: widget.dash, item: widget.item, elementID: widget.elementID));
|
||||||
if (instancesCat.isNotEmpty) {
|
if (instancesCat.isNotEmpty) {
|
||||||
instancesCat.add(Container(
|
instancesCat.add(Container(
|
||||||
width: 200, decoration: const BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
width: 200, decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
bool readOnly = !PermsService.getPerm(Perms.WORKFLOW_EDIT);
|
bool readOnly = !PermsService.getPerm(Perms.WORKFLOW_EDIT);
|
||||||
|
@ -252,7 +252,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
|||||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
colorScheme: ColorScheme.light(
|
colorScheme: ColorScheme.light(
|
||||||
surface: midColor,
|
background: midColor,
|
||||||
tertiary: Colors.grey,
|
tertiary: Colors.grey,
|
||||||
secondary: Colors.grey,
|
secondary: Colors.grey,
|
||||||
primary: Colors.black),
|
primary: Colors.black),
|
||||||
@ -353,7 +353,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
|||||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
colorScheme: ColorScheme.light(
|
colorScheme: ColorScheme.light(
|
||||||
surface: midColor,
|
background: midColor,
|
||||||
tertiary: Colors.grey,
|
tertiary: Colors.grey,
|
||||||
secondary: Colors.grey,
|
secondary: Colors.grey,
|
||||||
primary: Colors.black),
|
primary: Colors.black),
|
||||||
@ -391,7 +391,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
|||||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||||
colorScheme: ColorScheme.light(
|
colorScheme: ColorScheme.light(
|
||||||
surface: midColor,
|
background: midColor,
|
||||||
tertiary: Colors.grey,
|
tertiary: Colors.grey,
|
||||||
secondary: Colors.grey,
|
secondary: Colors.grey,
|
||||||
primary: Colors.black),
|
primary: Colors.black),
|
||||||
@ -470,15 +470,15 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
|||||||
filled: true,
|
filled: true,
|
||||||
hintText: "enter cron command...",
|
hintText: "enter cron command...",
|
||||||
labelText: "cron",
|
labelText: "cron",
|
||||||
errorStyle: const TextStyle(height: 0),
|
errorStyle: TextStyle(height: 0),
|
||||||
hintStyle: const TextStyle(fontSize: 10),
|
hintStyle: TextStyle(fontSize: 10),
|
||||||
labelStyle: const TextStyle(fontSize: 10),
|
labelStyle: TextStyle(fontSize: 10),
|
||||||
focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: widget.errorCron != null ? Colors.red : Colors.black)),
|
focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: widget.errorCron != null ? Colors.red : Colors.black)),
|
||||||
errorBorder: OutlineInputBorder(borderSide: BorderSide(color: widget.errorCron != null ? Colors.red : Colors.black)),
|
errorBorder: OutlineInputBorder(borderSide: BorderSide(color: widget.errorCron != null ? Colors.red : Colors.black)),
|
||||||
focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: widget.errorCron != null ? Colors.red : Colors.black)),
|
focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: widget.errorCron != null ? Colors.red : Colors.black)),
|
||||||
enabledBorder: OutlineInputBorder(borderSide: BorderSide(color: widget.errorCron != null ? Colors.red : Colors.grey)),
|
enabledBorder: OutlineInputBorder(borderSide: BorderSide(color: widget.errorCron != null ? Colors.red : Colors.grey)),
|
||||||
border: OutlineInputBorder(borderSide: BorderSide(color: widget.errorCron != null ? Colors.red : Colors.grey)),
|
border: OutlineInputBorder(borderSide: BorderSide(color: widget.errorCron != null ? Colors.red : Colors.grey)),
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||||
),
|
),
|
||||||
))),
|
))),
|
||||||
Container(
|
Container(
|
||||||
|
@ -38,7 +38,7 @@ class StorageProcessingLinkFormsWidgetState extends State<StorageProcessingLinkF
|
|||||||
|
|
||||||
@override Widget build(BuildContext context) {
|
@override Widget build(BuildContext context) {
|
||||||
List<Widget> children = [
|
List<Widget> children = [
|
||||||
const Padding( padding: const EdgeInsets.only(top: 10),
|
Padding( padding: const EdgeInsets.only(top: 10),
|
||||||
child: Text("<ENV VARIABLES>",
|
child: Text("<ENV VARIABLES>",
|
||||||
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center)),
|
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center)),
|
||||||
];
|
];
|
||||||
@ -54,9 +54,9 @@ class StorageProcessingLinkFormsWidgetState extends State<StorageProcessingLinkF
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
for(var info in widget.item.infos) {
|
for(var info in widget.item.infos) {
|
||||||
count++;
|
count++;
|
||||||
inf.add(Padding( padding: const EdgeInsets.only(top: 10, bottom: 5),
|
inf.add(Padding( padding: EdgeInsets.only(top: 10, bottom: 5),
|
||||||
child : Row( crossAxisAlignment: CrossAxisAlignment.center, children: [
|
child : Row( crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||||
Padding(padding: const EdgeInsets.only(left: 10, right: 10), child: Text("N°$count")),
|
Padding(padding: EdgeInsets.only(left: 10, right: 10), child: Text("N°$count")),
|
||||||
Container(width: 140, decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))))
|
Container(width: 140, decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))))
|
||||||
])));
|
])));
|
||||||
for (var key in (info as Map<String, dynamic>).keys) {
|
for (var key in (info as Map<String, dynamic>).keys) {
|
||||||
@ -98,8 +98,9 @@ class StorageProcessingLinkFormsWidgetState extends State<StorageProcessingLinkF
|
|||||||
}
|
}
|
||||||
widget.dash.saveDash(widget.dash.id, context);
|
widget.dash.saveDash(widget.dash.id, context);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e, s) {
|
||||||
print(e);
|
print(e);
|
||||||
|
print(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, initialValue: "${info[key] ?? ""}", readOnly: false, noLabel: false));
|
}, initialValue: "${info[key] ?? ""}", readOnly: false, noLabel: false));
|
||||||
@ -125,7 +126,7 @@ class StorageProcessingLinkFormsWidgetState extends State<StorageProcessingLinkF
|
|||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),
|
||||||
border: Border.all(color: Colors.grey, width: 1)),
|
border: Border.all(color: Colors.grey, width: 1)),
|
||||||
width: 125, height: 30,
|
width: 125, height: 30,
|
||||||
child: const Row( mainAxisAlignment: MainAxisAlignment.center,
|
child: Row( mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [ Padding( padding: EdgeInsets.only(right: 5), child: Icon(Icons.add, color: Colors.black,)),
|
children: [ Padding( padding: EdgeInsets.only(right: 5), child: Icon(Icons.add, color: Colors.black,)),
|
||||||
Text("link infos",
|
Text("link infos",
|
||||||
style: TextStyle( color: Colors.black))]),
|
style: TextStyle( color: Colors.black))]),
|
||||||
|
@ -19,15 +19,13 @@ class SubExposeFormsWidget extends StatefulWidget {
|
|||||||
class SubExposeFormsWidgetState extends State<SubExposeFormsWidget> {
|
class SubExposeFormsWidgetState extends State<SubExposeFormsWidget> {
|
||||||
@override Widget build(BuildContext context) {
|
@override Widget build(BuildContext context) {
|
||||||
return Column( children : [
|
return Column( children : [
|
||||||
Container( margin: const EdgeInsets.only(left: 10, right: 10, top: 15),
|
Container( margin: const EdgeInsets.only(left: 10, right: 10, top: 5),
|
||||||
decoration: const BoxDecoration(border: Border( top: BorderSide(color: Colors.grey, width: 1))),
|
decoration: BoxDecoration(border: Border.all(color: Colors.grey, width: 1)),
|
||||||
width: 180
|
width: 180
|
||||||
),
|
),
|
||||||
SubTextInputWidget(subkey: "reference port", readOnly: widget.readOnly,
|
SubTextInputWidget(subkey: "reference port", readOnly: widget.readOnly,
|
||||||
initialValue: widget.item.port != null ? '${widget.item.port}' : null,
|
initialValue: widget.item.port != null ? '${widget.item.port}' : null,
|
||||||
width: 180,
|
width: widget.width, empty: widget.empty, change: (value) {
|
||||||
empty: widget.empty,
|
|
||||||
change: (value) {
|
|
||||||
try {
|
try {
|
||||||
widget.item.port = int.parse(value);
|
widget.item.port = int.parse(value);
|
||||||
Future.delayed(const Duration(seconds: 2), () {
|
Future.delayed(const Duration(seconds: 2), () {
|
||||||
|
@ -3,7 +3,6 @@ import 'package:oc_front/main.dart';
|
|||||||
import 'package:oc_front/models/response.dart';
|
import 'package:oc_front/models/response.dart';
|
||||||
import 'package:oc_front/pages/shared.dart';
|
import 'package:oc_front/pages/shared.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class ShallowDropdownInputWidget extends StatefulWidget {
|
class ShallowDropdownInputWidget extends StatefulWidget {
|
||||||
double? width;
|
double? width;
|
||||||
double? height;
|
double? height;
|
||||||
@ -31,10 +30,10 @@ class ShallowDropdownInputWidget extends StatefulWidget {
|
|||||||
|
|
||||||
bool deletion = false;
|
bool deletion = false;
|
||||||
|
|
||||||
ShallowDropdownInputWidget ({ super.key, this.width, this.current, required this.all, this.prefixIcon,
|
ShallowDropdownInputWidget ({ Key? key, this.width, this.current, required this.all, this.prefixIcon,
|
||||||
this.iconLoad, this.iconRemove, this.hint, this.filled, this.hintColor, this.color, this.height,
|
this.iconLoad, this.iconRemove, this.hint, this.filled, this.hintColor, this.color, this.height,
|
||||||
this.tooltipLoad, this.tooltipRemove, this.deletion = false, this.maptoDropdown, this.label,
|
this.tooltipLoad, this.tooltipRemove, this.deletion = false, this.maptoDropdown, this.label,
|
||||||
required this.type, this.canLoad, this.canRemove, this.load, this.remove, this.change });
|
required this.type, this.canLoad, this.canRemove, this.load, this.remove, this.change }): super(key: key);
|
||||||
@override ShallowDropdownInputWidgetState createState() => ShallowDropdownInputWidgetState();
|
@override ShallowDropdownInputWidgetState createState() => ShallowDropdownInputWidgetState();
|
||||||
}
|
}
|
||||||
class ShallowDropdownInputWidgetState extends State<ShallowDropdownInputWidget> {
|
class ShallowDropdownInputWidgetState extends State<ShallowDropdownInputWidget> {
|
||||||
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:oc_front/main.dart';
|
import 'package:oc_front/main.dart';
|
||||||
import 'package:oc_front/pages/shared.dart';
|
import 'package:oc_front/pages/shared.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class ShallowTextInputWidget extends StatefulWidget {
|
class ShallowTextInputWidget extends StatefulWidget {
|
||||||
double? width;
|
double? width;
|
||||||
CollaborativeAreaType type = CollaborativeAreaType.workspace;
|
CollaborativeAreaType type = CollaborativeAreaType.workspace;
|
||||||
@ -32,11 +31,11 @@ class ShallowTextInputWidget extends StatefulWidget {
|
|||||||
|
|
||||||
String? attr;
|
String? attr;
|
||||||
|
|
||||||
ShallowTextInputWidget ({ super.key, this.width, this.current, this.attr, this.readOnly = false, this.alignment = MainAxisAlignment.start,
|
ShallowTextInputWidget ({ Key? key, this.width, this.current, this.attr, this.readOnly = false, this.alignment = MainAxisAlignment.start,
|
||||||
this.iconLoad, this.iconRemove, this.hint, this.forms = const [], this.loadStr,
|
this.iconLoad, this.iconRemove, this.hint, this.forms = const [], this.loadStr,
|
||||||
this.tooltipLoad = "", this.tooltipRemove = "",
|
this.tooltipLoad = "", this.tooltipRemove = "",
|
||||||
this.filled, this.hintColor, this.color,
|
this.filled, this.hintColor, this.color,
|
||||||
required this.type, this.canLoad, this.canRemove, this.load, this.remove, this.change });
|
required this.type, this.canLoad, this.canRemove, this.load, this.remove, this.change }): super(key: key);
|
||||||
@override ShallowTextInputWidgetState createState() => ShallowTextInputWidgetState();
|
@override ShallowTextInputWidgetState createState() => ShallowTextInputWidgetState();
|
||||||
|
|
||||||
Map<String, dynamic> serialize() {
|
Map<String, dynamic> serialize() {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class SubDropdownInputWidget extends StatefulWidget {
|
class SubDropdownInputWidget extends StatefulWidget {
|
||||||
String subkey;
|
String subkey;
|
||||||
double width;
|
double width;
|
||||||
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:oc_front/widgets/dialog/alert.dart';
|
import 'package:oc_front/widgets/dialog/alert.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class SubTextInputWidget extends StatefulWidget {
|
class SubTextInputWidget extends StatefulWidget {
|
||||||
String subkey;
|
String subkey;
|
||||||
String? initialValue;
|
String? initialValue;
|
||||||
@ -13,9 +12,10 @@ class SubTextInputWidget extends StatefulWidget {
|
|||||||
bool readOnly = false;
|
bool readOnly = false;
|
||||||
bool copyLabel = false;
|
bool copyLabel = false;
|
||||||
void Function(String) change = (value) {};
|
void Function(String) change = (value) {};
|
||||||
SubTextInputWidget ({ super.key,
|
SubTextInputWidget ({ Key? key,
|
||||||
required this.subkey, this.readOnly = false, this.noLabel = false, this.copyLabel = false,
|
required this.subkey, this.readOnly = false, this.noLabel = false, this.copyLabel = false,
|
||||||
this.initialValue, required this.width, required this.empty, required this.change });
|
this.initialValue, required this.width, required this.empty, required this.change }):
|
||||||
|
super(key: key);
|
||||||
@override SubTextInputWidgetState createState() => SubTextInputWidgetState();
|
@override SubTextInputWidgetState createState() => SubTextInputWidgetState();
|
||||||
}
|
}
|
||||||
class SubTextInputWidgetState extends State<SubTextInputWidget> {
|
class SubTextInputWidgetState extends State<SubTextInputWidget> {
|
||||||
@ -24,13 +24,12 @@ class SubTextInputWidgetState extends State<SubTextInputWidget> {
|
|||||||
if (widget.readOnly && widget.initialValue == null) {
|
if (widget.readOnly && widget.initialValue == null) {
|
||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
TextEditingController ctrl = TextEditingController(text: widget.initialValue);
|
|
||||||
return Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Tooltip( message: widget.subkey,
|
return Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Tooltip( message: widget.subkey,
|
||||||
child: Container( margin: EdgeInsets.only(top: widget.empty ? 0 : 15),
|
child: Container( margin: EdgeInsets.only(top: widget.empty ? 0 : 15),
|
||||||
width: widget.width - (widget.readOnly ? 40 : 0), height: 30,
|
width: widget.width - (widget.readOnly ? 40 : 0), height: 30,
|
||||||
child: TextFormField( textAlign: TextAlign.start,
|
child: TextFormField( textAlign: TextAlign.start,
|
||||||
enabled: !widget.readOnly,
|
enabled: !widget.readOnly,
|
||||||
controller: ctrl,
|
initialValue: widget.initialValue,
|
||||||
onChanged: widget.change,
|
onChanged: widget.change,
|
||||||
style: const TextStyle(fontSize: 12),
|
style: const TextStyle(fontSize: 12),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
@ -4,6 +4,7 @@ import 'package:oc_front/models/resources/resources.dart';
|
|||||||
import 'package:oc_front/models/response.dart';
|
import 'package:oc_front/models/response.dart';
|
||||||
import 'package:oc_front/pages/shared.dart';
|
import 'package:oc_front/pages/shared.dart';
|
||||||
import 'package:oc_front/widgets/inputs/shallow_dropdown_input.dart';
|
import 'package:oc_front/widgets/inputs/shallow_dropdown_input.dart';
|
||||||
|
import 'package:oc_front/widgets/inputs/sub_dropdown_input%20.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class ItemWidget extends StatefulWidget {
|
class ItemWidget extends StatefulWidget {
|
||||||
@ -14,26 +15,25 @@ class ItemWidget extends StatefulWidget {
|
|||||||
class ItemWidgetState extends State<ItemWidget> {
|
class ItemWidgetState extends State<ItemWidget> {
|
||||||
@override Widget build(BuildContext context) {
|
@override Widget build(BuildContext context) {
|
||||||
List<Widget> widgets = [
|
List<Widget> widgets = [
|
||||||
Container( margin: const EdgeInsets.only(bottom: 20),
|
Container( margin: EdgeInsets.only(bottom: 20),
|
||||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: midColor))),
|
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: midColor))),
|
||||||
width: getMainWidth(context) / 2,
|
width: getMainWidth(context) / 2,
|
||||||
child: const Center(child: Padding( padding: EdgeInsets.only(bottom: 20),
|
child: Center(child: Padding( padding: EdgeInsets.only(bottom: 20),
|
||||||
child: Text("RESOURCE INFORMATIONS", style: TextStyle(fontSize: 18, color: Colors.grey, fontWeight: FontWeight.w500)))))
|
child: Text("RESOURCE INFORMATIONS", style: TextStyle(fontSize: 18, color: Colors.grey, fontWeight: FontWeight.w500)))))
|
||||||
];
|
];
|
||||||
var infos = widget.item.infos();
|
var infos = widget.item.infos();
|
||||||
var count = 0;
|
var count = 0;
|
||||||
for (var info in infos.keys) {
|
for (var info in infos.keys) {
|
||||||
count++;
|
count++;
|
||||||
widgets.add(Padding( padding: const EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
widgets.add(Padding( padding: EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
||||||
Padding( padding: const EdgeInsets.only(left: 50, right: 10), child : Text("${info.toUpperCase().replaceAll("_", " ")} :",
|
Padding( padding: EdgeInsets.only(left: 50, right: 10), child : Text("${info.toUpperCase().replaceAll("_", " ")} :", style: TextStyle(fontSize: 15, color: Colors.grey))),
|
||||||
style: const TextStyle(fontSize: 15, color: Colors.grey))),
|
|
||||||
Text("${infos[info] is bool ? (infos[info] == true ? "yes" : "no") : infos[info] ?? "unknown"}",
|
Text("${infos[info] is bool ? (infos[info] == true ? "yes" : "no") : infos[info] ?? "unknown"}",
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontSize: 15, color: Colors.black, fontWeight: FontWeight.w500))
|
style: TextStyle(fontSize: 15, color: Colors.black, fontWeight: FontWeight.w500))
|
||||||
])));
|
])));
|
||||||
}
|
}
|
||||||
if (count == 0 ) {
|
if (count == 0 ) {
|
||||||
widgets.add(const Center(child: Padding( padding: EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
widgets.add(Center(child: Padding( padding: EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
||||||
Padding( padding: EdgeInsets.only(left: 50, right: 10), child : Text("NO INFORMATION", style: TextStyle(fontSize: 15, color: Colors.grey))),
|
Padding( padding: EdgeInsets.only(left: 50, right: 10), child : Text("NO INFORMATION", style: TextStyle(fontSize: 15, color: Colors.grey))),
|
||||||
]))));
|
]))));
|
||||||
}
|
}
|
||||||
@ -43,7 +43,7 @@ class ItemWidgetState extends State<ItemWidget> {
|
|||||||
dpItems.add(Shallow(id: "$i", name: instance.name ?? ""));
|
dpItems.add(Shallow(id: "$i", name: instance.name ?? ""));
|
||||||
}
|
}
|
||||||
if (dpItems.isNotEmpty) {
|
if (dpItems.isNotEmpty) {
|
||||||
widgetsInstance.add(Center( child: Padding(padding: const EdgeInsets.only(bottom: 15), child:
|
widgetsInstance.add(Center( child: Padding(padding: EdgeInsets.only(bottom: 15), child:
|
||||||
ShallowDropdownInputWidget( all: () async => dpItems, width: (getWidth(context) / 2) - 25,
|
ShallowDropdownInputWidget( all: () async => dpItems, width: (getWidth(context) / 2) - 25,
|
||||||
label: "instances", type: CollaborativeAreaType.resource, height: 65,
|
label: "instances", type: CollaborativeAreaType.resource, height: 65,
|
||||||
current: "${widget.item.selectedInstance}", change: (value) {
|
current: "${widget.item.selectedInstance}", change: (value) {
|
||||||
@ -54,27 +54,21 @@ class ItemWidgetState extends State<ItemWidget> {
|
|||||||
}
|
}
|
||||||
if (widget.item.instances.length > widget.item.selectedInstance) {
|
if (widget.item.instances.length > widget.item.selectedInstance) {
|
||||||
var instance = widget.item.instances[widget.item.selectedInstance];
|
var instance = widget.item.instances[widget.item.selectedInstance];
|
||||||
widgetsInstance.add(SizedBox(height: 20, width: getWidth(context) / 2,));
|
widgetsInstance.add(Container(height: 20, width: getWidth(context) / 2,));
|
||||||
var count = 0;
|
var count = 0;
|
||||||
for (var info in instance.infos().keys) {
|
for (var info in instance.infos().keys) {
|
||||||
if (instance.infos()[info] == null || instance.infos()[info] is List || instance.infos()[info] is Map) { continue; }
|
if (instance.infos()[info] == null || instance.infos()[info] is List || instance.infos()[info] is Map) { continue; }
|
||||||
count++;
|
count++;
|
||||||
widgetsInstance.add(Center(child: Padding( padding: const EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
widgetsInstance.add(Center(child: Padding( padding: EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
||||||
Padding( padding: const EdgeInsets.only(left: 50, right: 10),
|
Padding( padding: EdgeInsets.only(left: 50, right: 10), child : Text("${info.toUpperCase().replaceAll("_", " ")} :", style: TextStyle(fontSize: 15, color: Colors.grey))),
|
||||||
child : Text("${info.toUpperCase().replaceAll("_", " ")} :",
|
|
||||||
style: const TextStyle(fontSize: 15, color: Colors.grey))),
|
|
||||||
Text("${instance.infos()[info] is bool ? (instance.infos()[info] == true ? "yes" : "no") : instance.infos()[info] ?? "unknown"}",
|
Text("${instance.infos()[info] is bool ? (instance.infos()[info] == true ? "yes" : "no") : instance.infos()[info] ?? "unknown"}",
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontSize: 15, color: Colors.black, fontWeight: FontWeight.w500))
|
style: TextStyle(fontSize: 15, color: Colors.black, fontWeight: FontWeight.w500))
|
||||||
]))));
|
]))));
|
||||||
}
|
}
|
||||||
if (count == 0 ) {
|
if (count == 0 ) {
|
||||||
widgetsInstance.add(const Padding(
|
widgetsInstance.add(Padding( padding: EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
||||||
padding: EdgeInsets.symmetric(vertical: 5),
|
Padding( padding: EdgeInsets.only(left: 50, right: 10), child : Text("NO INSTANCE INFORMATION", style: TextStyle(fontSize: 15, color: Colors.grey))),
|
||||||
child : Row(children: [
|
|
||||||
Padding( padding: EdgeInsets.only(left: 50, right: 10),
|
|
||||||
child : Text("NO INSTANCE INFORMATION",
|
|
||||||
style: TextStyle(fontSize: 15, color: Colors.grey))),
|
|
||||||
])));
|
])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,7 +87,7 @@ class ItemWidgetState extends State<ItemWidget> {
|
|||||||
border: Border(bottom: BorderSide(color: midColor))),
|
border: Border(bottom: BorderSide(color: midColor))),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 50),
|
padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 50),
|
||||||
child: Text(widget.item.description!.length > 350 ? "${widget.item.description!.substring(0, 347)}..." : widget.item.description!,
|
child: Text(widget.item.description!.length > 350 ? "${widget.item.description!.substring(0, 347)}..." : widget.item.description!,
|
||||||
style: const TextStyle(fontSize: 15, color: Colors.grey, fontWeight: FontWeight.w500))),
|
style: TextStyle(fontSize: 15, color: Colors.grey, fontWeight: FontWeight.w500))),
|
||||||
Row( children: [
|
Row( children: [
|
||||||
Container(padding: const EdgeInsets.symmetric(vertical: 20),
|
Container(padding: const EdgeInsets.symmetric(vertical: 20),
|
||||||
height: getHeight(context) - 300,
|
height: getHeight(context) - 300,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
|
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
|
||||||
import 'package:oc_front/main.dart';
|
import 'package:oc_front/main.dart';
|
||||||
@ -41,7 +43,7 @@ class ShallowItemRowWidgetState extends State<ShallowItemRowWidget> {
|
|||||||
child: Row( children: [
|
child: Row( children: [
|
||||||
Padding( padding: const EdgeInsets.only(right: 5),
|
Padding( padding: const EdgeInsets.only(right: 5),
|
||||||
child: widget.edit == null ? Container() : InkWell( mouseCursor: SystemMouseCursors.click,
|
child: widget.edit == null ? Container() : InkWell( mouseCursor: SystemMouseCursors.click,
|
||||||
onTap: () => widget.edit!( "${widget.item.getID()}~${widget.item.getName()}"), child: const Icon(Icons.edit, color: Colors.grey,))),
|
onTap: () => widget.edit!(widget.item.getID() + "~" + widget.item.getName()), child: const Icon(Icons.edit, color: Colors.grey,))),
|
||||||
Padding( padding: const EdgeInsets.only(right: 5),
|
Padding( padding: const EdgeInsets.only(right: 5),
|
||||||
child: widget.delete == null ? Container() : InkWell( mouseCursor: SystemMouseCursors.click,
|
child: widget.delete == null ? Container() : InkWell( mouseCursor: SystemMouseCursors.click,
|
||||||
onTap: () => widget.delete!(widget.item.getID()), child: const Icon(Icons.delete, color: Colors.grey,))),
|
onTap: () => widget.delete!(widget.item.getID()), child: const Icon(Icons.delete, color: Colors.grey,))),
|
||||||
@ -50,19 +52,21 @@ class ShallowItemRowWidgetState extends State<ShallowItemRowWidget> {
|
|||||||
Column( children: [
|
Column( children: [
|
||||||
widget.low || widget.icon == null ? Container( padding: const EdgeInsets.only(left: 10),) : Container( padding: const EdgeInsets.all(10),
|
widget.low || widget.icon == null ? Container( padding: const EdgeInsets.only(left: 10),) : Container( padding: const EdgeInsets.all(10),
|
||||||
constraints: BoxConstraints(maxWidth: widget.contextWidth, minWidth: widget.contextWidth),
|
constraints: BoxConstraints(maxWidth: widget.contextWidth, minWidth: widget.contextWidth),
|
||||||
child: Icon( widget.icon!, size: widget.contextWidth / 1.9, color: const Color(0xfff67c0b9),)),
|
child: Icon( widget.icon!, size: widget.contextWidth / 1.9, color: const Color(0xFFF67C0B9),)),
|
||||||
Padding(padding: widget.contextWidth != getMainWidth(context) ?
|
Container(
|
||||||
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
child: Padding(padding: widget.contextWidth != getMainWidth(context) ?
|
||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
|
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
||||||
mainAxisAlignment: MainAxisAlignment.center, children: [
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Row( children: [
|
mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Expanded( child: Center( child: Text(widget.item.getName().toUpperCase(),
|
Row( children: [
|
||||||
style: const TextStyle(fontSize: 15,
|
Expanded( child: Center( child: Text(widget.item.getName().toUpperCase(),
|
||||||
overflow: TextOverflow.ellipsis,
|
style: const TextStyle(fontSize: 15,
|
||||||
fontWeight: FontWeight.w600, color: Colors.grey)),
|
overflow: TextOverflow.ellipsis,
|
||||||
))
|
fontWeight: FontWeight.w600, color: Colors.grey)),
|
||||||
]),
|
))
|
||||||
],)
|
]),
|
||||||
|
],)
|
||||||
|
)
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
]))));
|
]))));
|
||||||
@ -72,7 +76,6 @@ class ShallowItemRowWidgetState extends State<ShallowItemRowWidget> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class ShallowItemFlowDataRowWidget extends StatefulWidget {
|
class ShallowItemFlowDataRowWidget extends StatefulWidget {
|
||||||
bool readOnly = false;
|
bool readOnly = false;
|
||||||
double contextWidth = 0;
|
double contextWidth = 0;
|
||||||
@ -111,7 +114,7 @@ class ShallowItemFlowDataRowWidgetState extends State<ShallowItemFlowDataRowWidg
|
|||||||
child: Row( children: [
|
child: Row( children: [
|
||||||
Padding( padding: const EdgeInsets.only(right: 5),
|
Padding( padding: const EdgeInsets.only(right: 5),
|
||||||
child: widget.edit == null ? Container() : InkWell( mouseCursor: SystemMouseCursors.click,
|
child: widget.edit == null ? Container() : InkWell( mouseCursor: SystemMouseCursors.click,
|
||||||
onTap: () => widget.edit!("${widget.item.getID()}~${widget.item.getName()}"), child: const Icon(Icons.edit, color: Colors.grey,))),
|
onTap: () => widget.edit!(widget.item.getID() + "~" + widget.item.getName()), child: const Icon(Icons.edit, color: Colors.grey,))),
|
||||||
Padding( padding: const EdgeInsets.only(right: 5),
|
Padding( padding: const EdgeInsets.only(right: 5),
|
||||||
child: widget.delete == null ? Container() : InkWell( mouseCursor: SystemMouseCursors.click,
|
child: widget.delete == null ? Container() : InkWell( mouseCursor: SystemMouseCursors.click,
|
||||||
onTap: () => widget.delete!(widget.item.getID()), child: const Icon(Icons.delete, color: Colors.grey,))),
|
onTap: () => widget.delete!(widget.item.getID()), child: const Icon(Icons.delete, color: Colors.grey,))),
|
||||||
@ -123,19 +126,21 @@ class ShallowItemFlowDataRowWidgetState extends State<ShallowItemFlowDataRowWidg
|
|||||||
Column( children: [
|
Column( children: [
|
||||||
widget.low || widget.icon == null ? Container( padding: const EdgeInsets.only(left: 10),) : Container( padding: const EdgeInsets.all(10),
|
widget.low || widget.icon == null ? Container( padding: const EdgeInsets.only(left: 10),) : Container( padding: const EdgeInsets.all(10),
|
||||||
constraints: BoxConstraints(maxWidth: widget.contextWidth, minWidth: widget.contextWidth),
|
constraints: BoxConstraints(maxWidth: widget.contextWidth, minWidth: widget.contextWidth),
|
||||||
child: Icon( widget.icon!, size: widget.contextWidth / 1.9, color: const Color(0xfff67c0b9),)),
|
child: Icon( widget.icon!, size: widget.contextWidth / 1.9, color: const Color(0xFFF67C0B9),)),
|
||||||
Padding(padding: widget.contextWidth != getMainWidth(context) ?
|
Container(
|
||||||
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
child: Padding(padding: widget.contextWidth != getMainWidth(context) ?
|
||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
|
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
||||||
mainAxisAlignment: MainAxisAlignment.center, children: [
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Row( children: [
|
mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Expanded( child: Center( child: Text(widget.item.getName().toUpperCase(),
|
Row( children: [
|
||||||
style: const TextStyle(fontSize: 15,
|
Expanded( child: Center( child: Text(widget.item.getName().toUpperCase(),
|
||||||
overflow: TextOverflow.ellipsis,
|
style: const TextStyle(fontSize: 15,
|
||||||
fontWeight: FontWeight.w600, color: Colors.grey)),
|
overflow: TextOverflow.ellipsis,
|
||||||
))
|
fontWeight: FontWeight.w600, color: Colors.grey)),
|
||||||
]),
|
))
|
||||||
],)
|
]),
|
||||||
|
],)
|
||||||
|
)
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
]))));
|
]))));
|
||||||
|
@ -10,13 +10,12 @@ import 'package:oc_front/core/services/specialized_services/logs_service.dart';
|
|||||||
|
|
||||||
bool isLoading = true;
|
bool isLoading = true;
|
||||||
Map<String, bool> valid = {};
|
Map<String, bool> valid = {};
|
||||||
// ignore: must_be_immutable
|
|
||||||
class LogsWidget extends StatefulWidget {
|
class LogsWidget extends StatefulWidget {
|
||||||
String? level;
|
String? level;
|
||||||
String search = "";
|
String search = "";
|
||||||
WorkflowExecution? exec;
|
WorkflowExecution? exec;
|
||||||
List<Log> logs = [];
|
List<Log> logs = [];
|
||||||
LogsWidget ({ super.key, this.search = "", this.level, this.exec });
|
LogsWidget ({ Key? key, this.search = "", this.level, this.exec }): super(key: key);
|
||||||
@override LogsWidgetState createState() => LogsWidgetState();
|
@override LogsWidgetState createState() => LogsWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,12 +73,12 @@ class LogsWidgetState extends State<LogsWidget> {
|
|||||||
List<LogWidget> itemRows = logs.where((element) => (element.message?.toLowerCase().contains(widget.search.toLowerCase()) ?? true)
|
List<LogWidget> itemRows = logs.where((element) => (element.message?.toLowerCase().contains(widget.search.toLowerCase()) ?? true)
|
||||||
&& (widget.level?.contains(element.level ?? "") ?? true) ).map((e) => LogWidget(item: e)).toList();
|
&& (widget.level?.contains(element.level ?? "") ?? true) ).map((e) => LogWidget(item: e)).toList();
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return SizedBox( height: getMainHeight(context) - 100,
|
return Container( height: getMainHeight(context) - 100,
|
||||||
child: const Center( child: CircularProgressIndicator()) );
|
child: Center( child: CircularProgressIndicator()) );
|
||||||
}
|
}
|
||||||
return Stack( children: [
|
return Stack( children: [
|
||||||
SingleChildScrollView( child: itemRows.isEmpty ?
|
SingleChildScrollView( child: itemRows.isEmpty ?
|
||||||
SizedBox( height: getMainHeight(context) - 100,
|
Container( height: getMainHeight(context) - 100,
|
||||||
child: const Center( child: Text("no log registered", style: TextStyle(color: Colors.grey, fontSize: 25 ),)))
|
child: const Center( child: Text("no log registered", style: TextStyle(color: Colors.grey, fontSize: 25 ),)))
|
||||||
: Column( children: [...itemRows, Container(height: 50,) ] ) ),
|
: Column( children: [...itemRows, Container(height: 50,) ] ) ),
|
||||||
]);
|
]);
|
||||||
@ -89,11 +88,10 @@ class LogsWidgetState extends State<LogsWidget> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class LogWidget extends StatefulWidget {
|
class LogWidget extends StatefulWidget {
|
||||||
final Log item;
|
final Log item;
|
||||||
bool expanded = false;
|
bool expanded = false;
|
||||||
LogWidget ({ super.key, required this.item });
|
LogWidget ({ Key? key, required this.item }): super(key: key);
|
||||||
@override LogWidgetState createState() => LogWidgetState();
|
@override LogWidgetState createState() => LogWidgetState();
|
||||||
}
|
}
|
||||||
class LogWidgetState extends State<LogWidget> {
|
class LogWidgetState extends State<LogWidget> {
|
||||||
|
@ -44,6 +44,7 @@ class ScheduleWidgetState extends State<ScheduleWidget> {
|
|||||||
"${widget.end.year}-${widget.end.month > 9 ? widget.end.month : "0${widget.end.month}"}-${widget.end.day > 9 ? widget.end.day : "0${widget.end.day}"}"], {}),
|
"${widget.end.year}-${widget.end.month > 9 ? widget.end.month : "0${widget.end.month}"}-${widget.end.day > 9 ? widget.end.day : "0${widget.end.day}"}"], {}),
|
||||||
builder: (ctx, as) {
|
builder: (ctx, as) {
|
||||||
Map<String, List<WorkflowExecution>> data = {};
|
Map<String, List<WorkflowExecution>> data = {};
|
||||||
|
DateTime? firstDate;
|
||||||
if (as.hasData && as.data!.data != null) {
|
if (as.hasData && as.data!.data != null) {
|
||||||
for (var element in as.data!.data!.executions) {
|
for (var element in as.data!.data!.executions) {
|
||||||
if (element.startDate == null) { continue; }
|
if (element.startDate == null) { continue; }
|
||||||
@ -210,11 +211,11 @@ class ScheduleWidgetState extends State<ScheduleWidget> {
|
|||||||
borderSide: BorderSide(color: midColor, width: 0)),
|
borderSide: BorderSide(color: midColor, width: 0)),
|
||||||
),
|
),
|
||||||
items: [
|
items: [
|
||||||
DropdownMenuItem(value: "debug,warning,error,info", child: Row( children: [ Container( width: 10, height: 15, color: Colors.grey), const Text(" all", style: TextStyle(fontSize: 12, color: Colors.black)) ])),
|
DropdownMenuItem(value: "debug,warning,error,info", child: Row( children: [ Container( width: 10, height: 15, color: Colors.grey), Text(" all", style: TextStyle(fontSize: 12, color: Colors.black)) ])),
|
||||||
DropdownMenuItem(value: "debug", child: Row( children: [ Container( width: 10, height: 15, color: Colors.blue), const Text(" debug", style: TextStyle(fontSize: 12, color: Colors.black)) ])),
|
DropdownMenuItem(value: "debug", child: Row( children: [ Container( width: 10, height: 15, color: Colors.blue), Text(" debug", style: TextStyle(fontSize: 12, color: Colors.black)) ])),
|
||||||
DropdownMenuItem(value: "warning", child: Row( children: [ Container( width: 10, height: 15, color: Colors.orange), const Text(" warning", style: TextStyle(fontSize: 12, color: Colors.black)) ])),
|
DropdownMenuItem(value: "warning", child: Row( children: [ Container( width: 10, height: 15, color: Colors.orange), Text(" warning", style: TextStyle(fontSize: 12, color: Colors.black)) ])),
|
||||||
DropdownMenuItem(value: "error", child: Row( children: [ Container( width: 10, height: 15, color: redColor), const Text(" error", style: TextStyle(fontSize: 12, color: Colors.black)) ])),
|
DropdownMenuItem(value: "error", child: Row( children: [ Container( width: 10, height: 15, color: redColor), Text(" error", style: TextStyle(fontSize: 12, color: Colors.black)) ])),
|
||||||
DropdownMenuItem(value: "info", child: Row( children: [ Container( width: 10, height: 15, color: Colors.green), const Text(" info", style: TextStyle(fontSize: 12, color: Colors.black)) ])),
|
DropdownMenuItem(value: "info", child: Row( children: [ Container( width: 10, height: 15, color: Colors.green), Text(" info", style: TextStyle(fontSize: 12, color: Colors.black)) ])),
|
||||||
],
|
],
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:oc_front/core/sections/header/header.dart';
|
||||||
import 'package:oc_front/main.dart';
|
import 'package:oc_front/main.dart';
|
||||||
import 'package:oc_front/models/workflow.dart';
|
import 'package:oc_front/models/workflow.dart';
|
||||||
import 'package:oc_front/widgets/sheduler_items/schedule.dart';
|
import 'package:oc_front/widgets/sheduler_items/schedule.dart';
|
||||||
|
@ -371,7 +371,7 @@ class Dashboard extends ChangeNotifier {
|
|||||||
bool noHistory = false;
|
bool noHistory = false;
|
||||||
void addToHistory() {
|
void addToHistory() {
|
||||||
if (noHistory) {
|
if (noHistory) {
|
||||||
Future.delayed(const Duration(seconds: 2), () {
|
Future.delayed(Duration(seconds: 2), () {
|
||||||
noHistory = false;
|
noHistory = false;
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -379,7 +379,7 @@ class Dashboard extends ChangeNotifier {
|
|||||||
if (tempHistory.length >= 50) { tempHistory.removeAt(0); }
|
if (tempHistory.length >= 50) { tempHistory.removeAt(0); }
|
||||||
tempHistory.add(toMap());
|
tempHistory.add(toMap());
|
||||||
history = tempHistory.map((e) => e).toList();
|
history = tempHistory.map((e) => e).toList();
|
||||||
Future.delayed(const Duration(seconds: 1), () {
|
Future.delayed(Duration(seconds: 1), () {
|
||||||
chartMenuKey.currentState?.setState(() { });
|
chartMenuKey.currentState?.setState(() { });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,6 @@ abstract class FlowData {
|
|||||||
FlowData deserialize(Map<String, dynamic> data);
|
FlowData deserialize(Map<String, dynamic> data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class FlowChart<T extends FlowData> extends StatefulWidget {
|
class FlowChart<T extends FlowData> extends StatefulWidget {
|
||||||
FlowChart({
|
FlowChart({
|
||||||
required this.dashboard,
|
required this.dashboard,
|
||||||
@ -61,7 +60,7 @@ class FlowChart<T extends FlowData> extends StatefulWidget {
|
|||||||
this.menuExtension,
|
this.menuExtension,
|
||||||
this.itemLeftBottomBadges,
|
this.itemLeftBottomBadges,
|
||||||
this.itemrightTopBadges,
|
this.itemrightTopBadges,
|
||||||
});
|
}) {}
|
||||||
final String? current;
|
final String? current;
|
||||||
final List<String> categories;
|
final List<String> categories;
|
||||||
final double width;
|
final double width;
|
||||||
@ -171,7 +170,7 @@ class FlowChart<T extends FlowData> extends StatefulWidget {
|
|||||||
|
|
||||||
/// Trigger for the scale change
|
/// Trigger for the scale change
|
||||||
final void Function(double scale)? onScaleUpdate;
|
final void Function(double scale)? onScaleUpdate;
|
||||||
bool dashboardSelected = true;
|
|
||||||
@override
|
@override
|
||||||
State<FlowChart> createState() => FlowChartState<T>();
|
State<FlowChart> createState() => FlowChartState<T>();
|
||||||
}
|
}
|
||||||
@ -183,7 +182,6 @@ class HoverMenuController {
|
|||||||
currentState?.hideSubMenu();
|
currentState?.hideSubMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ignore: must_be_immutable
|
|
||||||
class HoverMenu extends StatefulWidget {
|
class HoverMenu extends StatefulWidget {
|
||||||
final Widget title;
|
final Widget title;
|
||||||
final double? width;
|
final double? width;
|
||||||
@ -193,12 +191,12 @@ class HoverMenu extends StatefulWidget {
|
|||||||
|
|
||||||
|
|
||||||
HoverMenu({
|
HoverMenu({
|
||||||
super.key,
|
Key? key,
|
||||||
required this.title,
|
required this.title,
|
||||||
this.items = const [],
|
this.items = const [],
|
||||||
this.width,
|
this.width,
|
||||||
this.controller,
|
this.controller,
|
||||||
});
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
HoverMenuState createState() => HoverMenuState();
|
HoverMenuState createState() => HoverMenuState();
|
||||||
@ -326,7 +324,6 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
|||||||
widget.dashboard.inDialog = true;
|
widget.dashboard.inDialog = true;
|
||||||
showDialog(
|
showDialog(
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
// ignore: use_build_context_synchronously
|
|
||||||
context: context, builder: (context) {
|
context: context, builder: (context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
titlePadding: EdgeInsets.zero,
|
titlePadding: EdgeInsets.zero,
|
||||||
@ -367,63 +364,63 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
|||||||
autofocus: true,
|
autofocus: true,
|
||||||
onKeyEvent: (event) {
|
onKeyEvent: (event) {
|
||||||
bool change = false;
|
bool change = false;
|
||||||
if (widget.dashboardSelected) {
|
if (event.logicalKey == LogicalKeyboardKey.controlLeft && event is KeyDownEvent) {
|
||||||
if (event.logicalKey == LogicalKeyboardKey.controlLeft && event is KeyDownEvent) {
|
print("CTRL true");
|
||||||
isCtrl = true;
|
isCtrl = true;
|
||||||
}
|
}
|
||||||
if (event.logicalKey == LogicalKeyboardKey.controlLeft && event is KeyUpEvent) {
|
if (event.logicalKey == LogicalKeyboardKey.controlLeft && event is KeyUpEvent) {
|
||||||
isCtrl = false;
|
print("CTRL false");
|
||||||
}
|
isCtrl = false;
|
||||||
if ((event is KeyDownEvent || event.logicalKey == LogicalKeyboardKey.keyZ) && isCtrl) {
|
}
|
||||||
widget.dashboard.back();
|
if ((event is KeyDownEvent || event.logicalKey == LogicalKeyboardKey.keyZ) && isCtrl) {
|
||||||
}
|
widget.dashboard.back();
|
||||||
if ((event is KeyDownEvent || event.logicalKey == LogicalKeyboardKey.keyY) && isCtrl) {
|
}
|
||||||
widget.dashboard.forward();
|
if ((event is KeyDownEvent || event.logicalKey == LogicalKeyboardKey.keyY) && isCtrl) {
|
||||||
}
|
widget.dashboard.forward();
|
||||||
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.add) {
|
}
|
||||||
change = true;
|
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.add) {
|
||||||
for (var el in widget.dashboard.elementSelected) {
|
change = true;
|
||||||
widget.dashboard.addElement(FlowElement<T>(
|
for (var el in widget.dashboard.elementSelected) {
|
||||||
element: el.element as T,
|
widget.dashboard.addElement(FlowElement<T>(
|
||||||
dashboard: widget.dashboard,
|
element: el.element as T,
|
||||||
id: const Uuid().v4(),
|
dashboard: widget.dashboard,
|
||||||
position: el.position + const Offset(100, 100),
|
id: const Uuid().v4(),
|
||||||
size: el.size,
|
position: el.position + const Offset(100, 100),
|
||||||
text: el.text,
|
size: el.size,
|
||||||
widget: el.widget,
|
text: el.text,
|
||||||
kind: el.kind,
|
widget: el.widget,
|
||||||
handlers: el.handlers,
|
kind: el.kind,
|
||||||
handlerSize: el.handlerSize,
|
handlers: el.handlers,
|
||||||
), context);
|
handlerSize: el.handlerSize,
|
||||||
|
), context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.delete) {
|
||||||
|
change = true;
|
||||||
|
widget.dashboard.removeElements((element) {
|
||||||
|
if (element.isSelected) {
|
||||||
|
widget.dashboard.arrows.removeWhere( (e) => e.toID.contains(element.id) || e.fromID.contains(element.id));
|
||||||
|
}
|
||||||
|
return element.isSelected;
|
||||||
|
}, context);
|
||||||
|
for (var arrow in widget.dashboard.arrowsSelected) {
|
||||||
|
for (var el in widget.dashboard.elements.where((element) => element.id == arrow.fromID.split("_")[0])) {
|
||||||
|
el.next.removeAt(int.parse(arrow.fromID.split("_")[1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.delete) {
|
widget.dashboard.removeArrows( (el) => el.isSelected, context );
|
||||||
change = true;
|
}
|
||||||
widget.dashboard.removeElements((element) {
|
if (change) {
|
||||||
if (element.isSelected) {
|
DrawingArrow.instance.notifyListeners();
|
||||||
widget.dashboard.arrows.removeWhere( (e) => e.toID.contains(element.id) || e.fromID.contains(element.id));
|
widget.dashboard.chartKey.currentState?.setState(() { });
|
||||||
}
|
node.requestFocus();
|
||||||
return element.isSelected;
|
|
||||||
}, context);
|
|
||||||
for (var arrow in widget.dashboard.arrowsSelected) {
|
|
||||||
for (var el in widget.dashboard.elements.where((element) => element.id == arrow.fromID.split("_")[0])) {
|
|
||||||
el.next.removeAt(int.parse(arrow.fromID.split("_")[1]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
widget.dashboard.removeArrows( (el) => el.isSelected, context );
|
|
||||||
}
|
|
||||||
if (change) {
|
|
||||||
DrawingArrow.instance.notifyListeners();
|
|
||||||
widget.dashboard.chartKey.currentState?.setState(() { });
|
|
||||||
node.requestFocus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: ClipRect(
|
child: ClipRect(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
Stack(children: [
|
Stack(children: [
|
||||||
// Draw the grid
|
// Draw the grid
|
||||||
DragTarget<T>(
|
DragTarget<T>(
|
||||||
builder: (
|
builder: (
|
||||||
@ -431,15 +428,7 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
|||||||
List<dynamic> accepted,
|
List<dynamic> accepted,
|
||||||
List<dynamic> rejected,
|
List<dynamic> rejected,
|
||||||
) {
|
) {
|
||||||
return MouseRegion(
|
return SizedBox(
|
||||||
onEnter: (ev) {
|
|
||||||
print("sqfdsfd");
|
|
||||||
widget.dashboardSelected = true;
|
|
||||||
},
|
|
||||||
onExit: (ev) {
|
|
||||||
widget.dashboardSelected = false;
|
|
||||||
},
|
|
||||||
child: SizedBox(
|
|
||||||
width: widget.width,
|
width: widget.width,
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
child: ChartWidget<T>(
|
child: ChartWidget<T>(
|
||||||
@ -460,7 +449,7 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
|||||||
onHandlerPressed: widget.onHandlerLongPressed,
|
onHandlerPressed: widget.onHandlerLongPressed,
|
||||||
onHandlerLongPressed: widget.onHandlerLongPressed,
|
onHandlerLongPressed: widget.onHandlerLongPressed,
|
||||||
onPivotSecondaryPressed: widget.onPivotSecondaryPressed,
|
onPivotSecondaryPressed: widget.onPivotSecondaryPressed,
|
||||||
)));
|
));
|
||||||
},
|
},
|
||||||
onAcceptWithDetails: (DragTargetDetails<T> details) {
|
onAcceptWithDetails: (DragTargetDetails<T> details) {
|
||||||
var e = details.data;
|
var e = details.data;
|
||||||
@ -490,24 +479,24 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
|||||||
);
|
);
|
||||||
widget.dashboard.addElement(el, context);
|
widget.dashboard.addElement(el, context);
|
||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
),
|
),
|
||||||
widget.dashboard.isMenu ? Positioned(top: 50, child: FlowChartSelectedMenu(
|
widget.dashboard.isMenu ? Positioned(top: 50, child: FlowChartSelectedMenu(
|
||||||
key: widget.dashboard.selectedMenuKey,
|
key: widget.dashboard.selectedMenuKey,
|
||||||
dashboard: widget.dashboard,
|
dashboard: widget.dashboard,
|
||||||
height: widget.height - 50)) : Container(),
|
height: widget.height - 50) ) : Container(),
|
||||||
widget.dashboard.isInfo ? Positioned(top: 50, right: 0, child:
|
widget.dashboard.isInfo ? Positioned(top: 50, right: 0, child:
|
||||||
FlowChartLeftMenu<T>(
|
FlowChartLeftMenu<T>(
|
||||||
key: widget.dashboard.selectedLeftMenuKey,
|
key: widget.dashboard.selectedLeftMenuKey,
|
||||||
dashboard: widget.dashboard,
|
dashboard: widget.dashboard,
|
||||||
menuExtension: widget.menuExtension,
|
menuExtension: widget.menuExtension,
|
||||||
categories: widget.categories,
|
categories: widget.categories,
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
innerMenuWidth: widget.innerMenuWidth,
|
innerMenuWidth: widget.innerMenuWidth,
|
||||||
itemWidth: widget.itemWidth,
|
itemWidth: widget.itemWidth,
|
||||||
draggableItemBuilder: widget.draggableItemBuilder as List<T> Function(String cat),
|
draggableItemBuilder: widget.draggableItemBuilder as List<T> Function(String cat),
|
||||||
getDraggable: getDraggable,
|
getDraggable: getDraggable,
|
||||||
)) : Container()
|
)) : Container()
|
||||||
])
|
])
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -587,9 +576,8 @@ class _DrawingArrowWidgetState extends State<DrawingArrowWidget> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class ChartWidget<T extends FlowData> extends StatefulWidget {
|
class ChartWidget<T extends FlowData> extends StatefulWidget {
|
||||||
ChartWidget ({ super.key,
|
ChartWidget ({ Key? key,
|
||||||
required this.flowChart,
|
required this.flowChart,
|
||||||
this.onElementPressed,
|
this.onElementPressed,
|
||||||
this.onElementSecondaryTapped,
|
this.onElementSecondaryTapped,
|
||||||
@ -609,7 +597,7 @@ class ChartWidget<T extends FlowData> extends StatefulWidget {
|
|||||||
required this.dashboard,
|
required this.dashboard,
|
||||||
this.onNewConnection,
|
this.onNewConnection,
|
||||||
this.menuWidget,
|
this.menuWidget,
|
||||||
});
|
}) : super(key: key);
|
||||||
|
|
||||||
FlowChartState flowChart;
|
FlowChartState flowChart;
|
||||||
|
|
||||||
@ -755,28 +743,24 @@ class ChartWidgetState<T extends FlowData> extends State<ChartWidget> {
|
|||||||
onTapDown: (details) {
|
onTapDown: (details) {
|
||||||
hoverImportant = false;
|
hoverImportant = false;
|
||||||
tapDownPos = details.localPosition;
|
tapDownPos = details.localPosition;
|
||||||
|
|
||||||
for (var arr in widget.dashboard.arrows) {
|
for (var arr in widget.dashboard.arrows) {
|
||||||
if (arr.isLine(tapDownPos)) {
|
if (arr.isLine(tapDownPos)) {
|
||||||
hoverImportant = true;
|
hoverImportant = true;
|
||||||
for (var arr in widget.dashboard.arrows) {
|
|
||||||
arr.isSelected = false;
|
|
||||||
}
|
|
||||||
arr.isSelected = !arr.isSelected;
|
arr.isSelected = !arr.isSelected;
|
||||||
for (var sel in widget.dashboard.elements) {
|
for (var sel in widget.dashboard.elements) {
|
||||||
sel.isSelected = false;
|
sel.isSelected = false;
|
||||||
}
|
}
|
||||||
Future.delayed(const Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
widget.dashboard.selectedMenuKey.currentState?.setState(() {});
|
widget.dashboard.selectedMenuKey.currentState?.setState(() {});
|
||||||
DrawingArrow.instance.notifyListeners();
|
DrawingArrow.instance.notifyListeners();
|
||||||
});
|
});
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!hoverImportant) {
|
if (!hoverImportant) {
|
||||||
for (var sel in widget.dashboard.elements) { sel.isSelected = false; }
|
for (var sel in widget.dashboard.elements) { sel.isSelected = false; }
|
||||||
for (var sel in widget.dashboard.arrows) { sel.isSelected = false; }
|
for (var sel in widget.dashboard.arrows) { sel.isSelected = false; }
|
||||||
Future.delayed(const Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
widget.dashboard.selectedMenuKey.currentState?.setState(() {});
|
widget.dashboard.selectedMenuKey.currentState?.setState(() {});
|
||||||
DrawingArrow.instance.notifyListeners();
|
DrawingArrow.instance.notifyListeners();
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
|
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class FlowChartLeftMenu<T extends FlowData> extends StatefulWidget {
|
class FlowChartLeftMenu<T extends FlowData> extends StatefulWidget {
|
||||||
Dashboard dashboard;
|
Dashboard dashboard;
|
||||||
List<String> categories;
|
List<String> categories;
|
||||||
@ -40,10 +39,10 @@ class FlowChartLeftMenuState<T extends FlowData> extends State<FlowChartLeftMenu
|
|||||||
: Theme(
|
: Theme(
|
||||||
data: Theme.of(context).copyWith(dividerColor: widget.dashboard.midDashColor),
|
data: Theme.of(context).copyWith(dividerColor: widget.dashboard.midDashColor),
|
||||||
child: ExpansionTile(
|
child: ExpansionTile(
|
||||||
collapsedShape: const RoundedRectangleBorder(
|
collapsedShape: RoundedRectangleBorder(
|
||||||
side: BorderSide.none,
|
side: BorderSide.none,
|
||||||
),
|
),
|
||||||
shape: const RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide.none,
|
side: BorderSide.none,
|
||||||
),
|
),
|
||||||
initiallyExpanded: true,
|
initiallyExpanded: true,
|
||||||
@ -71,16 +70,16 @@ class FlowChartLeftMenuState<T extends FlowData> extends State<FlowChartLeftMenu
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Container(
|
return Container(
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
color: widget.dashboard.midDashColor,
|
color: widget.dashboard.midDashColor,
|
||||||
child: Stack( children: [
|
child: Stack( children: [
|
||||||
Container(
|
Container(
|
||||||
width: widget.innerMenuWidth,
|
width: widget.innerMenuWidth,
|
||||||
height: 50,
|
height: 50,
|
||||||
decoration: BoxDecoration(border: Border(
|
decoration: BoxDecoration(border: Border(
|
||||||
bottom: BorderSide(color: Colors.grey.shade400),
|
bottom: BorderSide(color: Colors.grey.shade400),
|
||||||
right: BorderSide(color: widget.dashboard.midDashColor),
|
right: BorderSide(color: widget.dashboard.midDashColor),
|
||||||
left: const BorderSide(color: Colors.white))),
|
left: BorderSide(color: Colors.white))),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
style: const TextStyle(color: Colors.black, fontSize: 15),
|
style: const TextStyle(color: Colors.black, fontSize: 15),
|
||||||
cursorColor: widget.dashboard.dashColor,
|
cursorColor: widget.dashboard.dashColor,
|
||||||
@ -92,7 +91,7 @@ class FlowChartLeftMenuState<T extends FlowData> extends State<FlowChartLeftMenu
|
|||||||
fillColor: widget.dashboard.midDashColor,
|
fillColor: widget.dashboard.midDashColor,
|
||||||
filled: true,
|
filled: true,
|
||||||
contentPadding: const EdgeInsets.only(left: 50, right: 50, top: 15, bottom: 15),
|
contentPadding: const EdgeInsets.only(left: 50, right: 50, top: 15, bottom: 15),
|
||||||
hintStyle: const TextStyle(
|
hintStyle: TextStyle(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: FontWeight.w400
|
fontWeight: FontWeight.w400
|
||||||
@ -102,7 +101,7 @@ class FlowChartLeftMenuState<T extends FlowData> extends State<FlowChartLeftMenu
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(top: 50),
|
margin: EdgeInsets.only(top: 50),
|
||||||
height: widget.height - 100,
|
height: widget.height - 100,
|
||||||
constraints: BoxConstraints(minWidth: widget.itemWidth),
|
constraints: BoxConstraints(minWidth: widget.itemWidth),
|
||||||
width: widget.dashboard.isMenu ? widget.innerMenuWidth : 0,
|
width: widget.dashboard.isMenu ? widget.innerMenuWidth : 0,
|
||||||
|
@ -6,7 +6,6 @@ import 'package:flutter_colorpicker/flutter_colorpicker.dart';
|
|||||||
import 'package:number_text_input_formatter/number_text_input_formatter.dart';
|
import 'package:number_text_input_formatter/number_text_input_formatter.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class FlowChartSelectedMenu extends StatefulWidget {
|
class FlowChartSelectedMenu extends StatefulWidget {
|
||||||
Dashboard dashboard;
|
Dashboard dashboard;
|
||||||
double height = 100;
|
double height = 100;
|
||||||
@ -22,13 +21,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
width: 200,
|
width: 200,
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
color: widget.dashboard.midDashColor,
|
color: widget.dashboard.midDashColor,
|
||||||
child: SingleChildScrollView( child: Column( children: [
|
child: SingleChildScrollView( child: Column( children: [ ...widget.dashboard.infoItemWidget != null ?
|
||||||
...widget.dashboard.infoItemWidget != null ?
|
|
||||||
widget.dashboard.infoItemWidget!(widget.dashboard.elementSelected.first.element, widget.dashboard.elementSelected.first.id) : [],
|
widget.dashboard.infoItemWidget!(widget.dashboard.elementSelected.first.element, widget.dashboard.elementSelected.first.id) : [],
|
||||||
widget.dashboard.arrowsSelected.isNotEmpty || widget.dashboard.elementSelected.isNotEmpty ? Container(
|
widget.dashboard.arrowsSelected.isNotEmpty || widget.dashboard.elementSelected.isNotEmpty ? Container(
|
||||||
width: 200,
|
width: 200,
|
||||||
margin: const EdgeInsets.only(top: 15),
|
margin: EdgeInsets.only(top: 15),
|
||||||
decoration: const BoxDecoration(border: Border(
|
decoration: BoxDecoration(border: Border(
|
||||||
top: BorderSide(color: Colors.grey, width: 1))),
|
top: BorderSide(color: Colors.grey, width: 1))),
|
||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||||
Tooltip( message: "remove",
|
Tooltip( message: "remove",
|
||||||
@ -40,13 +38,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
}
|
}
|
||||||
return element.isSelected;
|
return element.isSelected;
|
||||||
}, context);
|
}, context);
|
||||||
Future.delayed( const Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
||||||
});
|
});
|
||||||
}, child: Container( margin: const EdgeInsets.all(10),
|
}, child: Container( margin: EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
||||||
width: 200, height: 30,
|
width: 200, height: 30,
|
||||||
child: const Icon(Icons.delete_outline, color: Colors.black),
|
child: Icon(Icons.delete_outline, color: Colors.black),
|
||||||
))
|
))
|
||||||
),
|
),
|
||||||
Tooltip( message: "copy",
|
Tooltip( message: "copy",
|
||||||
@ -54,17 +52,17 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
for (var sel in widget.dashboard.elementSelected) {
|
for (var sel in widget.dashboard.elementSelected) {
|
||||||
var el =FlowElement.fromMap(widget.dashboard, sel.toMap());
|
var el =FlowElement.fromMap(widget.dashboard, sel.toMap());
|
||||||
el.id = const Uuid().v8();
|
el.id = Uuid().v8();
|
||||||
widget.dashboard.addElement(FlowElement.fromMap(widget.dashboard, sel.toMap()), context);
|
widget.dashboard.addElement(FlowElement.fromMap(widget.dashboard, sel.toMap()), context);
|
||||||
widget.dashboard.elements.last.position += const Offset(50, 50);
|
widget.dashboard.elements.last.position += Offset(50, 50);
|
||||||
}
|
}
|
||||||
Future.delayed( const Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
widget.dashboard.chartKey.currentState?.setState(() { });
|
widget.dashboard.chartKey.currentState?.setState(() { });
|
||||||
});
|
});
|
||||||
}, child: Container( margin: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
}, child: Container( margin: EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
||||||
width: 200, height: 30,
|
width: 200, height: 30,
|
||||||
child: const Icon(Icons.copy, color: Colors.black),
|
child: Icon(Icons.copy, color: Colors.black),
|
||||||
))
|
))
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
@ -81,8 +79,9 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
widget.dashboard.infoLinkWidget!(widget.dashboard.arrowsSelected.first) : Container(),
|
widget.dashboard.infoLinkWidget!(widget.dashboard.arrowsSelected.first) : Container(),
|
||||||
widget.dashboard.arrowsSelected.isNotEmpty || widget.dashboard.elementSelected.isNotEmpty ? Container(
|
widget.dashboard.arrowsSelected.isNotEmpty || widget.dashboard.elementSelected.isNotEmpty ? Container(
|
||||||
width: 200,
|
width: 200,
|
||||||
margin: const EdgeInsets.only(top: 15),
|
margin: EdgeInsets.only(top: 15),
|
||||||
decoration: const BoxDecoration(border: Border(top: BorderSide(color: Colors.grey, width: 1))),
|
decoration: BoxDecoration(border: Border(
|
||||||
|
top: BorderSide(color: Colors.grey, width: 1))),
|
||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||||
Tooltip( message: "remove",
|
Tooltip( message: "remove",
|
||||||
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||||
@ -93,13 +92,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
}
|
}
|
||||||
return element.isSelected;
|
return element.isSelected;
|
||||||
}, context);
|
}, context);
|
||||||
Future.delayed( const Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
||||||
});
|
});
|
||||||
}, child: Container( margin: const EdgeInsets.all(10),
|
}, child: Container( margin: EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
||||||
width: 200, height: 30,
|
width: 200, height: 30,
|
||||||
child: const Icon(Icons.delete_outline, color: Colors.black),
|
child: Icon(Icons.delete_outline, color: Colors.black),
|
||||||
))
|
))
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
@ -119,25 +118,22 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
height: widget.height,
|
height: widget.height,
|
||||||
color: widget.dashboard.midDashColor,
|
color: widget.dashboard.midDashColor,
|
||||||
child: Column( children: [
|
child: Column( children: [
|
||||||
Container( padding: const EdgeInsets.all(10), width: 200, height: 60,
|
Container( padding: EdgeInsets.all(10), width: 200, height: 60,
|
||||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||||
child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [
|
child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Text("STYLE ${widget.dashboard.elementSelected.isNotEmpty ? "ELEMENT" : "ARROW"}",
|
Text("STYLE ${widget.dashboard.elementSelected.isNotEmpty ? "ELEMENT" : "ARROW"}", style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
||||||
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
Text("<${widget.dashboard.arrowsSelected.isEmpty && widget.dashboard.elementSelected.isEmpty ? "general" : "selected"}>", style: TextStyle(fontSize: 12), textAlign: TextAlign.center),
|
||||||
Text("<${widget.dashboard.arrowsSelected.isEmpty && widget.dashboard.elementSelected.isEmpty ? "general" : "selected"}>",
|
|
||||||
style: const TextStyle(fontSize: 12), textAlign: TextAlign.center),
|
|
||||||
])),
|
])),
|
||||||
SizedBox( width: 200, height: widget.height - 60, child: SingleChildScrollView( child: Column( children: [
|
SizedBox( width: 200, height: widget.height - 60, child: SingleChildScrollView( child: Column( children: [
|
||||||
widget.dashboard.elementSelected.isNotEmpty ? Container() : Container(
|
widget.dashboard.elementSelected.isNotEmpty ? Container() : Container( padding: EdgeInsets.symmetric(horizontal: 10, vertical: 20),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 20),
|
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
|
||||||
child: Column( children: [
|
child: Column( children: [
|
||||||
Row( children: [
|
Row( children: [
|
||||||
InkWell( mouseCursor: SystemMouseCursors.click,
|
InkWell( mouseCursor: SystemMouseCursors.click,
|
||||||
child: Padding( padding: const EdgeInsets.only(left: 10, right: 10),
|
child: Padding( padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
child: PopupMenuButton<ArrowDash>(
|
child: PopupMenuButton<ArrowDash>(
|
||||||
tooltip: "line defaults",
|
tooltip: "line defaults",
|
||||||
constraints: const BoxConstraints(maxWidth: 100),
|
constraints: BoxConstraints(maxWidth: 100),
|
||||||
initialValue: null,
|
initialValue: null,
|
||||||
onSelected: (ArrowDash value) {
|
onSelected: (ArrowDash value) {
|
||||||
if (widget.dashboard.elementSelected.isEmpty) {
|
if (widget.dashboard.elementSelected.isEmpty) {
|
||||||
@ -203,14 +199,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
dashSpace: widget.dashboard.defaultDashSpace,
|
dashSpace: widget.dashboard.defaultDashSpace,
|
||||||
color: Colors.black
|
color: Colors.black
|
||||||
),
|
),
|
||||||
const SizedBox(height: 25, width: 10),
|
SizedBox(height: 25, width: 10),
|
||||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
PopupMenuButton<void>(
|
PopupMenuButton<void>(
|
||||||
tooltip: "color picker",
|
tooltip: "color picker",
|
||||||
constraints: const BoxConstraints(maxWidth: 664),
|
constraints: BoxConstraints(maxWidth: 664),
|
||||||
initialValue: null,
|
initialValue: null,
|
||||||
onSelected: (void value) {},
|
onSelected: (void value) {},
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<void>>[
|
itemBuilder: (BuildContext context) => <PopupMenuEntry<void>>[
|
||||||
@ -226,12 +222,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
],
|
],
|
||||||
child: Row( children: [
|
child: Row( children: [
|
||||||
Container(width: 15, height: 15, color: widget.dashboard.defaultColor),
|
Container(width: 15, height: 15, color: widget.dashboard.defaultColor),
|
||||||
const SizedBox(height: 25, width: 5),
|
SizedBox(height: 25, width: 5),
|
||||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||||
),
|
),
|
||||||
Tooltip( message: "stroke width",
|
Tooltip( message: "stroke width",
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(left: 10),
|
margin: EdgeInsets.only(left: 10),
|
||||||
width: 55, height: 25,
|
width: 55, height: 25,
|
||||||
child: TextFormField( textAlign: TextAlign.center,
|
child: TextFormField( textAlign: TextAlign.center,
|
||||||
readOnly: widget.dashboard.defaultDashWidth <= 0,
|
readOnly: widget.dashboard.defaultDashWidth <= 0,
|
||||||
@ -243,8 +239,8 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
}
|
}
|
||||||
setState(() { widget.dashboard.defaultStroke = double.parse(value); });
|
setState(() { widget.dashboard.defaultStroke = double.parse(value); });
|
||||||
},
|
},
|
||||||
style: const TextStyle(fontSize: 12),
|
style: TextStyle(fontSize: 12),
|
||||||
decoration: const InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
filled: true,
|
filled: true,
|
||||||
labelText: "stroke",
|
labelText: "stroke",
|
||||||
@ -270,7 +266,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
]),
|
]),
|
||||||
Row(children: [
|
Row(children: [
|
||||||
InkWell( mouseCursor: SystemMouseCursors.click, child: Padding(
|
InkWell( mouseCursor: SystemMouseCursors.click, child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 10, top: 10, right: 10),
|
padding: EdgeInsets.only(left: 10, top: 10, right: 10),
|
||||||
child: PopupMenuButton<ArrowStyle>(
|
child: PopupMenuButton<ArrowStyle>(
|
||||||
initialValue: null,
|
initialValue: null,
|
||||||
onSelected: (ArrowStyle value) {
|
onSelected: (ArrowStyle value) {
|
||||||
@ -283,7 +279,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
},
|
},
|
||||||
tooltip: "line styles",
|
tooltip: "line styles",
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<ArrowStyle>>[
|
itemBuilder: (BuildContext context) => <PopupMenuEntry<ArrowStyle>>[
|
||||||
const PopupMenuItem<ArrowStyle>(
|
PopupMenuItem<ArrowStyle>(
|
||||||
value: ArrowStyle.segmented,
|
value: ArrowStyle.segmented,
|
||||||
child: Row( children: [
|
child: Row( children: [
|
||||||
Icon(Icons.turn_slight_left),
|
Icon(Icons.turn_slight_left),
|
||||||
@ -291,7 +287,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
child: Text('straight', textAlign: TextAlign.center,))
|
child: Text('straight', textAlign: TextAlign.center,))
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<ArrowStyle>(
|
PopupMenuItem<ArrowStyle>(
|
||||||
value: ArrowStyle.curve,
|
value: ArrowStyle.curve,
|
||||||
child: Row( children: [
|
child: Row( children: [
|
||||||
Icon(Icons.roundabout_left),
|
Icon(Icons.roundabout_left),
|
||||||
@ -299,7 +295,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
child: Text('curved', textAlign: TextAlign.center,))
|
child: Text('curved', textAlign: TextAlign.center,))
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<ArrowStyle>(
|
PopupMenuItem<ArrowStyle>(
|
||||||
value: ArrowStyle.rectangular,
|
value: ArrowStyle.rectangular,
|
||||||
child: Row( children: [
|
child: Row( children: [
|
||||||
Icon(Icons.turn_sharp_left_outlined),
|
Icon(Icons.turn_sharp_left_outlined),
|
||||||
@ -311,13 +307,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
child:
|
child:
|
||||||
Row( children: [ Icon(widget.dashboard.defaultArrowStyle == ArrowStyle.segmented ? Icons.turn_slight_left : widget.dashboard.defaultArrowStyle == ArrowStyle.curve ? Icons.roundabout_left : Icons.turn_sharp_left_outlined
|
Row( children: [ Icon(widget.dashboard.defaultArrowStyle == ArrowStyle.segmented ? Icons.turn_slight_left : widget.dashboard.defaultArrowStyle == ArrowStyle.curve ? Icons.roundabout_left : Icons.turn_sharp_left_outlined
|
||||||
, color: Colors.black),
|
, color: Colors.black),
|
||||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
Tooltip( message: "space dash",
|
Tooltip( message: "space dash",
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(top: 10),
|
margin: EdgeInsets.only(top: 10),
|
||||||
width: 105 / 2, height: 25,
|
width: 105 / 2, height: 25,
|
||||||
child: TextFormField( textAlign: TextAlign.center,
|
child: TextFormField( textAlign: TextAlign.center,
|
||||||
readOnly: widget.dashboard.defaultDashWidth <= 0,
|
readOnly: widget.dashboard.defaultDashWidth <= 0,
|
||||||
@ -329,14 +325,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
}
|
}
|
||||||
setState(() { widget.dashboard.defaultDashWidth = double.parse(value); });
|
setState(() { widget.dashboard.defaultDashWidth = double.parse(value); });
|
||||||
},
|
},
|
||||||
style: const TextStyle(fontSize: 12),
|
style: TextStyle(fontSize: 12),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||||
filled: true,
|
filled: true,
|
||||||
labelText: "dash",
|
labelText: "dash",
|
||||||
labelStyle: const TextStyle(fontSize: 10),
|
labelStyle: TextStyle(fontSize: 10),
|
||||||
border: const OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||||
),
|
),
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
NumberTextInputFormatter(
|
NumberTextInputFormatter(
|
||||||
@ -355,7 +351,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
))),
|
))),
|
||||||
Tooltip( message: "space width",
|
Tooltip( message: "space width",
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(left: 10, top: 10),
|
margin: EdgeInsets.only(left: 10, top: 10),
|
||||||
width: 105 / 2, height: 25,
|
width: 105 / 2, height: 25,
|
||||||
child: TextFormField( textAlign: TextAlign.center,
|
child: TextFormField( textAlign: TextAlign.center,
|
||||||
initialValue: "${widget.dashboard.defaultDashSpace}",
|
initialValue: "${widget.dashboard.defaultDashSpace}",
|
||||||
@ -366,14 +362,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
}
|
}
|
||||||
setState(() { widget.dashboard.defaultDashSpace = double.parse(value); });
|
setState(() { widget.dashboard.defaultDashSpace = double.parse(value); });
|
||||||
},
|
},
|
||||||
style: const TextStyle(fontSize: 12),
|
style: TextStyle(fontSize: 12),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||||
filled: true,
|
filled: true,
|
||||||
labelText: "space",
|
labelText: "space",
|
||||||
labelStyle: const TextStyle(fontSize: 10),
|
labelStyle: TextStyle(fontSize: 10),
|
||||||
border: const OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||||
),
|
),
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
NumberTextInputFormatter(
|
NumberTextInputFormatter(
|
||||||
@ -393,12 +389,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
]),
|
]),
|
||||||
])),
|
])),
|
||||||
widget.dashboard.elementSelected.isNotEmpty ? Container() :
|
widget.dashboard.elementSelected.isNotEmpty ? Container() :
|
||||||
Container( padding: const EdgeInsets.only(left: 10, right: 10, bottom: 20, top: 15),
|
Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 20, top: 15),
|
||||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||||
child: Column( children: [
|
child: Column( children: [
|
||||||
Row( mainAxisAlignment: MainAxisAlignment.center, children : [
|
Row( mainAxisAlignment: MainAxisAlignment.center, children : [
|
||||||
InkWell( mouseCursor: SystemMouseCursors.click,
|
InkWell( mouseCursor: SystemMouseCursors.click,
|
||||||
child: Padding( padding: const EdgeInsets.symmetric(horizontal: 10),
|
child: Padding( padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
child: PopupMenuButton<ArrowDirection>(
|
child: PopupMenuButton<ArrowDirection>(
|
||||||
initialValue: null,
|
initialValue: null,
|
||||||
onSelected: (ArrowDirection value) {
|
onSelected: (ArrowDirection value) {
|
||||||
@ -411,7 +407,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
},
|
},
|
||||||
tooltip: widget.dashboard.defaultArrowDirection == ArrowDirection.forward ? 'forward' : widget.dashboard.defaultArrowDirection == ArrowDirection.backward ? 'backward' : 'bidirectionnal',
|
tooltip: widget.dashboard.defaultArrowDirection == ArrowDirection.forward ? 'forward' : widget.dashboard.defaultArrowDirection == ArrowDirection.backward ? 'backward' : 'bidirectionnal',
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<ArrowDirection>>[
|
itemBuilder: (BuildContext context) => <PopupMenuEntry<ArrowDirection>>[
|
||||||
const PopupMenuItem<ArrowDirection>(
|
PopupMenuItem<ArrowDirection>(
|
||||||
value: ArrowDirection.forward,
|
value: ArrowDirection.forward,
|
||||||
child: Row( children: [
|
child: Row( children: [
|
||||||
Icon(Icons.arrow_forward),
|
Icon(Icons.arrow_forward),
|
||||||
@ -419,7 +415,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
child: Text('forward', textAlign: TextAlign.center,))
|
child: Text('forward', textAlign: TextAlign.center,))
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<ArrowDirection>(
|
PopupMenuItem<ArrowDirection>(
|
||||||
value: ArrowDirection.backward,
|
value: ArrowDirection.backward,
|
||||||
child: Row( children: [
|
child: Row( children: [
|
||||||
Icon(Icons.arrow_back),
|
Icon(Icons.arrow_back),
|
||||||
@ -427,7 +423,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
child: Text('curved', textAlign: TextAlign.center,))
|
child: Text('curved', textAlign: TextAlign.center,))
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<ArrowDirection>(
|
PopupMenuItem<ArrowDirection>(
|
||||||
value: ArrowDirection.bidirectionnal,
|
value: ArrowDirection.bidirectionnal,
|
||||||
child: Row( children: [
|
child: Row( children: [
|
||||||
Icon(Icons.sync_alt_outlined),
|
Icon(Icons.sync_alt_outlined),
|
||||||
@ -439,16 +435,16 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
child:
|
child:
|
||||||
Row( children: [
|
Row( children: [
|
||||||
Icon(widget.dashboard.defaultArrowDirection == ArrowDirection.forward ? Icons.arrow_forward : widget.dashboard.defaultArrowDirection == ArrowDirection.backward ? Icons.arrow_back : Icons.sync_alt_outlined, color: Colors.black),
|
Icon(widget.dashboard.defaultArrowDirection == ArrowDirection.forward ? Icons.arrow_forward : widget.dashboard.defaultArrowDirection == ArrowDirection.backward ? Icons.arrow_back : Icons.sync_alt_outlined, color: Colors.black),
|
||||||
Padding( padding: const EdgeInsets.symmetric(horizontal: 10),
|
Padding( padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
child: Text(widget.dashboard.defaultArrowDirection == ArrowDirection.forward ? 'forward' : widget.dashboard.defaultArrowDirection == ArrowDirection.backward ? 'backward' : 'bidirectionnal')),
|
child: Text(widget.dashboard.defaultArrowDirection == ArrowDirection.forward ? 'forward' : widget.dashboard.defaultArrowDirection == ArrowDirection.backward ? 'backward' : 'bidirectionnal')),
|
||||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||||
),)
|
),)
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
Row(children: [
|
Row(children: [
|
||||||
Tooltip( message: "forward size",
|
Tooltip( message: "forward size",
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(top: 10),
|
margin: EdgeInsets.only(top: 10),
|
||||||
width: 150, height: 25,
|
width: 150, height: 25,
|
||||||
child: TextFormField( textAlign: TextAlign.center,
|
child: TextFormField( textAlign: TextAlign.center,
|
||||||
initialValue: "${widget.dashboard.defaultForwardWidth}",
|
initialValue: "${widget.dashboard.defaultForwardWidth}",
|
||||||
@ -471,14 +467,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
style: const TextStyle(fontSize: 12),
|
style: TextStyle(fontSize: 12),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||||
filled: true,
|
filled: true,
|
||||||
labelText: "forward size",
|
labelText: "forward size",
|
||||||
labelStyle: const TextStyle(fontSize: 10),
|
labelStyle: TextStyle(fontSize: 10),
|
||||||
border: const OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||||
),
|
),
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
NumberTextInputFormatter(
|
NumberTextInputFormatter(
|
||||||
@ -495,12 +491,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
],
|
],
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
))),
|
))),
|
||||||
const Padding( padding: EdgeInsets.only(top: 10, left: 5), child: Icon(Icons.arrow_forward, color: Colors.black))
|
Padding( padding: EdgeInsets.only(top: 10, left: 5), child: Icon(Icons.arrow_forward, color: Colors.black))
|
||||||
]),
|
]),
|
||||||
Row(children: [
|
Row(children: [
|
||||||
Tooltip( message: "back size",
|
Tooltip( message: "back size",
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(top: 10),
|
margin: EdgeInsets.only(top: 10),
|
||||||
width: 150, height: 25,
|
width: 150, height: 25,
|
||||||
child: TextFormField( textAlign: TextAlign.center,
|
child: TextFormField( textAlign: TextAlign.center,
|
||||||
initialValue: "${widget.dashboard.defaultBackWidth}",
|
initialValue: "${widget.dashboard.defaultBackWidth}",
|
||||||
@ -523,14 +519,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
style: const TextStyle(fontSize: 12),
|
style: TextStyle(fontSize: 12),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||||
filled: true,
|
filled: true,
|
||||||
labelText: "back size",
|
labelText: "back size",
|
||||||
labelStyle: const TextStyle(fontSize: 10),
|
labelStyle: TextStyle(fontSize: 10),
|
||||||
border: const OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||||
),
|
),
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
NumberTextInputFormatter(
|
NumberTextInputFormatter(
|
||||||
@ -547,12 +543,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
],
|
],
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
))),
|
))),
|
||||||
const Padding( padding: EdgeInsets.only(top: 10, left: 5), child: Icon(Icons.arrow_back, color: Colors.black))
|
Padding( padding: EdgeInsets.only(top: 10, left: 5), child: Icon(Icons.arrow_back, color: Colors.black))
|
||||||
])
|
])
|
||||||
])),
|
])),
|
||||||
widget.dashboard.arrowsSelected.isNotEmpty || widget.dashboard.elementSelected.isNotEmpty ? Container(
|
widget.dashboard.arrowsSelected.isNotEmpty || widget.dashboard.elementSelected.isNotEmpty ? Container(
|
||||||
width: 200,
|
width: 200,
|
||||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||||
Tooltip( message: "remove",
|
Tooltip( message: "remove",
|
||||||
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||||
@ -563,13 +559,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
}
|
}
|
||||||
return element.isSelected;
|
return element.isSelected;
|
||||||
}, context);
|
}, context);
|
||||||
Future.delayed(const Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
||||||
});
|
});
|
||||||
}, child: Container( margin: const EdgeInsets.all(10),
|
}, child: Container( margin: EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
||||||
width: 200, height: 30,
|
width: 200, height: 30,
|
||||||
child: const Icon(Icons.delete_outline, color: Colors.black),
|
child: Icon(Icons.delete_outline, color: Colors.black),
|
||||||
))
|
))
|
||||||
),
|
),
|
||||||
Tooltip( message: "copy",
|
Tooltip( message: "copy",
|
||||||
@ -577,15 +573,15 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
for (var sel in widget.dashboard.elementSelected) {
|
for (var sel in widget.dashboard.elementSelected) {
|
||||||
widget.dashboard.addElement(FlowElement.fromMap(widget.dashboard, sel.toMap()), context);
|
widget.dashboard.addElement(FlowElement.fromMap(widget.dashboard, sel.toMap()), context);
|
||||||
widget.dashboard.elements.last.position += const Offset(50, 50);
|
widget.dashboard.elements.last.position += Offset(50, 50);
|
||||||
}
|
}
|
||||||
Future.delayed( const Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
widget.dashboard.chartKey.currentState?.setState(() { });
|
widget.dashboard.chartKey.currentState?.setState(() { });
|
||||||
});
|
});
|
||||||
}, child: Container( margin: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
}, child: Container( margin: EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
||||||
width: 200, height: 30,
|
width: 200, height: 30,
|
||||||
child: const Icon(Icons.copy, color: Colors.black),
|
child: Icon(Icons.copy, color: Colors.black),
|
||||||
))
|
))
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
@ -598,15 +594,15 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
Container( // SHORTCUT
|
Container( // SHORTCUT
|
||||||
width: 200, height: 50,
|
width: 200, height: 50,
|
||||||
decoration: BoxDecoration(color: widget.dashboard.midDashColor,
|
decoration: BoxDecoration(color: widget.dashboard.midDashColor,
|
||||||
border: const Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||||
child: Row( children: [
|
child: Row( children: [
|
||||||
Tooltip( message: "dashboard information",
|
Tooltip( message: "dashboard information",
|
||||||
child: InkWell( onTap: () => setState(() {widget.isDashboardInfo = true; }),
|
child: InkWell( onTap: () => setState(() {widget.isDashboardInfo = true; }),
|
||||||
mouseCursor: SystemMouseCursors.click,
|
mouseCursor: SystemMouseCursors.click,
|
||||||
child: Container( alignment: Alignment.center,
|
child: Container( alignment: Alignment.center,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: EdgeInsets.symmetric(vertical: 10),
|
||||||
color: widget.isDashboardInfo ? Colors.grey : widget.dashboard.midDashColor,
|
color: widget.isDashboardInfo ? Colors.grey : widget.dashboard.midDashColor,
|
||||||
width: 200 / 2, child: const Icon(Icons.info, color: Colors.white))
|
width: 200 / 2, child: Icon(Icons.info, color: Colors.white))
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
Tooltip(
|
Tooltip(
|
||||||
@ -614,19 +610,17 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
child: InkWell( onTap: () => setState(() {widget.isDashboardInfo = false; }),
|
child: InkWell( onTap: () => setState(() {widget.isDashboardInfo = false; }),
|
||||||
mouseCursor: SystemMouseCursors.click,
|
mouseCursor: SystemMouseCursors.click,
|
||||||
child: Container( alignment: Alignment.center,
|
child: Container( alignment: Alignment.center,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: EdgeInsets.symmetric(vertical: 10),
|
||||||
color: !widget.isDashboardInfo ? Colors.grey : widget.dashboard.midDashColor,
|
color: !widget.isDashboardInfo ? Colors.grey : widget.dashboard.midDashColor,
|
||||||
width: 200 / 2, child: const Icon(Icons.format_paint, color: Colors.white)),
|
width: 200 / 2, child: Icon(Icons.format_paint, color: Colors.white)),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
widget.dashboard.error != null ? Container( width: 200,
|
widget.dashboard.error != null ? Container( width: 200, color: Colors.red, padding: EdgeInsets.all(10),
|
||||||
color: Colors.red,
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
child: Center( child: Text(widget.dashboard.error!,
|
child: Center( child: Text(widget.dashboard.error!,
|
||||||
style: const TextStyle(color: Colors.white, fontSize: 15), textAlign: TextAlign.center))) : Container(),
|
style: TextStyle(color: Colors.white, fontSize: 15), textAlign: TextAlign.center))) : Container(),
|
||||||
w
|
w
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -744,28 +744,8 @@ class ArrowPainter extends CustomPainter {
|
|||||||
return _dashedPathProperties.path;
|
return _dashedPathProperties.path;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isLine(Offset point) {
|
|
||||||
final metrics = path.computeMetrics(forceClosed: false);
|
bool isLine(Offset position) {
|
||||||
for (final metric in metrics) {
|
|
||||||
final length = metric.length;
|
|
||||||
const steps = 100;
|
|
||||||
for(int i = 0; i <= steps; i++) {
|
|
||||||
final distance = length * i / steps;
|
|
||||||
final tangent = metric.getTangentForOffset(distance);
|
|
||||||
if (tangent != null) {
|
|
||||||
final position = tangent.position;
|
|
||||||
if ((position - point).distance <= 10) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
bool isLine(Offset position, String name) {
|
|
||||||
position = Offset(position.dx, position.dy + 10);
|
|
||||||
print("${position.dx} ${position.dy}");
|
|
||||||
for (double i=-5; i < 5; i++) {
|
for (double i=-5; i < 5; i++) {
|
||||||
for (double y=-5; y < 5; y++) {
|
for (double y=-5; y < 5; y++) {
|
||||||
var pos = position + Offset(i, y);
|
var pos = position + Offset(i, y);
|
||||||
@ -776,7 +756,7 @@ class ArrowPainter extends CustomPainter {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
@override
|
@override
|
||||||
bool? hitTest(Offset position) {
|
bool? hitTest(Offset position) {
|
||||||
/* graphkey?.currentState?.widget.isShowed = isLine(position);
|
/* graphkey?.currentState?.widget.isShowed = isLine(position);
|
||||||
|
@ -177,7 +177,7 @@ class ElementWidgetState<T extends FlowData> extends State<ElementWidget> {
|
|||||||
childWhenDragging: const SizedBox.shrink(),
|
childWhenDragging: const SizedBox.shrink(),
|
||||||
feedback: Material(
|
feedback: Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: Padding( padding: const EdgeInsets.all(6),
|
child: Padding( padding: EdgeInsets.all(6),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(border: Border.all( color: Colors.red, width: 2)),
|
decoration: BoxDecoration(border: Border.all( color: Colors.red, width: 2)),
|
||||||
width: widget.element.size.width - 12,
|
width: widget.element.size.width - 12,
|
||||||
@ -262,7 +262,7 @@ class ElementWidgetState<T extends FlowData> extends State<ElementWidget> {
|
|||||||
children: (!widget.isHovered ? [] : [
|
children: (!widget.isHovered ? [] : [
|
||||||
IconButton(tooltip: "remove element", onPressed: () {
|
IconButton(tooltip: "remove element", onPressed: () {
|
||||||
widget.dashboard.removeElement(widget.element, context);
|
widget.dashboard.removeElement(widget.element, context);
|
||||||
}, icon: const Icon(Icons.delete_outline)),
|
}, icon: Icon(Icons.delete_outline)),
|
||||||
IconButton(tooltip: "copy element", onPressed: () {
|
IconButton(tooltip: "copy element", onPressed: () {
|
||||||
FlowElement<T> newElement = FlowElement<T>(
|
FlowElement<T> newElement = FlowElement<T>(
|
||||||
element: widget.element.element as T?,
|
element: widget.element.element as T?,
|
||||||
@ -273,7 +273,7 @@ class ElementWidgetState<T extends FlowData> extends State<ElementWidget> {
|
|||||||
widget: widget.element.widget,
|
widget: widget.element.widget,
|
||||||
);
|
);
|
||||||
widget.dashboard.addElement(newElement, context);
|
widget.dashboard.addElement(newElement, context);
|
||||||
}, icon: const Icon(Icons.copy, size: 20)),
|
}, icon: Icon(Icons.copy, size: 20)),
|
||||||
]))
|
]))
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/// The arrow tip.
|
/// The arrow tip.
|
||||||
// ignore: must_be_immutable
|
|
||||||
class HandlerWidget extends StatelessWidget {
|
class HandlerWidget extends StatelessWidget {
|
||||||
///
|
///
|
||||||
HandlerWidget({
|
HandlerWidget({
|
||||||
|
@ -4,7 +4,6 @@ import 'package:flutter_flow_chart/src/ui/element_widget.dart';
|
|||||||
import 'package:flutter_flow_chart/src/ui/handler_widget.dart';
|
import 'package:flutter_flow_chart/src/ui/handler_widget.dart';
|
||||||
|
|
||||||
/// The widget to press and drag to resize the element
|
/// The widget to press and drag to resize the element
|
||||||
// ignore: must_be_immutable
|
|
||||||
class ResizeWidget extends StatefulWidget {
|
class ResizeWidget extends StatefulWidget {
|
||||||
Widget? bottomLeftBadge;
|
Widget? bottomLeftBadge;
|
||||||
Widget? bottomRightBadge;
|
Widget? bottomRightBadge;
|
||||||
@ -24,7 +23,7 @@ class ResizeWidget extends StatefulWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
Color handlerColor = const Color.fromRGBO(38, 166, 154, 1);
|
Color handlerColor = Color.fromRGBO(38, 166, 154, 1);
|
||||||
final ElementWidgetState comp;
|
final ElementWidgetState comp;
|
||||||
///
|
///
|
||||||
final Dashboard dashboard;
|
final Dashboard dashboard;
|
||||||
|
Loading…
Reference in New Issue
Block a user