Compare commits
2 Commits
main
...
feature/mi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
758a691f8d | ||
| 1341d9523b |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -10,7 +10,7 @@
|
||||
.svn/
|
||||
build/
|
||||
migrate_working_dir/
|
||||
env.env
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
52
Dockerfile
52
Dockerfile
@@ -1,42 +1,52 @@
|
||||
FROM debian:bookworm-slim AS build-env
|
||||
# Environemnt to install flutter and build web
|
||||
FROM debian:latest AS build-env
|
||||
|
||||
ARG HOST="http://localhost:8000"
|
||||
ARG HOST=${HOST:-"http://localhost:8000"}
|
||||
ARG AUTH_MODE=true
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
git \
|
||||
unzip \
|
||||
xz-utils \
|
||||
zip \
|
||||
libglu1-mesa \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
# install all needed stuff
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y curl git unzip
|
||||
|
||||
RUN update-ca-certificates
|
||||
|
||||
ARG FLUTTER_SDK=/usr/local/flutter
|
||||
ARG FLUTTER_VERSION=3.24.3
|
||||
ARG APP=/app
|
||||
# define variables
|
||||
ARG FLUTTER_SDK=/usr/local/flutter
|
||||
ARG FLUTTER_VERSION=3.19.6
|
||||
ARG APP=/app/
|
||||
|
||||
#clone flutter
|
||||
RUN git clone https://github.com/flutter/flutter.git $FLUTTER_SDK
|
||||
RUN cd $FLUTTER_SDK && git checkout $FLUTTER_VERSION
|
||||
# change dir to current flutter folder and make a checkout to the specific version
|
||||
RUN cd $FLUTTER_SDK && git fetch && git checkout $FLUTTER_VERSION
|
||||
|
||||
# setup the flutter path as an enviromental variable
|
||||
ENV PATH="$FLUTTER_SDK/bin:$FLUTTER_SDK/bin/cache/dart-sdk/bin:${PATH}"
|
||||
|
||||
RUN flutter config --enable-web
|
||||
# Start to run Flutter commands
|
||||
# doctor to see if all was installes ok
|
||||
RUN flutter doctor -v
|
||||
|
||||
# create folder to copy source code
|
||||
RUN mkdir $APP
|
||||
# copy source code to folder
|
||||
COPY . $APP
|
||||
# stup new folder as the working directory
|
||||
WORKDIR $APP
|
||||
COPY . .
|
||||
|
||||
# Run build: 1 - clean, 2 - pub get, 3 - build web
|
||||
RUN flutter clean
|
||||
RUN flutter pub get
|
||||
RUN flutter build web \
|
||||
RUN flutter build web \
|
||||
--dart-define=AUTH_MODE=$AUTH_MODE \
|
||||
--dart-define=HOST=$HOST
|
||||
|
||||
# once heare the app will be compiled and ready to deploy
|
||||
|
||||
# use nginx to deploy
|
||||
FROM nginx:1.25.2-alpine
|
||||
|
||||
# copy the info of the builded web app to nginx
|
||||
COPY --from=build-env /app/build/web /usr/share/nginx/html
|
||||
|
||||
# Expose and run nginx
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
16
Makefile
16
Makefile
@@ -1,8 +1,7 @@
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: clean docker publish-kind
|
||||
all: clean docker publish-kind publish-registry
|
||||
|
||||
ci: clean docker publish-registry
|
||||
|
||||
linux:
|
||||
./local_run.sh
|
||||
@@ -28,18 +27,13 @@ clean:
|
||||
flutter clean
|
||||
|
||||
docker:
|
||||
DOCKER_BUILDKIT=1 docker build -t oc-front --build-arg HOST=$(HOST) --build-arg AUTH_MODE=true -f Dockerfile .
|
||||
docker tag oc-front opencloudregistry/oc-front:latest
|
||||
DOCKER_BUILDKIT=1 docker build -t oc/oc-front:0.0.1 --build-arg HOST=$(HOST) -f Dockerfile .
|
||||
docker tag oc/oc-front:0.0.1 oc/oc-front:latest
|
||||
|
||||
publish-kind:
|
||||
kind load docker-image opencloudregistry/oc-front:latest --name $(CLUSTER_NAME) | true
|
||||
kind load docker-image oc/oc-front:0.0.1 --name opencloud
|
||||
|
||||
publish-registry:
|
||||
docker push opencloudregistry/oc-front:latest
|
||||
|
||||
docker-deploy:
|
||||
docker compose up -d
|
||||
|
||||
run-docker: docker publish-kind publish-registry docker-deploy
|
||||
@echo "TODO"
|
||||
|
||||
.PHONY: build run clean docker publish-kind publish-registry
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
|
||||
<!-- outer circle -->
|
||||
<circle cx="32" cy="32" r="28" stroke="#6C3FC5" stroke-width="3" fill="#EDE7F6"/>
|
||||
<!-- lightning bolt -->
|
||||
<polygon points="36,10 22,34 31,34 28,54 42,30 33,30" fill="#6C3FC5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 287 B |
@@ -5,9 +5,9 @@ services:
|
||||
image: oc-front
|
||||
container_name: oc-front
|
||||
ports:
|
||||
- 80:80
|
||||
- 8080:80
|
||||
networks:
|
||||
- oc
|
||||
- catalog
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.front.entrypoints=web"
|
||||
@@ -15,6 +15,7 @@ services:
|
||||
- "traefik.http.services.front.loadbalancer.server.port=80"
|
||||
- "traefik.http.middlewares.front-stripprefix.stripprefix.prefixes=/"
|
||||
- "traefik.http.routers.front.middlewares=front-stripprefix"
|
||||
- "traefik.http.middlewares.front.forwardauth.address=http://oc-auth:8080/oc/forward"
|
||||
networks:
|
||||
oc:
|
||||
catalog:
|
||||
external: true
|
||||
@@ -3,7 +3,7 @@ import 'package:flutter/services.dart';
|
||||
|
||||
class AppConfig {
|
||||
static final AppConfig _instance = AppConfig._internal();
|
||||
final Map<String, String> _config = {};
|
||||
Map<String, String> _config = {};
|
||||
|
||||
AppConfig._internal();
|
||||
|
||||
@@ -11,9 +11,7 @@ class AppConfig {
|
||||
|
||||
Future<void> loadConfig() async {
|
||||
final response = await rootBundle.loadString('assets/config/front.json');
|
||||
for (var v in Map<String, String>.from(json.decode(response)).entries) {
|
||||
_config[v.key] = v.value;
|
||||
}
|
||||
_config = Map<String, String>.from(json.decode(response));
|
||||
}
|
||||
|
||||
String get(String key, {String defaultValue = ''}) {
|
||||
|
||||
@@ -42,14 +42,14 @@ class HeaderConstants {
|
||||
|
||||
static setTitle(String? v) {
|
||||
title = v;
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
HeaderConstants.headerWidget?.setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
static setDescription(String? v) {
|
||||
description = v;
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
HeaderConstants.headerWidget?.setState(() {});
|
||||
});
|
||||
}
|
||||
@@ -70,7 +70,7 @@ class HeaderWidgetState extends State<HeaderWidget> {
|
||||
return Container();
|
||||
}
|
||||
if (AppRouter.currentRoute.factory.searchFill()) {
|
||||
return const DefaultWidget();
|
||||
return DefaultWidget();
|
||||
}
|
||||
HeaderConstants.height = HeaderConstants.isNoHeader(AppRouter.currentRoute.route) || !AppRouter.currentRoute.factory.searchFill() ? 50 : 100;
|
||||
return Column( children: [
|
||||
@@ -78,7 +78,7 @@ class HeaderWidgetState extends State<HeaderWidget> {
|
||||
height: 50, width: getMainWidth(context),
|
||||
decoration: BoxDecoration(
|
||||
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,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
@@ -89,7 +89,7 @@ class HeaderWidgetState extends State<HeaderWidget> {
|
||||
child:
|
||||
Container(width: 50, height: 50,
|
||||
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(
|
||||
@@ -112,10 +112,10 @@ class HeaderWidgetState extends State<HeaderWidget> {
|
||||
AppRouter.currentRoute.factory.search(context, true);
|
||||
} : null,
|
||||
),
|
||||
Container( padding: const EdgeInsets.only(left: 50),
|
||||
decoration: const BoxDecoration( border: Border( left: BorderSide( color: Colors.white ))),
|
||||
Container( padding: EdgeInsets.only(left: 50),
|
||||
decoration: BoxDecoration( border: Border( left: BorderSide( color: Colors.white ))),
|
||||
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,
|
||||
width: 350,
|
||||
all: () async => WorkspaceLocal.getWorkspacesShallow(),
|
||||
|
||||
@@ -58,7 +58,6 @@ class APIService<T extends SerializerDeserializer> {
|
||||
String url, String method, dynamic body, Options? options) async {
|
||||
switch (method.toLowerCase()) {
|
||||
case 'get':
|
||||
print(url);
|
||||
return await _dio.get(url, options: options);
|
||||
case 'post':
|
||||
return await _dio.post(url, data: body, options: options);
|
||||
@@ -105,10 +104,10 @@ class APIService<T extends SerializerDeserializer> {
|
||||
Future<APIResponse<T>> _main(String url, dynamic body, String method, String succeed, bool force,
|
||||
BuildContext? context, Options? options) async {
|
||||
var err = "";
|
||||
try {
|
||||
try {
|
||||
_dio.options.headers["Authorization"] = "Bearer ${localStorage.getItem('accessToken') ?? ""}";
|
||||
_dio.interceptors.clear();
|
||||
print("URL ${_dio.options.baseUrl}$url" );
|
||||
print("${_dio.options.baseUrl}$url" );
|
||||
var response = await _request(url, method, body, options);
|
||||
if (response.statusCode != null && response.statusCode! < 400) {
|
||||
if (method == "delete") { cache.remove(url); return APIResponse<T>(); }
|
||||
@@ -138,7 +137,7 @@ class APIService<T extends SerializerDeserializer> {
|
||||
alertBannerLocation: AlertBannerLocation.bottom,);
|
||||
} catch (e) { /* */ }
|
||||
}
|
||||
throw Exception("${_dio.options.baseUrl}$url $err");
|
||||
throw Exception(err);
|
||||
}
|
||||
|
||||
Future<APIResponse<RawData>> raw(
|
||||
|
||||
@@ -48,11 +48,10 @@ class AuthService {
|
||||
return localStorage.getItem('username') ?? "unknown";
|
||||
}
|
||||
|
||||
static Future<void> login(String username, String password, String? challenge) async {
|
||||
static Future<void> login(String username, String password) async {
|
||||
var token = await service!.post("/login?client_id=$_clientID", <String, dynamic> {
|
||||
"username": username,
|
||||
"password": password,
|
||||
"challenge": challenge
|
||||
"password": password
|
||||
}, null);
|
||||
if (token.code == 200 && token.data != null) {
|
||||
localStorage.setItem('accessToken', token.data?.value['access_token']);
|
||||
@@ -102,7 +101,7 @@ class AuthService {
|
||||
'expiresIn',
|
||||
DateTime.now()
|
||||
.add(Duration(seconds: token.data?.value['expires_in']) -
|
||||
const Duration(seconds: 10))
|
||||
Duration(seconds: 10))
|
||||
.toIso8601String());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,213 +0,0 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:jwt_decoder/jwt_decoder.dart';
|
||||
import 'package:localstorage/localstorage.dart';
|
||||
import 'package:oc_front/core/conf/conf_reader.dart';
|
||||
import 'package:oc_front/core/services/redirect_stub.dart'
|
||||
if (dart.library.html) 'package:oc_front/core/services/redirect_web.dart';
|
||||
|
||||
class OAuthConfig {
|
||||
static final clientId = AppConfig().get('CLIENT_ID', defaultValue: 'test-client');
|
||||
static final host = AppConfig().get('HOST', defaultValue: 'http://localhost:8000');
|
||||
static final redirectUri = kIsWeb ? host : 'ocforge://callback';
|
||||
static final issuer = '$host/hydra';
|
||||
|
||||
static final authorizationEndpoint = '$issuer/auth';
|
||||
static final tokenEndpoint = '$issuer/token';
|
||||
static final endSessionEndpoint = '$issuer/sessions/logout';
|
||||
|
||||
static final scopes = ['openid', 'profile', 'email', 'role'];
|
||||
}
|
||||
|
||||
class TokenStorage {
|
||||
static const _accessToken = 'access_token';
|
||||
static const _refreshToken = 'refresh_token';
|
||||
static const _idToken = 'id_token';
|
||||
|
||||
final _storage = const FlutterSecureStorage();
|
||||
|
||||
Future<void> save({
|
||||
required String accessToken,
|
||||
required String refreshToken,
|
||||
String? idToken,
|
||||
}) async {
|
||||
await _storage.write(key: _accessToken, value: accessToken);
|
||||
await _storage.write(key: _refreshToken, value: refreshToken);
|
||||
if (idToken != null) {
|
||||
await _storage.write(key: _idToken, value: idToken);
|
||||
}
|
||||
}
|
||||
|
||||
Future<String?> getAccessToken() => _storage.read(key: _accessToken);
|
||||
Future<String?> getRefreshToken() => _storage.read(key: _refreshToken);
|
||||
Future<String?> getIdToken() => _storage.read(key: _idToken);
|
||||
|
||||
Future<void> clear() async => _storage.deleteAll();
|
||||
}
|
||||
|
||||
class OAuth2Service {
|
||||
static final OAuth2Service _instance = OAuth2Service._internal();
|
||||
factory OAuth2Service() => _instance;
|
||||
OAuth2Service._internal();
|
||||
|
||||
final TokenStorage _storage = TokenStorage();
|
||||
final _dio = Dio(BaseOptions(
|
||||
headers: {'Content-Type': 'application/json; charset=UTF-8'},
|
||||
validateStatus: (status) => status != null && status < 500,
|
||||
));
|
||||
|
||||
/// Initiates the Hydra headless auth flow.
|
||||
///
|
||||
/// - If already authenticated, returns null.
|
||||
/// - If [login_challenge] is present in the URL query params (web), returns it.
|
||||
/// - Otherwise redirects the browser to Hydra's authorization endpoint,
|
||||
/// which will redirect back to this app with ?login_challenge=<...>.
|
||||
/// Returns null in this case (page is reloading).
|
||||
Future<String?> initFlow() async {
|
||||
if (await isAuthenticated()) return null;
|
||||
|
||||
if (kIsWeb) {
|
||||
final challenge = Uri.base.queryParameters['login_challenge'];
|
||||
if (challenge != null) return challenge;
|
||||
|
||||
// No token and no challenge: kick off the OAuth2 authorization code flow.
|
||||
// Hydra will redirect back to redirectUri with ?login_challenge=<...>.
|
||||
final authUrl = Uri.parse(OAuthConfig.authorizationEndpoint).replace(
|
||||
queryParameters: {
|
||||
'client_id': OAuthConfig.clientId,
|
||||
'response_type': 'code',
|
||||
'scope': OAuthConfig.scopes.join(' '),
|
||||
'redirect_uri': OAuthConfig.redirectUri,
|
||||
},
|
||||
).toString();
|
||||
browserRedirect(authUrl);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Headless login: POSTs credentials + challenge to the backend.
|
||||
///
|
||||
/// The backend accepts the login with Hydra and returns tokens directly.
|
||||
/// Tokens are stored in [FlutterSecureStorage] and synced to [localStorage]
|
||||
/// so that the existing API service keeps sending the Bearer header.
|
||||
Future<void> login(String username, String password, String challenge) async {
|
||||
final response = await _dio.post(
|
||||
'${OAuthConfig.host}/auth/login',
|
||||
queryParameters: {'client_id': OAuthConfig.clientId},
|
||||
data: {
|
||||
'username': username,
|
||||
'password': password,
|
||||
'challenge': challenge,
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode != 200 || response.data == null) {
|
||||
throw Exception('Login failed: ${response.statusMessage}');
|
||||
}
|
||||
|
||||
final data = Map<String, dynamic>.from(response.data as Map);
|
||||
final accessToken = data['access_token'] as String? ?? '';
|
||||
final refreshToken = data['refresh_token'] as String? ?? '';
|
||||
final idToken = data['id_token'] as String?;
|
||||
final expiresIn = data['expires_in'] as int? ?? 3600;
|
||||
|
||||
await _storage.save(
|
||||
accessToken: accessToken,
|
||||
refreshToken: refreshToken,
|
||||
idToken: idToken,
|
||||
);
|
||||
|
||||
// Sync to localStorage so api_service.dart keeps sending the Bearer header.
|
||||
localStorage.setItem('accessToken', accessToken);
|
||||
localStorage.setItem('tokenType', data['token_type'] as String? ?? 'Bearer');
|
||||
localStorage.setItem('username', username);
|
||||
localStorage.setItem(
|
||||
'expiresIn',
|
||||
DateTime.now().add(Duration(seconds: expiresIn)).toIso8601String(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Returns a valid access token, auto-refreshing via the Hydra token
|
||||
/// endpoint if the stored one is expired.
|
||||
Future<String?> getValidAccessToken() async {
|
||||
final accessToken = await _storage.getAccessToken();
|
||||
if (accessToken == null || accessToken.isEmpty) return null;
|
||||
|
||||
try {
|
||||
if (!JwtDecoder.isExpired(accessToken)) return accessToken;
|
||||
} catch (_) {
|
||||
return accessToken; // not a JWT — trust it as-is
|
||||
}
|
||||
|
||||
final refreshToken = await _storage.getRefreshToken();
|
||||
if (refreshToken == null || refreshToken.isEmpty) {
|
||||
await logout();
|
||||
return null;
|
||||
}
|
||||
return _refresh(refreshToken);
|
||||
}
|
||||
|
||||
/// Exchanges a refresh token for a new access token via the standard
|
||||
/// OAuth2 token endpoint (grant_type=refresh_token).
|
||||
Future<String?> _refresh(String refreshToken) async {
|
||||
try {
|
||||
final response = await _dio.post(
|
||||
OAuthConfig.tokenEndpoint,
|
||||
data: {
|
||||
'grant_type': 'refresh_token',
|
||||
'client_id': OAuthConfig.clientId,
|
||||
'refresh_token': refreshToken,
|
||||
'scope': OAuthConfig.scopes.join(' '),
|
||||
},
|
||||
options: Options(contentType: 'application/x-www-form-urlencoded'),
|
||||
);
|
||||
|
||||
if (response.statusCode != 200 || response.data == null) {
|
||||
await logout();
|
||||
return null;
|
||||
}
|
||||
|
||||
final data = Map<String, dynamic>.from(response.data as Map);
|
||||
final newAccess = data['access_token'] as String? ?? '';
|
||||
final newRefresh = data['refresh_token'] as String? ?? refreshToken;
|
||||
final idToken = data['id_token'] as String?;
|
||||
|
||||
await _storage.save(
|
||||
accessToken: newAccess,
|
||||
refreshToken: newRefresh,
|
||||
idToken: idToken,
|
||||
);
|
||||
localStorage.setItem('accessToken', newAccess);
|
||||
return newAccess;
|
||||
} catch (_) {
|
||||
await logout();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// Clears stored tokens and redirects to Hydra's end-session endpoint (web).
|
||||
Future<void> logout() async {
|
||||
final idToken = await _storage.getIdToken();
|
||||
await _storage.clear();
|
||||
|
||||
localStorage.setItem('accessToken', '');
|
||||
localStorage.setItem('username', '');
|
||||
localStorage.setItem('expiresIn', '');
|
||||
|
||||
if (kIsWeb && idToken != null) {
|
||||
final logoutUrl = Uri.parse(OAuthConfig.endSessionEndpoint).replace(
|
||||
queryParameters: {
|
||||
'id_token_hint': idToken,
|
||||
'post_logout_redirect_uri': OAuthConfig.redirectUri,
|
||||
},
|
||||
).toString();
|
||||
browserRedirect(logoutUrl);
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> isAuthenticated() async {
|
||||
final token = await getValidAccessToken();
|
||||
return token != null;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,6 @@ class PermsService {
|
||||
});
|
||||
}
|
||||
static bool getPerm(Perms perm) {
|
||||
return true;
|
||||
return _perms[perm] ?? false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
void browserRedirect(String url) {}
|
||||
@@ -1,4 +0,0 @@
|
||||
// ignore: avoid_web_libraries_in_flutter
|
||||
import 'dart:html' as html;
|
||||
|
||||
void browserRedirect(String url) => html.window.location.href = url;
|
||||
@@ -17,7 +17,7 @@ import 'package:go_router/go_router.dart';
|
||||
GlobalKey<RouterWidgetState> routerKey = GlobalKey<RouterWidgetState>();
|
||||
|
||||
class RouterWidget extends StatefulWidget {
|
||||
const RouterWidget({super.key});
|
||||
const RouterWidget({Key? key}) : super(key: key);
|
||||
@override RouterWidgetState createState() => RouterWidgetState();
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ class AppRouter {
|
||||
var url = await getRouteCookie();
|
||||
if (url != null && url != "") {
|
||||
for (var zone in zones) {
|
||||
print("URL: $url ${zone.route}");
|
||||
if (zone.route == url.replaceAll("/", "")) {
|
||||
Map<String, String> params = {};
|
||||
var srcParams = await getRouteParamsCookie();
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
import 'dart:async';
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:localstorage/localstorage.dart';
|
||||
import 'package:oc_front/core/services/router.dart';
|
||||
import 'package:oc_front/widgets/dialog/login.dart';
|
||||
import 'package:oc_front/core/conf/conf_reader.dart';
|
||||
import 'package:oc_front/core/sections/left_menu.dart';
|
||||
import 'package:oc_front/core/sections/end_drawer.dart';
|
||||
import 'package:oc_front/core/sections/header/menu.dart';
|
||||
import 'package:oc_front/core/services/auth.service.dart';
|
||||
import 'package:oc_front/core/services/oauth2.service.dart';
|
||||
import 'package:oc_front/core/services/enum_service.dart';
|
||||
import 'package:oc_front/core/models/workspace_local.dart';
|
||||
import 'package:oc_front/core/sections/header/header.dart';
|
||||
|
||||
import 'package:oc_front/core/sections/header/menu.dart';
|
||||
import 'package:oc_front/core/sections/left_menu.dart';
|
||||
import 'package:oc_front/core/services/auth.service.dart';
|
||||
import 'package:oc_front/core/services/enum_service.dart';
|
||||
import 'package:oc_front/core/services/router.dart';
|
||||
import 'package:oc_front/core/sections/end_drawer.dart';
|
||||
import 'package:oc_front/widgets/dialog/login.dart';
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
// Run `LinuxWebViewPlugin.initialize()` first before creating a WebView.
|
||||
@@ -31,7 +30,6 @@ class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Future.delayed(Duration(seconds: 2), () => AppRouter.verifyRoute(context));
|
||||
AppConfig().loadConfig();
|
||||
AuthService.init();
|
||||
EnumService.init();
|
||||
SearchConstants.clear();
|
||||
@@ -58,11 +56,11 @@ class MainPage extends StatefulWidget {
|
||||
State<MainPage> createState() => MainPageState();
|
||||
}
|
||||
|
||||
var darkColor = const Color.fromRGBO(26, 83, 92, 1);
|
||||
var lightColor = const Color.fromRGBO(78, 205, 196, 1);
|
||||
var darkMidColor = const Color.fromRGBO(44, 83, 100, 1);
|
||||
var midColor = Colors.grey.shade300;
|
||||
var redColor = const Color.fromRGBO(255, 107, 107, 1);
|
||||
var darkColor = Color.fromRGBO(26, 83, 92, 1);
|
||||
var lightColor = Color.fromRGBO(78, 205, 196, 1);
|
||||
var darkMidColor = Color.fromRGBO(44, 83, 100, 1);
|
||||
var midColor = Colors.grey.shade300;
|
||||
var redColor = Color.fromRGBO(255, 107, 107, 1);
|
||||
|
||||
double getWidth(BuildContext context) {
|
||||
return MediaQuery.of(context).size.width <= 800
|
||||
@@ -101,17 +99,10 @@ class MainPageState extends State<MainPage> {
|
||||
// The Flutter framework has been optimized to make rerunning build methods
|
||||
// fast, so that you can just rebuild anything that needs updating rather
|
||||
// than having to individually change instances of widgets.i
|
||||
|
||||
scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
if (!AuthService.isConnected() && !loginIsSet) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () async {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
loginIsSet = true;
|
||||
// initFlow() returns the login_challenge from the URL if present,
|
||||
// or redirects the browser to Hydra's auth endpoint (web) and
|
||||
// returns null while the page reloads with ?login_challenge=<...>.
|
||||
final challenge = await OAuth2Service().initFlow();
|
||||
if (challenge == null) return;
|
||||
// ignore: use_build_context_synchronously
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
// ignore: use_build_context_synchronously
|
||||
@@ -121,7 +112,7 @@ class MainPageState extends State<MainPage> {
|
||||
backgroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(0)),
|
||||
title: LoginWidget(loginChallenge: challenge));
|
||||
title: LoginWidget());
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -147,6 +138,7 @@ class MainPageState extends State<MainPage> {
|
||||
onKeyEvent: (event) async {
|
||||
if( (event is KeyDownEvent) && event.logicalKey == LogicalKeyboardKey.enter) {
|
||||
AppRouter.currentRoute.factory.search(context, false);
|
||||
node.requestFocus();
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
|
||||
@@ -72,6 +72,7 @@ class Log extends SerializerDeserializer<Log> {
|
||||
|
||||
String getMessage(String mess) {
|
||||
var jsonString = mess;
|
||||
print(mess);
|
||||
try {
|
||||
var j = JsonString(mess.replaceAll("\\", "")).decodedValue as Map<String, dynamic>;
|
||||
map = j;
|
||||
@@ -80,7 +81,7 @@ class Log extends SerializerDeserializer<Log> {
|
||||
} 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 ''; })}";
|
||||
}
|
||||
} on JsonFormatException catch (_) { /* */ }
|
||||
} on JsonFormatException catch (e) { /* */ }
|
||||
message = jsonString;
|
||||
return jsonString;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import 'package:oc_front/models/resources/data.dart';
|
||||
import 'package:oc_front/models/resources/processing.dart';
|
||||
import 'package:oc_front/models/resources/storage.dart';
|
||||
import 'package:oc_front/models/resources/workflow.dart';
|
||||
import 'package:oc_front/models/resources/workflow_event.dart';
|
||||
|
||||
class Resource implements SerializerDeserializer<Resource> {
|
||||
List<DataItem> datas = [];
|
||||
@@ -328,10 +327,11 @@ abstract class AbstractInstance<X extends AbstractPricing, S extends AbstractPar
|
||||
String? name;
|
||||
int? countryCode;
|
||||
Location? location;
|
||||
//List<S> partnerships = [];
|
||||
List<S> partnerships = [];
|
||||
List<Param> env = [];
|
||||
List<Param> inputs = [];
|
||||
List<Param> outputs = [];
|
||||
Credential? credential;
|
||||
|
||||
|
||||
bool isEnv(String key) {
|
||||
@@ -361,7 +361,8 @@ abstract class AbstractInstance<X extends AbstractPricing, S extends AbstractPar
|
||||
this.inputs = json.containsKey("inputs") ? fromListJson(json["inputs"], Param()) : [];
|
||||
this.outputs = json.containsKey("outputs") ? fromListJson(json["outputs"], Param()) : [];
|
||||
this.location = json.containsKey("location") ? Location().deserialize(json["location"]) : null;
|
||||
//this.partnerships = json.containsKey("partnerships") ? fromListJson(json["partnerships"], ex) : [];
|
||||
this.credential = json.containsKey("credential") ? Credential().deserialize(json["credential"]) : null;
|
||||
this.partnerships = json.containsKey("partnerships") ? fromListJson(json["partnerships"], ex) : [];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJSON() {
|
||||
@@ -373,7 +374,8 @@ abstract class AbstractInstance<X extends AbstractPricing, S extends AbstractPar
|
||||
"env": toListJson(env),
|
||||
"inputs": toListJson(inputs),
|
||||
"outputs": toListJson(outputs),
|
||||
//"partnerships": partnerships.map((e) => e.serialize()).toList(),
|
||||
"credential": credential?.serialize(), // TODO CREDENTIAL FORM
|
||||
"partnerships": partnerships.map((e) => e.serialize()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -504,7 +506,6 @@ Type? getTopicType(String topic) {
|
||||
else if (topic == "compute") { return ComputeItem; }
|
||||
else if (topic == "storage") { return StorageItem; }
|
||||
else if (topic == "workflow") { return WorkflowItem; }
|
||||
else if (topic == "event") { return WorkflowEventItem; }
|
||||
else { return null; }
|
||||
}
|
||||
|
||||
@@ -515,7 +516,6 @@ String getTopic(Type type) {
|
||||
if (type == ComputeItem) { return "compute"; }
|
||||
if (type == StorageItem) { return "storage"; }
|
||||
if (type == WorkflowItem) { return "workflow"; }
|
||||
if (type == WorkflowEventItem) { return "event"; }
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ class StorageItem extends AbstractItem<StoragePricing, StoragePartnership, Stora
|
||||
obj.addAll(toJSON());
|
||||
return obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class StorageInstance extends AbstractInstance<StoragePricing, StoragePartnership> {
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
|
||||
import 'package:oc_front/models/resources/resources.dart';
|
||||
|
||||
class WorkflowEventItem extends AbstractItem<WorkflowEventPricing, WorkflowEventPartnership, WorkflowEventInstance, WorkflowEventItem> {
|
||||
// workflow_execution_id: id of the workflow execution this event targets
|
||||
String? workflowExecutionId;
|
||||
|
||||
WorkflowEventItem({
|
||||
this.workflowExecutionId,
|
||||
}) : super();
|
||||
|
||||
@override String get topic => "event";
|
||||
|
||||
@override WorkflowEventItem deserialize(dynamic data) {
|
||||
try { data = data as Map<String, dynamic>;
|
||||
} catch (e) { return WorkflowEventItem(); }
|
||||
var w = WorkflowEventItem(
|
||||
workflowExecutionId: data.containsKey("workflow_execution_id") && data["workflow_execution_id"] != null
|
||||
? data["workflow_execution_id"] : null,
|
||||
);
|
||||
w.mapFromJSON(data, WorkflowEventInstance());
|
||||
return w;
|
||||
}
|
||||
|
||||
@override Map<String, dynamic> infos() {
|
||||
return {
|
||||
if (workflowExecutionId != null) "workflow_execution_id": workflowExecutionId,
|
||||
};
|
||||
}
|
||||
|
||||
@override Map<String, dynamic> serialize() {
|
||||
var obj = <String, dynamic>{
|
||||
"workflow_execution_id": workflowExecutionId,
|
||||
};
|
||||
obj.addAll(toJSON());
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
class WorkflowEventInstance extends AbstractInstance<WorkflowEventPricing, WorkflowEventPartnership> {
|
||||
WorkflowEventInstance() : super();
|
||||
|
||||
@override WorkflowEventInstance deserialize(dynamic json) {
|
||||
try { json = json as Map<String, dynamic>;
|
||||
} catch (e) { return WorkflowEventInstance(); }
|
||||
var w = WorkflowEventInstance();
|
||||
w.mapFromJSON(json, WorkflowEventPartnership());
|
||||
return w;
|
||||
}
|
||||
|
||||
@override Map<String, dynamic> infos() => {};
|
||||
|
||||
@override Map<String, dynamic> serialize() => toJSON();
|
||||
}
|
||||
|
||||
class WorkflowEventPartnership extends AbstractPartnerShip<WorkflowEventPricing> {
|
||||
WorkflowEventPartnership() : super();
|
||||
|
||||
@override WorkflowEventPartnership deserialize(dynamic json) {
|
||||
try { json = json as Map<String, dynamic>;
|
||||
} catch (e) { return WorkflowEventPartnership(); }
|
||||
var w = WorkflowEventPartnership();
|
||||
w.mapFromJSON(json, WorkflowEventPricing());
|
||||
return w;
|
||||
}
|
||||
|
||||
@override Map<String, dynamic> serialize() => toJSON();
|
||||
}
|
||||
|
||||
class WorkflowEventPricing extends AbstractPricing {
|
||||
@override WorkflowEventPricing deserialize(dynamic json) {
|
||||
var w = WorkflowEventPricing();
|
||||
w.mapFromJSON(json);
|
||||
return w;
|
||||
}
|
||||
@override Map<String, dynamic> serialize() => toJSON();
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import 'package:oc_front/models/resources/processing.dart';
|
||||
import 'package:oc_front/models/resources/resources.dart';
|
||||
import 'package:oc_front/models/resources/storage.dart';
|
||||
import 'package:oc_front/models/resources/workflow.dart';
|
||||
import 'package:oc_front/models/resources/workflow_event.dart';
|
||||
import 'package:oc_front/models/response.dart';
|
||||
import 'package:oc_front/widgets/forms/sub_keys_forms.dart';
|
||||
|
||||
@@ -109,7 +108,6 @@ class Workflow extends SerializerDeserializer<Workflow> implements ShallowData
|
||||
List<dynamic> storage;
|
||||
List<dynamic> processing;
|
||||
List<dynamic> workflows;
|
||||
List<dynamic> events;
|
||||
Graph? graph;
|
||||
List<dynamic> shared;
|
||||
|
||||
@@ -121,7 +119,6 @@ class Workflow extends SerializerDeserializer<Workflow> implements ShallowData
|
||||
this.storage = const [],
|
||||
this.processing = const [],
|
||||
this.workflows = const [],
|
||||
this.events = const [],
|
||||
this.graph,
|
||||
this.shared = const [],
|
||||
});
|
||||
@@ -141,7 +138,6 @@ class Workflow extends SerializerDeserializer<Workflow> implements ShallowData
|
||||
compute: json.containsKey("computes") ? json["computes"] : [],
|
||||
data: json.containsKey("datas") ? json["datas"] : [],
|
||||
storage: json.containsKey("storages") ? json["storages"] : [],
|
||||
events: json.containsKey("events") ? json["events"] : [],
|
||||
shared: json.containsKey("shared") ? json["shared"] : [],
|
||||
graph: json.containsKey("graph") ? Graph().deserialize(json["graph"]) : null,
|
||||
);
|
||||
@@ -155,7 +151,6 @@ class Workflow extends SerializerDeserializer<Workflow> implements ShallowData
|
||||
"computes" : compute,
|
||||
"workflows": workflows,
|
||||
"processings": processing,
|
||||
"events": events,
|
||||
};
|
||||
if (graph != null) {
|
||||
obj["graph"] = graph!.serialize();
|
||||
@@ -339,25 +334,24 @@ class Graph extends SerializerDeserializer<Graph> {
|
||||
}
|
||||
// should find arrow env info and add it to the env
|
||||
List<Param> extParams = [];
|
||||
// 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 info in arrow.infos) {
|
||||
var i = info as Map<String, dynamic>;
|
||||
for (var entry in i.entries) {
|
||||
if (entry.value == null) { continue; }
|
||||
var arrows = links.where( (e) => (e.source?.id?.contains(item.id ?? "") ?? false) || (e.destination?.id?.contains(item.id ?? "") ?? false));
|
||||
for (var arrow in arrows) {
|
||||
|
||||
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;
|
||||
if ((alreadySeen[varName] ?? 0) > 1) {
|
||||
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) {
|
||||
if (param.attr == null) { continue; }
|
||||
var varName = param.name != null && (param.name!.contains("LINK_")
|
||||
@@ -366,7 +360,7 @@ class Graph extends SerializerDeserializer<Graph> {
|
||||
|| param.name!.contains("STORAGE_")
|
||||
|| param.name!.contains("WORKFLOW_")
|
||||
|| param.name!.contains("COMPUTE") ) ? param.name : "${el.topic.toUpperCase()}_${el.getName().toUpperCase().replaceAll(" ", "_")}_${param.attr!.toUpperCase()}";
|
||||
/*alreadySeen[varName] = (alreInstanceadySeen[varName] ?? -1) + 1;
|
||||
/*alreadySeen[varName] = (alreadySeen[varName] ?? -1) + 1;
|
||||
if ((alreadySeen[varName] ?? 0) > 0) {
|
||||
varName = "${varName}_${alreadySeen[varName]}";
|
||||
}*/
|
||||
@@ -530,6 +524,7 @@ class GraphLink extends SerializerDeserializer<GraphLink> {
|
||||
destination = Position(id: j["to"]["id"], x: j["to"]["x"], y: j["to"]["y"]);
|
||||
style = GraphLinkStyle();
|
||||
style!.fromDashboard(j["params"]);
|
||||
print(j["infos"]);
|
||||
infos = fromListJson(j["infos"], StorageProcessingGraphLink());
|
||||
env = fromListJson(j["env"], Param());
|
||||
}
|
||||
@@ -695,7 +690,6 @@ class GraphItem extends SerializerDeserializer<GraphItem> {
|
||||
StorageItem? storage;
|
||||
ComputeItem? compute;
|
||||
WorkflowItem? workflow;
|
||||
WorkflowEventItem? event;
|
||||
|
||||
GraphItem({
|
||||
this.id,
|
||||
@@ -707,7 +701,6 @@ class GraphItem extends SerializerDeserializer<GraphItem> {
|
||||
this.storage,
|
||||
this.compute,
|
||||
this.workflow,
|
||||
this.event,
|
||||
});
|
||||
|
||||
AbstractItem? getElement() {
|
||||
@@ -716,7 +709,6 @@ class GraphItem extends SerializerDeserializer<GraphItem> {
|
||||
if (storage != null) { return storage!; }
|
||||
if (compute != null) { return compute!; }
|
||||
if (workflow != null) { return workflow!; }
|
||||
if (event != null) { return event!; }
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -728,19 +720,17 @@ class GraphItem extends SerializerDeserializer<GraphItem> {
|
||||
height = j["height"];
|
||||
|
||||
if (j["element"] != null) {
|
||||
if (j["element"]["type"] == "data") { data = DataItem().deserialize(j["element"]);
|
||||
if (j["element"]["type"] == "data") { data = DataItem().deserialize(j["element"]);
|
||||
} else if (j["element"]["type"] == "processing") { processing = ProcessingItem().deserialize(j["element"]);
|
||||
} else if (j["element"]["type"] == "compute") { compute = ComputeItem().deserialize(j["element"]);
|
||||
} else if (j["element"]["type"] == "storage") { storage = StorageItem().deserialize(j["element"]);
|
||||
} else if (j["element"]["type"] == "workflow") { workflow = WorkflowItem().deserialize(j["element"]);
|
||||
} else if (j["element"]["type"] == "event") { event = WorkflowEventItem().deserialize(j["element"]);
|
||||
} else if (j["element"]["type"] == "compute") { compute = ComputeItem().deserialize(j["element"]);
|
||||
} else if (j["element"]["type"] == "storage") { storage = StorageItem().deserialize(j["element"]);
|
||||
} else if (j["element"]["type"] == "workflow") { workflow = WorkflowItem().deserialize(j["element"]);
|
||||
} else {
|
||||
compute = null;
|
||||
data = null;
|
||||
processing = null;
|
||||
storage = null;
|
||||
workflow = null;
|
||||
event = null;
|
||||
}
|
||||
} else {
|
||||
compute = null;
|
||||
@@ -748,13 +738,12 @@ class GraphItem extends SerializerDeserializer<GraphItem> {
|
||||
processing = null;
|
||||
storage = null;
|
||||
workflow = null;
|
||||
event = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toDashboard() {
|
||||
Map<String, dynamic> element = {};
|
||||
List<AbstractItem?> items = [data, processing, storage, compute, workflow, event];
|
||||
List<AbstractItem?> items = [data, processing, storage, compute, workflow];
|
||||
for(var el in items) {
|
||||
if (el != null && el.getID() != "") {
|
||||
element = el.serialize();
|
||||
@@ -773,7 +762,7 @@ class GraphItem extends SerializerDeserializer<GraphItem> {
|
||||
|
||||
@override deserialize(dynamic json) {
|
||||
try { json = json as Map<String, dynamic>;
|
||||
} catch (e) { return GraphItem(); }
|
||||
} catch (e) { return GraphItem(); }
|
||||
return GraphItem(
|
||||
id: json.containsKey("id") ? json["id"] : null,
|
||||
width: json.containsKey("width") ? double.parse(json["width"].toString()) : null,
|
||||
@@ -784,10 +773,9 @@ class GraphItem extends SerializerDeserializer<GraphItem> {
|
||||
storage: json.containsKey("storage") ? StorageItem().deserialize(json["storage"]) : null,
|
||||
compute: json.containsKey("compute") ? ComputeItem().deserialize(json["compute"]) : null,
|
||||
workflow: json.containsKey("workflow") ? WorkflowItem().deserialize(json["workflow"]) : null,
|
||||
event: json.containsKey("event") ? WorkflowEventItem().deserialize(json["event"]) : null,
|
||||
);
|
||||
}
|
||||
@override Map<String, dynamic> serialize() {
|
||||
@override Map<String, dynamic> serialize() {
|
||||
return {
|
||||
"id": id,
|
||||
"width": width,
|
||||
@@ -797,7 +785,6 @@ class GraphItem extends SerializerDeserializer<GraphItem> {
|
||||
"storage": storage?.serialize(),
|
||||
"compute": compute?.serialize(),
|
||||
"workflow": workflow?.serialize(),
|
||||
"event": event?.serialize(),
|
||||
"position": position?.serialize(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class CatalogItemFactory implements AbstractFactory {
|
||||
if (special) { return; } // T
|
||||
var s = SearchConstants.get();
|
||||
AppRouter.catalog.go(context, {});
|
||||
Future.delayed(const Duration(milliseconds: 10), () {
|
||||
Future.delayed(Duration(milliseconds: 10), () {
|
||||
SearchConstants.set(s);
|
||||
CatalogFactory().search(context, false);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
|
||||
import 'package:flutter/material.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:intl/intl.dart' as intl;
|
||||
import 'package:oc_front/pages/abstract_page.dart';
|
||||
@@ -21,6 +22,7 @@ class ComputePageWidget extends StatefulWidget {
|
||||
bool isList = true;
|
||||
DateTime start = DateTime.now();
|
||||
DateTime end = DateTime.now().add(const Duration(days: 180));
|
||||
final BookingExecutionService _service = BookingExecutionService();
|
||||
|
||||
ComputePageWidget () : super(key: DatacenterFactory.key);
|
||||
@override ComputePageWidgetState createState() => ComputePageWidgetState();
|
||||
@@ -64,7 +66,7 @@ class ComputePageWidgetState extends State<ComputePageWidget> {
|
||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
colorScheme: ColorScheme.light(
|
||||
surface: midColor,
|
||||
background: midColor,
|
||||
tertiary: Colors.grey,
|
||||
secondary: Colors.grey,
|
||||
primary: Colors.black),
|
||||
@@ -122,7 +124,7 @@ class ComputePageWidgetState extends State<ComputePageWidget> {
|
||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
colorScheme: ColorScheme.light(
|
||||
surface: midColor,
|
||||
background: midColor,
|
||||
tertiary: Colors.grey,
|
||||
secondary: Colors.grey,
|
||||
primary: Colors.black),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:flutter_map/flutter_map.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/resources.dart';
|
||||
import 'package:oc_front/models/resources/storage.dart';
|
||||
@@ -23,7 +24,6 @@ class MapFactory implements AbstractFactory {
|
||||
@override void search(BuildContext context, bool special) { }
|
||||
}
|
||||
double menuSize = 0;
|
||||
// ignore: must_be_immutable
|
||||
class MapPageWidget extends StatefulWidget {
|
||||
bool isShowed = false;
|
||||
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(
|
||||
child : FlutterMap(
|
||||
mapController: _mapController,
|
||||
@@ -111,7 +113,6 @@ class HoverMenuController {
|
||||
}
|
||||
}
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class HoverMenu extends StatefulWidget {
|
||||
final Widget title;
|
||||
final double? width;
|
||||
@@ -121,12 +122,12 @@ class HoverMenu extends StatefulWidget {
|
||||
|
||||
|
||||
HoverMenu({
|
||||
super.key,
|
||||
Key? key,
|
||||
required this.title,
|
||||
this.items = const [],
|
||||
this.width,
|
||||
this.controller,
|
||||
});
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
HoverMenuState createState() => HoverMenuState();
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
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/pages/abstract_page.dart';
|
||||
import 'package:oc_front/widgets/sheduler_items/schedule.dart';
|
||||
@@ -21,6 +22,7 @@ class SchedulerPageWidget extends StatefulWidget {
|
||||
bool isList = true;
|
||||
DateTime start = DateTime.now();
|
||||
DateTime end = DateTime.now().add(const Duration(days: 180));
|
||||
final WorkflowExecutionService _service = WorkflowExecutionService();
|
||||
SchedulerPageWidget(): super(key: SchedulerFactory.key);
|
||||
@override SchedulerPageWidgetState createState() => SchedulerPageWidgetState();
|
||||
static void search(BuildContext context) { }
|
||||
@@ -60,7 +62,7 @@ class SchedulerPageWidgetState extends State<SchedulerPageWidget> {
|
||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
colorScheme: ColorScheme.light(
|
||||
surface: midColor,
|
||||
background: midColor,
|
||||
tertiary: Colors.grey,
|
||||
secondary: Colors.grey,
|
||||
primary: Colors.black),
|
||||
@@ -118,7 +120,7 @@ class SchedulerPageWidgetState extends State<SchedulerPageWidget> {
|
||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
colorScheme: ColorScheme.light(
|
||||
surface: midColor,
|
||||
background: midColor,
|
||||
tertiary: Colors.grey,
|
||||
secondary: Colors.grey,
|
||||
primary: Colors.black),
|
||||
|
||||
@@ -12,15 +12,12 @@ import 'package:oc_front/models/resources/processing.dart';
|
||||
import 'package:oc_front/models/resources/resources.dart';
|
||||
import 'package:oc_front/models/resources/storage.dart';
|
||||
import 'package:oc_front/models/resources/workflow.dart';
|
||||
import 'package:oc_front/models/resources/workflow_event.dart';
|
||||
import 'package:oc_front/models/response.dart';
|
||||
import 'package:oc_front/models/workflow.dart';
|
||||
import 'package:oc_front/pages/abstract_page.dart';
|
||||
import 'package:oc_front/pages/shared.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:oc_front/widgets/dialog/shallow_creation.dart';
|
||||
import 'package:oc_front/widgets/forms/resource_forms.dart';
|
||||
import 'package:oc_front/widgets/forms/workflow_event_forms.dart';
|
||||
import 'package:oc_front/widgets/forms/scheduler_forms.dart';
|
||||
import 'package:oc_front/widgets/forms/storage_processing_link_forms.dart';
|
||||
import 'package:oc_front/widgets/items/item_row.dart';
|
||||
@@ -55,15 +52,9 @@ class WorkflowPageWidgetState extends State<WorkflowPageWidget> {
|
||||
final WorflowService _service = WorflowService();
|
||||
Widget itemBuild(Object item) {
|
||||
var e = item as AbstractItem;
|
||||
if (e is WorkflowEventItem) {
|
||||
return Tooltip(
|
||||
message: e.name ?? "Event",
|
||||
child: SvgPicture.asset('assets/images/workflow_event.svg', fit: BoxFit.contain),
|
||||
);
|
||||
}
|
||||
return Tooltip( message: item.name ?? "",
|
||||
child: e.logo != null ? Image.network(e.logo ?? "", fit: BoxFit.fill)
|
||||
: Image.network('https://get-picto.com/wp-content/uploads/2024/01/logo-instagram-png.webp',
|
||||
child: e.logo != null ? Image.network(e.logo ?? "", fit: BoxFit.fill)
|
||||
: Image.network('https://get-picto.com/wp-content/uploads/2024/01/logo-instagram-png.webp',
|
||||
fit: BoxFit.fill));
|
||||
}
|
||||
Widget itemTooltipBuild(Object item) {
|
||||
@@ -75,8 +66,7 @@ final WorflowService _service = WorflowService();
|
||||
var from = dash.getElement(arrow.fromID);
|
||||
var to = dash.getElement(arrow.toID);
|
||||
if ((from?.element?.getType() == "storage" && to?.element?.getType() == "processing")
|
||||
|| (from?.element?.getType() == "processing" && to?.element?.getType() == "storage")
|
||||
|| (from?.element?.getType() == "processing" && to?.element?.getType() == "processing")) {
|
||||
|| (from?.element?.getType() == "processing" && to?.element?.getType() == "storage")) {
|
||||
return StorageProcessingLinkFormsWidget( dash: dash, item: arrow);
|
||||
}
|
||||
return Container();
|
||||
@@ -84,13 +74,8 @@ final WorflowService _service = WorflowService();
|
||||
List<Widget> getForms(FlowData? obj, String id) {
|
||||
var objAbs = obj as AbstractItem?;
|
||||
if (objAbs == null) { return []; }
|
||||
List<Widget> res;
|
||||
if (objAbs is WorkflowEventItem) {
|
||||
res = [ WorkflowEventFormsWidget(item: objAbs, dash: dash, elementID: id) ];
|
||||
} else {
|
||||
res = [ ResourceFormsWidget(item: objAbs, dash: dash, elementID: id) ];
|
||||
}
|
||||
return [ Wrap(
|
||||
List<Widget> res = [ ResourceFormsWidget(item: objAbs, dash: dash, elementID: id) ];
|
||||
return [ Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: [
|
||||
Container( padding: const EdgeInsets.all(10), width: 250, height: 60,
|
||||
@@ -98,7 +83,7 @@ final WorflowService _service = WorflowService();
|
||||
child: const Column( mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Text("ELEMENT INFO", style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
||||
Text("<general>", style: TextStyle(fontSize: 12), textAlign: TextAlign.center),
|
||||
])),
|
||||
])),
|
||||
...res
|
||||
]) ];
|
||||
}
|
||||
@@ -138,8 +123,6 @@ final WorflowService _service = WorflowService();
|
||||
return const Icon(FontAwesomeIcons.microchip, size: 16);
|
||||
} else if (objAbs.topic == "workflows" ) {
|
||||
return const Icon(FontAwesomeIcons.diagramProject, size: 16);
|
||||
} else if (objAbs.topic == "event" ) {
|
||||
return const Icon(FontAwesomeIcons.bolt, size: 16);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -183,7 +166,6 @@ final WorflowService _service = WorflowService();
|
||||
var storage = dash.elements.where( (e) => e.element?.serialize()["type"] == "storage");
|
||||
var processing = dash.elements.where( (e) => e.element?.serialize()["type"] == "processing");
|
||||
var workflows = dash.elements.where( (e) => e.element?.serialize()["type"] == "workflow");
|
||||
var events = dash.elements.where( (e) => e.element?.serialize()["type"] == "event");
|
||||
var updateW = Workflow(
|
||||
name: dash.name,
|
||||
graph: Graph(),
|
||||
@@ -192,7 +174,6 @@ final WorflowService _service = WorflowService();
|
||||
storage: storage.map((e) => e.element?.getID()).toSet().toList(),
|
||||
processing: processing.map((e) => e.element?.getID()).toSet().toList(),
|
||||
workflows: workflows.map((e) => e.element?.getID()).toSet().toList(),
|
||||
events: events.map((e) => e.element?.getID()).toSet().toList(),
|
||||
);
|
||||
updateW.fromDashboard(dash.serialize());
|
||||
for (var item in (updateW.graph?.items.values ?? [] as List<GraphItem>)) {
|
||||
@@ -228,7 +209,6 @@ final WorflowService _service = WorflowService();
|
||||
if (data["type"] == "storage") { return StorageItem().deserialize(data); }
|
||||
if (data["type"] == "processing") { return ProcessingItem().deserialize(data); }
|
||||
if (data["type"] == "workflows") { return WorkflowItem().deserialize(data); }
|
||||
if (data["type"] == "event") { return WorkflowEventItem().deserialize(data); }
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -358,13 +338,8 @@ final WorflowService _service = WorflowService();
|
||||
current: widget.id,
|
||||
itemWidget: itemBuild,
|
||||
menuWidget: onDashboardMenu,
|
||||
categories: const ["processing", "data", "compute", "storage", "workflows", "event"],
|
||||
draggableItemBuilder: (cat) {
|
||||
if (cat == "event") {
|
||||
return [ WorkflowEventItem()..name = "Event"..type = "event" ];
|
||||
}
|
||||
return WorkspaceLocal.byTopic(cat, false);
|
||||
},
|
||||
categories: const ["processing", "data", "compute", "storage", "workflows"],
|
||||
draggableItemBuilder: (cat) => WorkspaceLocal.byTopic(cat, false),
|
||||
itemWidgetTooltip: itemTooltipBuild,
|
||||
innerMenuWidth: 350,
|
||||
width: getMainWidth(context),
|
||||
|
||||
@@ -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/core/models/workspace_local.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class CatalogWidget extends StatefulWidget {
|
||||
double? itemWidth;
|
||||
bool readOnly = false;
|
||||
|
||||
@@ -2,14 +2,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:oc_front/core/services/oauth2.service.dart';
|
||||
import 'package:oc_front/core/services/auth.service.dart';
|
||||
import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/pages/workflow.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class LoginWidget extends StatefulWidget {
|
||||
String? loginChallenge;
|
||||
LoginWidget ({ super.key, required this.loginChallenge });
|
||||
LoginWidget ({ Key? key }): super(key: key);
|
||||
@override LoginWidgetState createState() => LoginWidgetState();
|
||||
}
|
||||
class LoginWidgetState extends State<LoginWidget> {
|
||||
@@ -20,8 +18,7 @@ class LoginWidgetState extends State<LoginWidget> {
|
||||
bool loading = false;
|
||||
FocusNode focusNode = FocusNode();
|
||||
@override Widget build(BuildContext context) {
|
||||
return KeyboardListener(
|
||||
focusNode: focusNode,
|
||||
return KeyboardListener(focusNode: focusNode,
|
||||
onKeyEvent: (value) async {
|
||||
if (value is KeyDownEvent && value.logicalKey == LogicalKeyboardKey.enter) {
|
||||
if (usernameCtrl.text == "" || passwordCtrl.text == "") { return; }
|
||||
@@ -29,7 +26,7 @@ class LoginWidgetState extends State<LoginWidget> {
|
||||
setState(() {
|
||||
loading = true;
|
||||
});
|
||||
await OAuth2Service().login(usernameCtrl.text, passwordCtrl.text, widget.loginChallenge ?? '').catchError( (e) {
|
||||
await AuthService.login(usernameCtrl.text, passwordCtrl.text).catchError( (e) {
|
||||
setState(() {
|
||||
loading = false;
|
||||
error = "Invalid username or password";
|
||||
@@ -50,8 +47,8 @@ class LoginWidgetState extends State<LoginWidget> {
|
||||
},
|
||||
child: Container( padding: const EdgeInsets.all(50), child: Column(children: [
|
||||
getMainHeight(context) < 600 ? Container() : SizedBox( width: getMainWidth(context) / 4, height: getMainHeight(context) / 4,
|
||||
child: const FittedBox(
|
||||
child:Center(child: Icon(Icons.person_search, size: 150, color: Colors.grey,)))),
|
||||
child: FittedBox(
|
||||
child:const Center(child: Icon(Icons.person_search, size: 150, color: Colors.grey,)))),
|
||||
Center(child: Padding( padding: const EdgeInsets.only(top: 5, bottom: 20),
|
||||
child: Text("WELCOME ON OPENCLOUD", style: TextStyle(fontSize: 25, fontWeight: FontWeight.w600,
|
||||
color: lightColor ), overflow: TextOverflow.ellipsis, ))),
|
||||
@@ -110,7 +107,7 @@ class LoginWidgetState extends State<LoginWidget> {
|
||||
setState(() {
|
||||
loading = true;
|
||||
});
|
||||
await OAuth2Service().login(usernameCtrl.text, passwordCtrl.text, widget.loginChallenge ?? '').catchError( (e) {
|
||||
await AuthService.login(usernameCtrl.text, passwordCtrl.text).catchError( (e) {
|
||||
setState(() {
|
||||
loading = false;
|
||||
error = "Invalid username or password";
|
||||
|
||||
@@ -20,25 +20,14 @@ class ContainerFormsWidgetState extends State<ContainerFormsWidget> {
|
||||
List<Widget> widgets = [];
|
||||
var instance = widget.item.getSelectedInstance();
|
||||
if (instance != null && instance is ProcessingInstance && instance.access?.container != null) {
|
||||
List<SubExposeFormsWidget> exposes = [];
|
||||
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(
|
||||
padding: const EdgeInsets.only(bottom: 10),
|
||||
width: 180,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
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) { },
|
||||
initialValue: container.image, readOnly: true),
|
||||
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);
|
||||
}, initialValue: container.command, readOnly: false),
|
||||
}, initialValue: container.command, readOnly: false,),
|
||||
SubTextInputWidget(subkey: "args", width: 180, empty: false, change: (value) {
|
||||
container.args = value;
|
||||
for (var el in widget.dash.elements) {
|
||||
@@ -65,7 +54,7 @@ class ContainerFormsWidgetState extends State<ContainerFormsWidget> {
|
||||
],)
|
||||
));
|
||||
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(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
@@ -97,19 +86,19 @@ class ContainerFormsWidgetState extends State<ContainerFormsWidget> {
|
||||
setState(() {});
|
||||
}, child:
|
||||
Container( margin: const EdgeInsets.only(left: 5, top: 5),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(color: Colors.grey, width: 1)
|
||||
),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.grey, width: 1)),
|
||||
width: 45, height: 30,
|
||||
child: const Row( mainAxisAlignment: MainAxisAlignment.center,
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ class CredentialsFormsWidgetState extends State<CredentialsFormsWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
List<Widget> widgets = [];
|
||||
var instance = widget.item.getSelectedInstance();
|
||||
/*if (instance != null && instance.credential != null) {
|
||||
if (instance != null && instance.credential != null) {
|
||||
var creds = instance.credential!;
|
||||
widgets.add(Container( margin: const EdgeInsets.only(bottom: 15),
|
||||
width: 200, decoration: const BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
||||
widgets.add(Container( margin: EdgeInsets.only(bottom: 15),
|
||||
width: 200, decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
||||
));
|
||||
widgets.add(Container(
|
||||
padding: const EdgeInsets.only(bottom: 10),
|
||||
@@ -28,9 +28,9 @@ class CredentialsFormsWidgetState extends State<CredentialsFormsWidget> {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
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) {
|
||||
creds.login = value;
|
||||
creds.password = value;
|
||||
for (var el in widget.dash.elements) {
|
||||
if (el.id == widget.elementID) {
|
||||
el.element = widget.item;
|
||||
@@ -52,7 +52,7 @@ class CredentialsFormsWidgetState extends State<CredentialsFormsWidget> {
|
||||
],)
|
||||
));
|
||||
widgets.add(Container( padding: EdgeInsets.only(bottom: 15), width: 200 ));
|
||||
}*/
|
||||
}
|
||||
return Column(children: widgets);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:oc_front/main.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/core/services/perms_service.dart';
|
||||
import 'package:oc_front/widgets/forms/credentials_forms.dart';
|
||||
@@ -36,7 +37,7 @@ class ResourceFormsWidgetState extends State<ResourceFormsWidget> {
|
||||
}
|
||||
}
|
||||
if (widgets.isNotEmpty) {
|
||||
widgets.add(const SizedBox( width: 200, height: 15) );
|
||||
widgets.add(SizedBox( width: 200, height: 15) );
|
||||
}
|
||||
return widgets;
|
||||
}
|
||||
@@ -54,7 +55,6 @@ class ResourceFormsWidgetState extends State<ResourceFormsWidget> {
|
||||
|
||||
|
||||
@override Widget build(BuildContext context) {
|
||||
print("STATE");
|
||||
List<Widget> instancesCat = [];
|
||||
List<Widget> childrenReadOnly = getWidgets(widget.item.infos());
|
||||
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,)));
|
||||
}
|
||||
if (dpItems.isNotEmpty) {
|
||||
childrenReadOnly.add(Padding( padding: const EdgeInsets.only(top: 20),
|
||||
childrenReadOnly.add(Padding( padding: EdgeInsets.only(top: 20),
|
||||
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,
|
||||
initialValue: "${widget.item.selectedInstance}", change: (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));
|
||||
if (instancesCat.isNotEmpty) {
|
||||
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);
|
||||
|
||||
@@ -153,7 +153,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
} catch (e) { /* */ }
|
||||
|
||||
}
|
||||
}).catchError((e) {});
|
||||
});
|
||||
} else {
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
widget.shouldSearch = true;
|
||||
@@ -252,7 +252,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
colorScheme: ColorScheme.light(
|
||||
surface: midColor,
|
||||
background: midColor,
|
||||
tertiary: Colors.grey,
|
||||
secondary: Colors.grey,
|
||||
primary: Colors.black),
|
||||
@@ -353,7 +353,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
colorScheme: ColorScheme.light(
|
||||
surface: midColor,
|
||||
background: midColor,
|
||||
tertiary: Colors.grey,
|
||||
secondary: Colors.grey,
|
||||
primary: Colors.black),
|
||||
@@ -391,7 +391,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
cardTheme: CardTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
dialogTheme: DialogTheme(elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0))),
|
||||
colorScheme: ColorScheme.light(
|
||||
surface: midColor,
|
||||
background: midColor,
|
||||
tertiary: Colors.grey,
|
||||
secondary: Colors.grey,
|
||||
primary: Colors.black),
|
||||
@@ -470,15 +470,15 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
filled: true,
|
||||
hintText: "enter cron command...",
|
||||
labelText: "cron",
|
||||
errorStyle: const TextStyle(height: 0),
|
||||
hintStyle: const TextStyle(fontSize: 10),
|
||||
labelStyle: const TextStyle(fontSize: 10),
|
||||
errorStyle: TextStyle(height: 0),
|
||||
hintStyle: TextStyle(fontSize: 10),
|
||||
labelStyle: TextStyle(fontSize: 10),
|
||||
focusedErrorBorder: 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)),
|
||||
enabledBorder: 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(
|
||||
|
||||
@@ -38,7 +38,7 @@ class StorageProcessingLinkFormsWidgetState extends State<StorageProcessingLinkF
|
||||
|
||||
@override Widget build(BuildContext context) {
|
||||
List<Widget> children = [
|
||||
const Padding( padding: const EdgeInsets.only(top: 10),
|
||||
Padding( padding: const EdgeInsets.only(top: 10),
|
||||
child: Text("<ENV VARIABLES>",
|
||||
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center)),
|
||||
];
|
||||
@@ -54,9 +54,9 @@ class StorageProcessingLinkFormsWidgetState extends State<StorageProcessingLinkF
|
||||
int count = 0;
|
||||
for(var info in widget.item.infos) {
|
||||
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: [
|
||||
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))))
|
||||
])));
|
||||
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);
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e, s) {
|
||||
print(e);
|
||||
print(s);
|
||||
}
|
||||
|
||||
}, initialValue: "${info[key] ?? ""}", readOnly: false, noLabel: false));
|
||||
@@ -125,7 +126,7 @@ class StorageProcessingLinkFormsWidgetState extends State<StorageProcessingLinkF
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(color: Colors.grey, width: 1)),
|
||||
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,)),
|
||||
Text("link infos",
|
||||
style: TextStyle( color: Colors.black))]),
|
||||
|
||||
@@ -19,15 +19,13 @@ class SubExposeFormsWidget extends StatefulWidget {
|
||||
class SubExposeFormsWidgetState extends State<SubExposeFormsWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
return Column( children : [
|
||||
Container( margin: const EdgeInsets.only(left: 10, right: 10, top: 15),
|
||||
decoration: const BoxDecoration(border: Border( top: BorderSide(color: Colors.grey, width: 1))),
|
||||
Container( margin: const EdgeInsets.only(left: 10, right: 10, top: 5),
|
||||
decoration: BoxDecoration(border: Border.all(color: Colors.grey, width: 1)),
|
||||
width: 180
|
||||
),
|
||||
SubTextInputWidget(subkey: "reference port", readOnly: widget.readOnly,
|
||||
initialValue: widget.item.port != null ? '${widget.item.port}' : null,
|
||||
width: 180,
|
||||
empty: widget.empty,
|
||||
change: (value) {
|
||||
width: widget.width, empty: widget.empty, change: (value) {
|
||||
try {
|
||||
widget.item.port = int.parse(value);
|
||||
Future.delayed(const Duration(seconds: 2), () {
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
|
||||
import 'package:oc_front/core/services/specialized_services/workflow_service.dart';
|
||||
import 'package:oc_front/models/resources/workflow_event.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class WorkflowEventFormsWidget extends StatefulWidget {
|
||||
WorkflowEventItem item;
|
||||
Dashboard dash;
|
||||
String elementID;
|
||||
WorkflowEventFormsWidget({
|
||||
super.key,
|
||||
required this.item,
|
||||
required this.dash,
|
||||
required this.elementID,
|
||||
});
|
||||
@override WorkflowEventFormsWidgetState createState() => WorkflowEventFormsWidgetState();
|
||||
}
|
||||
|
||||
class WorkflowEventFormsWidgetState extends State<WorkflowEventFormsWidget> {
|
||||
final WorflowService _service = WorflowService();
|
||||
|
||||
Future<List<DropdownMenuItem<String>>> _loadWorkflows() async {
|
||||
List<DropdownMenuItem<String>> items = [];
|
||||
await _service.all(null).then((response) {
|
||||
if (response.data != null) {
|
||||
for (var entry in response.data!.values) {
|
||||
final id = entry["id"]?.toString() ?? "";
|
||||
final name = entry["name"]?.toString() ?? id;
|
||||
if (id.isEmpty) continue;
|
||||
items.add(DropdownMenuItem<String>(value: id, child: Text(name, overflow: TextOverflow.ellipsis)));
|
||||
}
|
||||
}
|
||||
});
|
||||
return items;
|
||||
}
|
||||
|
||||
@override Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(bottom: 8),
|
||||
child: Text("Workflow cible", style: TextStyle(fontSize: 12, color: Colors.grey)),
|
||||
),
|
||||
FutureBuilder<List<DropdownMenuItem<String>>>(
|
||||
future: _loadWorkflows(),
|
||||
builder: (context, snapshot) {
|
||||
final items = snapshot.data ?? [];
|
||||
final current = items.any((e) => e.value == widget.item.workflowExecutionId)
|
||||
? widget.item.workflowExecutionId
|
||||
: null;
|
||||
return DropdownButtonFormField<String>(
|
||||
isExpanded: true,
|
||||
value: current,
|
||||
hint: const Text("Sélectionner un workflow...", style: TextStyle(fontSize: 12)),
|
||||
style: const TextStyle(fontSize: 12, color: Colors.black, overflow: TextOverflow.ellipsis),
|
||||
decoration: const InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
labelText: "workflow",
|
||||
labelStyle: TextStyle(fontSize: 10),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
enabledBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.grey)),
|
||||
border: OutlineInputBorder(borderSide: BorderSide(color: Colors.grey)),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
),
|
||||
items: items,
|
||||
onChanged: (value) {
|
||||
if (value == null) return;
|
||||
setState(() {
|
||||
widget.item.workflowExecutionId = value;
|
||||
widget.item.id = value;
|
||||
});
|
||||
widget.dash.notifyListeners();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/models/response.dart';
|
||||
import 'package:oc_front/pages/shared.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ShallowDropdownInputWidget extends StatefulWidget {
|
||||
double? width;
|
||||
double? height;
|
||||
@@ -31,10 +30,10 @@ class ShallowDropdownInputWidget extends StatefulWidget {
|
||||
|
||||
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.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();
|
||||
}
|
||||
class ShallowDropdownInputWidgetState extends State<ShallowDropdownInputWidget> {
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/pages/shared.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ShallowTextInputWidget extends StatefulWidget {
|
||||
double? width;
|
||||
CollaborativeAreaType type = CollaborativeAreaType.workspace;
|
||||
@@ -32,11 +31,11 @@ class ShallowTextInputWidget extends StatefulWidget {
|
||||
|
||||
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.tooltipLoad = "", this.tooltipRemove = "",
|
||||
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();
|
||||
|
||||
Map<String, dynamic> serialize() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class SubDropdownInputWidget extends StatefulWidget {
|
||||
String subkey;
|
||||
double width;
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:oc_front/widgets/dialog/alert.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class SubTextInputWidget extends StatefulWidget {
|
||||
String subkey;
|
||||
String? initialValue;
|
||||
@@ -13,9 +12,10 @@ class SubTextInputWidget extends StatefulWidget {
|
||||
bool readOnly = false;
|
||||
bool copyLabel = false;
|
||||
void Function(String) change = (value) {};
|
||||
SubTextInputWidget ({ super.key,
|
||||
SubTextInputWidget ({ Key? key,
|
||||
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();
|
||||
}
|
||||
class SubTextInputWidgetState extends State<SubTextInputWidget> {
|
||||
@@ -24,13 +24,12 @@ class SubTextInputWidgetState extends State<SubTextInputWidget> {
|
||||
if (widget.readOnly && widget.initialValue == null) {
|
||||
return Container();
|
||||
}
|
||||
TextEditingController ctrl = TextEditingController(text: widget.initialValue);
|
||||
return Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Tooltip( message: widget.subkey,
|
||||
child: Container( margin: EdgeInsets.only(top: widget.empty ? 0 : 15),
|
||||
width: widget.width - (widget.readOnly ? 40 : 0), height: 30,
|
||||
child: TextFormField( textAlign: TextAlign.start,
|
||||
enabled: !widget.readOnly,
|
||||
controller: ctrl,
|
||||
initialValue: widget.initialValue,
|
||||
onChanged: widget.change,
|
||||
style: const TextStyle(fontSize: 12),
|
||||
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/pages/shared.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
|
||||
class ItemWidget extends StatefulWidget {
|
||||
@@ -14,26 +15,25 @@ class ItemWidget extends StatefulWidget {
|
||||
class ItemWidgetState extends State<ItemWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
List<Widget> widgets = [
|
||||
Container( margin: const EdgeInsets.only(bottom: 20),
|
||||
Container( margin: EdgeInsets.only(bottom: 20),
|
||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: midColor))),
|
||||
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)))))
|
||||
];
|
||||
var infos = widget.item.infos();
|
||||
var count = 0;
|
||||
for (var info in infos.keys) {
|
||||
count++;
|
||||
widgets.add(Padding( padding: const EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
||||
Padding( padding: const EdgeInsets.only(left: 50, right: 10), child : Text("${info.toUpperCase().replaceAll("_", " ")} :",
|
||||
style: const TextStyle(fontSize: 15, color: Colors.grey))),
|
||||
widgets.add(Padding( padding: EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
||||
Padding( padding: EdgeInsets.only(left: 50, right: 10), child : Text("${info.toUpperCase().replaceAll("_", " ")} :", style: TextStyle(fontSize: 15, color: Colors.grey))),
|
||||
Text("${infos[info] is bool ? (infos[info] == true ? "yes" : "no") : infos[info] ?? "unknown"}",
|
||||
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 ) {
|
||||
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))),
|
||||
]))));
|
||||
}
|
||||
@@ -43,7 +43,7 @@ class ItemWidgetState extends State<ItemWidget> {
|
||||
dpItems.add(Shallow(id: "$i", name: instance.name ?? ""));
|
||||
}
|
||||
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,
|
||||
label: "instances", type: CollaborativeAreaType.resource, height: 65,
|
||||
current: "${widget.item.selectedInstance}", change: (value) {
|
||||
@@ -54,27 +54,21 @@ class ItemWidgetState extends State<ItemWidget> {
|
||||
}
|
||||
if (widget.item.instances.length > 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;
|
||||
for (var info in instance.infos().keys) {
|
||||
if (instance.infos()[info] == null || instance.infos()[info] is List || instance.infos()[info] is Map) { continue; }
|
||||
count++;
|
||||
widgetsInstance.add(Center(child: Padding( padding: const EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
||||
Padding( padding: const EdgeInsets.only(left: 50, right: 10),
|
||||
child : Text("${info.toUpperCase().replaceAll("_", " ")} :",
|
||||
style: const TextStyle(fontSize: 15, color: Colors.grey))),
|
||||
widgetsInstance.add(Center(child: Padding( padding: EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
||||
Padding( padding: EdgeInsets.only(left: 50, right: 10), child : Text("${info.toUpperCase().replaceAll("_", " ")} :", style: TextStyle(fontSize: 15, color: Colors.grey))),
|
||||
Text("${instance.infos()[info] is bool ? (instance.infos()[info] == true ? "yes" : "no") : instance.infos()[info] ?? "unknown"}",
|
||||
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 ) {
|
||||
widgetsInstance.add(const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 5),
|
||||
child : Row(children: [
|
||||
Padding( padding: EdgeInsets.only(left: 50, right: 10),
|
||||
child : Text("NO INSTANCE INFORMATION",
|
||||
style: TextStyle(fontSize: 15, color: Colors.grey))),
|
||||
widgetsInstance.add(Padding( padding: EdgeInsets.symmetric(vertical: 5), 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))),
|
||||
padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 50),
|
||||
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: [
|
||||
Container(padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
height: getHeight(context) - 300,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
|
||||
import 'package:oc_front/main.dart';
|
||||
@@ -41,7 +43,7 @@ class ShallowItemRowWidgetState extends State<ShallowItemRowWidget> {
|
||||
child: Row( children: [
|
||||
Padding( padding: const EdgeInsets.only(right: 5),
|
||||
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),
|
||||
child: widget.delete == null ? Container() : InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
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: [
|
||||
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),
|
||||
child: Icon( widget.icon!, size: widget.contextWidth / 1.9, color: const Color(0xfff67c0b9),)),
|
||||
Padding(padding: widget.contextWidth != getMainWidth(context) ?
|
||||
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Row( children: [
|
||||
Expanded( child: Center( child: Text(widget.item.getName().toUpperCase(),
|
||||
style: const TextStyle(fontSize: 15,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontWeight: FontWeight.w600, color: Colors.grey)),
|
||||
))
|
||||
]),
|
||||
],)
|
||||
child: Icon( widget.icon!, size: widget.contextWidth / 1.9, color: const Color(0xFFF67C0B9),)),
|
||||
Container(
|
||||
child: Padding(padding: widget.contextWidth != getMainWidth(context) ?
|
||||
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Row( children: [
|
||||
Expanded( child: Center( child: Text(widget.item.getName().toUpperCase(),
|
||||
style: const TextStyle(fontSize: 15,
|
||||
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 {
|
||||
bool readOnly = false;
|
||||
double contextWidth = 0;
|
||||
@@ -111,7 +114,7 @@ class ShallowItemFlowDataRowWidgetState extends State<ShallowItemFlowDataRowWidg
|
||||
child: Row( children: [
|
||||
Padding( padding: const EdgeInsets.only(right: 5),
|
||||
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),
|
||||
child: widget.delete == null ? Container() : InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
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: [
|
||||
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),
|
||||
child: Icon( widget.icon!, size: widget.contextWidth / 1.9, color: const Color(0xfff67c0b9),)),
|
||||
Padding(padding: widget.contextWidth != getMainWidth(context) ?
|
||||
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Row( children: [
|
||||
Expanded( child: Center( child: Text(widget.item.getName().toUpperCase(),
|
||||
style: const TextStyle(fontSize: 15,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontWeight: FontWeight.w600, color: Colors.grey)),
|
||||
))
|
||||
]),
|
||||
],)
|
||||
child: Icon( widget.icon!, size: widget.contextWidth / 1.9, color: const Color(0xFFF67C0B9),)),
|
||||
Container(
|
||||
child: Padding(padding: widget.contextWidth != getMainWidth(context) ?
|
||||
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Row( children: [
|
||||
Expanded( child: Center( child: Text(widget.item.getName().toUpperCase(),
|
||||
style: const TextStyle(fontSize: 15,
|
||||
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;
|
||||
Map<String, bool> valid = {};
|
||||
// ignore: must_be_immutable
|
||||
class LogsWidget extends StatefulWidget {
|
||||
String? level;
|
||||
String search = "";
|
||||
WorkflowExecution? exec;
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -74,12 +73,12 @@ class LogsWidgetState extends State<LogsWidget> {
|
||||
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();
|
||||
if (isLoading) {
|
||||
return SizedBox( height: getMainHeight(context) - 100,
|
||||
child: const Center( child: CircularProgressIndicator()) );
|
||||
return Container( height: getMainHeight(context) - 100,
|
||||
child: Center( child: CircularProgressIndicator()) );
|
||||
}
|
||||
return Stack( children: [
|
||||
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 ),)))
|
||||
: Column( children: [...itemRows, Container(height: 50,) ] ) ),
|
||||
]);
|
||||
@@ -89,11 +88,10 @@ class LogsWidgetState extends State<LogsWidget> {
|
||||
}
|
||||
}
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class LogWidget extends StatefulWidget {
|
||||
final Log item;
|
||||
bool expanded = false;
|
||||
LogWidget ({ super.key, required this.item });
|
||||
LogWidget ({ Key? key, required this.item }): super(key: key);
|
||||
@override LogWidgetState createState() => LogWidgetState();
|
||||
}
|
||||
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}"}"], {}),
|
||||
builder: (ctx, as) {
|
||||
Map<String, List<WorkflowExecution>> data = {};
|
||||
DateTime? firstDate;
|
||||
if (as.hasData && as.data!.data != null) {
|
||||
for (var element in as.data!.data!.executions) {
|
||||
if (element.startDate == null) { continue; }
|
||||
@@ -210,11 +211,11 @@ class ScheduleWidgetState extends State<ScheduleWidget> {
|
||||
borderSide: BorderSide(color: midColor, width: 0)),
|
||||
),
|
||||
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", child: Row( children: [ Container( width: 10, height: 15, color: Colors.blue), const 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: "error", child: Row( children: [ Container( width: 10, height: 15, color: redColor), const 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: "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), Text(" debug", 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), Text(" error", 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) {
|
||||
setState(() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/core/sections/header/header.dart';
|
||||
import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/models/workflow.dart';
|
||||
import 'package:oc_front/widgets/sheduler_items/schedule.dart';
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
},
|
||||
{
|
||||
"name": "flutter",
|
||||
"rootUri": "file:///home/mr/flutter/packages/flutter",
|
||||
"rootUri": "file:///home/mr/snap/flutter/common/flutter/packages/flutter",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.3"
|
||||
},
|
||||
@@ -87,10 +87,16 @@
|
||||
},
|
||||
{
|
||||
"name": "flutter_test",
|
||||
"rootUri": "file:///home/mr/flutter/packages/flutter_test",
|
||||
"rootUri": "file:///home/mr/snap/flutter/common/flutter/packages/flutter_test",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.3"
|
||||
},
|
||||
{
|
||||
"name": "hover_menu",
|
||||
"rootUri": "file:///home/mr/.pub-cache/hosted/pub.dev/hover_menu-1.1.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.16"
|
||||
},
|
||||
{
|
||||
"name": "leak_tracker",
|
||||
"rootUri": "file:///home/mr/.pub-cache/hosted/pub.dev/leak_tracker-10.0.5",
|
||||
@@ -141,7 +147,7 @@
|
||||
},
|
||||
{
|
||||
"name": "sky_engine",
|
||||
"rootUri": "file:///home/mr/flutter/bin/cache/pkg/sky_engine",
|
||||
"rootUri": "file:///home/mr/snap/flutter/common/flutter/bin/cache/pkg/sky_engine",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.2"
|
||||
},
|
||||
@@ -224,10 +230,10 @@
|
||||
"languageVersion": "3.3"
|
||||
}
|
||||
],
|
||||
"generated": "2026-02-11T13:07:02.110119Z",
|
||||
"generated": "2025-02-17T08:57:16.568019Z",
|
||||
"generator": "pub",
|
||||
"generatorVersion": "3.5.3",
|
||||
"flutterRoot": "file:///home/mr/flutter",
|
||||
"flutterRoot": "file:///home/mr/snap/flutter/common/flutter",
|
||||
"flutterVersion": "3.24.3",
|
||||
"pubCache": "file:///home/mr/.pub-cache"
|
||||
}
|
||||
|
||||
@@ -50,6 +50,10 @@ flutter_colorpicker
|
||||
2.14
|
||||
file:///home/mr/.pub-cache/hosted/pub.dev/flutter_colorpicker-1.1.0/
|
||||
file:///home/mr/.pub-cache/hosted/pub.dev/flutter_colorpicker-1.1.0/lib/
|
||||
hover_menu
|
||||
2.16
|
||||
file:///home/mr/.pub-cache/hosted/pub.dev/hover_menu-1.1.1/
|
||||
file:///home/mr/.pub-cache/hosted/pub.dev/hover_menu-1.1.1/lib/
|
||||
leak_tracker
|
||||
3.2
|
||||
file:///home/mr/.pub-cache/hosted/pub.dev/leak_tracker-10.0.5/
|
||||
@@ -136,14 +140,14 @@ file:///home/mr/Documents/OC/oc-front/library/flutter_flow_chart/
|
||||
file:///home/mr/Documents/OC/oc-front/library/flutter_flow_chart/lib/
|
||||
sky_engine
|
||||
3.2
|
||||
file:///home/mr/flutter/bin/cache/pkg/sky_engine/
|
||||
file:///home/mr/flutter/bin/cache/pkg/sky_engine/lib/
|
||||
file:///home/mr/snap/flutter/common/flutter/bin/cache/pkg/sky_engine/
|
||||
file:///home/mr/snap/flutter/common/flutter/bin/cache/pkg/sky_engine/lib/
|
||||
flutter
|
||||
3.3
|
||||
file:///home/mr/flutter/packages/flutter/
|
||||
file:///home/mr/flutter/packages/flutter/lib/
|
||||
file:///home/mr/snap/flutter/common/flutter/packages/flutter/
|
||||
file:///home/mr/snap/flutter/common/flutter/packages/flutter/lib/
|
||||
flutter_test
|
||||
3.3
|
||||
file:///home/mr/flutter/packages/flutter_test/
|
||||
file:///home/mr/flutter/packages/flutter_test/lib/
|
||||
file:///home/mr/snap/flutter/common/flutter/packages/flutter_test/
|
||||
file:///home/mr/snap/flutter/common/flutter/packages/flutter_test/lib/
|
||||
2
|
||||
|
||||
@@ -371,7 +371,7 @@ class Dashboard extends ChangeNotifier {
|
||||
bool noHistory = false;
|
||||
void addToHistory() {
|
||||
if (noHistory) {
|
||||
Future.delayed(const Duration(seconds: 2), () {
|
||||
Future.delayed(Duration(seconds: 2), () {
|
||||
noHistory = false;
|
||||
});
|
||||
return;
|
||||
@@ -379,7 +379,7 @@ class Dashboard extends ChangeNotifier {
|
||||
if (tempHistory.length >= 50) { tempHistory.removeAt(0); }
|
||||
tempHistory.add(toMap());
|
||||
history = tempHistory.map((e) => e).toList();
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
Future.delayed(Duration(seconds: 1), () {
|
||||
chartMenuKey.currentState?.setState(() { });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ abstract class FlowData {
|
||||
FlowData deserialize(Map<String, dynamic> data);
|
||||
}
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class FlowChart<T extends FlowData> extends StatefulWidget {
|
||||
FlowChart({
|
||||
required this.dashboard,
|
||||
@@ -61,7 +60,7 @@ class FlowChart<T extends FlowData> extends StatefulWidget {
|
||||
this.menuExtension,
|
||||
this.itemLeftBottomBadges,
|
||||
this.itemrightTopBadges,
|
||||
});
|
||||
}) {}
|
||||
final String? current;
|
||||
final List<String> categories;
|
||||
final double width;
|
||||
@@ -171,7 +170,7 @@ class FlowChart<T extends FlowData> extends StatefulWidget {
|
||||
|
||||
/// Trigger for the scale change
|
||||
final void Function(double scale)? onScaleUpdate;
|
||||
bool dashboardSelected = true;
|
||||
|
||||
@override
|
||||
State<FlowChart> createState() => FlowChartState<T>();
|
||||
}
|
||||
@@ -183,7 +182,6 @@ class HoverMenuController {
|
||||
currentState?.hideSubMenu();
|
||||
}
|
||||
}
|
||||
// ignore: must_be_immutable
|
||||
class HoverMenu extends StatefulWidget {
|
||||
final Widget title;
|
||||
final double? width;
|
||||
@@ -193,12 +191,12 @@ class HoverMenu extends StatefulWidget {
|
||||
|
||||
|
||||
HoverMenu({
|
||||
super.key,
|
||||
Key? key,
|
||||
required this.title,
|
||||
this.items = const [],
|
||||
this.width,
|
||||
this.controller,
|
||||
});
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
HoverMenuState createState() => HoverMenuState();
|
||||
@@ -326,7 +324,6 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
||||
widget.dashboard.inDialog = true;
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
// ignore: use_build_context_synchronously
|
||||
context: context, builder: (context) {
|
||||
return AlertDialog(
|
||||
titlePadding: EdgeInsets.zero,
|
||||
@@ -367,63 +364,63 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
||||
autofocus: true,
|
||||
onKeyEvent: (event) {
|
||||
bool change = false;
|
||||
if (widget.dashboardSelected) {
|
||||
if (event.logicalKey == LogicalKeyboardKey.controlLeft && event is KeyDownEvent) {
|
||||
isCtrl = true;
|
||||
}
|
||||
if (event.logicalKey == LogicalKeyboardKey.controlLeft && event is KeyUpEvent) {
|
||||
isCtrl = false;
|
||||
}
|
||||
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.add) {
|
||||
change = true;
|
||||
for (var el in widget.dashboard.elementSelected) {
|
||||
widget.dashboard.addElement(FlowElement<T>(
|
||||
element: el.element as T,
|
||||
dashboard: widget.dashboard,
|
||||
id: const Uuid().v4(),
|
||||
position: el.position + const Offset(100, 100),
|
||||
size: el.size,
|
||||
text: el.text,
|
||||
widget: el.widget,
|
||||
kind: el.kind,
|
||||
handlers: el.handlers,
|
||||
handlerSize: el.handlerSize,
|
||||
), context);
|
||||
if (event.logicalKey == LogicalKeyboardKey.controlLeft && event is KeyDownEvent) {
|
||||
print("CTRL true");
|
||||
isCtrl = true;
|
||||
}
|
||||
if (event.logicalKey == LogicalKeyboardKey.controlLeft && event is KeyUpEvent) {
|
||||
print("CTRL false");
|
||||
isCtrl = false;
|
||||
}
|
||||
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.add) {
|
||||
change = true;
|
||||
for (var el in widget.dashboard.elementSelected) {
|
||||
widget.dashboard.addElement(FlowElement<T>(
|
||||
element: el.element as T,
|
||||
dashboard: widget.dashboard,
|
||||
id: const Uuid().v4(),
|
||||
position: el.position + const Offset(100, 100),
|
||||
size: el.size,
|
||||
text: el.text,
|
||||
widget: el.widget,
|
||||
kind: el.kind,
|
||||
handlers: el.handlers,
|
||||
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) {
|
||||
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]));
|
||||
}
|
||||
}
|
||||
widget.dashboard.removeArrows( (el) => el.isSelected, context );
|
||||
}
|
||||
if (change) {
|
||||
DrawingArrow.instance.notifyListeners();
|
||||
widget.dashboard.chartKey.currentState?.setState(() { });
|
||||
node.requestFocus();
|
||||
}
|
||||
widget.dashboard.removeArrows( (el) => el.isSelected, context );
|
||||
}
|
||||
if (change) {
|
||||
DrawingArrow.instance.notifyListeners();
|
||||
widget.dashboard.chartKey.currentState?.setState(() { });
|
||||
node.requestFocus();
|
||||
}
|
||||
},
|
||||
child: ClipRect(
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Stack(children: [
|
||||
Stack(children: [
|
||||
// Draw the grid
|
||||
DragTarget<T>(
|
||||
builder: (
|
||||
@@ -431,15 +428,7 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
||||
List<dynamic> accepted,
|
||||
List<dynamic> rejected,
|
||||
) {
|
||||
return MouseRegion(
|
||||
onEnter: (ev) {
|
||||
print("sqfdsfd");
|
||||
widget.dashboardSelected = true;
|
||||
},
|
||||
onExit: (ev) {
|
||||
widget.dashboardSelected = false;
|
||||
},
|
||||
child: SizedBox(
|
||||
return SizedBox(
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
child: ChartWidget<T>(
|
||||
@@ -460,7 +449,7 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
||||
onHandlerPressed: widget.onHandlerLongPressed,
|
||||
onHandlerLongPressed: widget.onHandlerLongPressed,
|
||||
onPivotSecondaryPressed: widget.onPivotSecondaryPressed,
|
||||
)));
|
||||
));
|
||||
},
|
||||
onAcceptWithDetails: (DragTargetDetails<T> details) {
|
||||
var e = details.data;
|
||||
@@ -490,24 +479,24 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
||||
);
|
||||
widget.dashboard.addElement(el, context);
|
||||
},
|
||||
)]
|
||||
)]
|
||||
),
|
||||
widget.dashboard.isMenu ? Positioned(top: 50, child: FlowChartSelectedMenu(
|
||||
key: widget.dashboard.selectedMenuKey,
|
||||
dashboard: widget.dashboard,
|
||||
height: widget.height - 50)) : Container(),
|
||||
height: widget.height - 50) ) : Container(),
|
||||
widget.dashboard.isInfo ? Positioned(top: 50, right: 0, child:
|
||||
FlowChartLeftMenu<T>(
|
||||
key: widget.dashboard.selectedLeftMenuKey,
|
||||
dashboard: widget.dashboard,
|
||||
menuExtension: widget.menuExtension,
|
||||
categories: widget.categories,
|
||||
height: widget.height,
|
||||
innerMenuWidth: widget.innerMenuWidth,
|
||||
itemWidth: widget.itemWidth,
|
||||
draggableItemBuilder: widget.draggableItemBuilder as List<T> Function(String cat),
|
||||
getDraggable: getDraggable,
|
||||
)) : Container()
|
||||
key: widget.dashboard.selectedLeftMenuKey,
|
||||
dashboard: widget.dashboard,
|
||||
menuExtension: widget.menuExtension,
|
||||
categories: widget.categories,
|
||||
height: widget.height,
|
||||
innerMenuWidth: widget.innerMenuWidth,
|
||||
itemWidth: widget.itemWidth,
|
||||
draggableItemBuilder: widget.draggableItemBuilder as List<T> Function(String cat),
|
||||
getDraggable: getDraggable,
|
||||
)) : Container()
|
||||
])
|
||||
));
|
||||
}
|
||||
@@ -587,9 +576,8 @@ class _DrawingArrowWidgetState extends State<DrawingArrowWidget> {
|
||||
}
|
||||
}
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ChartWidget<T extends FlowData> extends StatefulWidget {
|
||||
ChartWidget ({ super.key,
|
||||
ChartWidget ({ Key? key,
|
||||
required this.flowChart,
|
||||
this.onElementPressed,
|
||||
this.onElementSecondaryTapped,
|
||||
@@ -609,7 +597,7 @@ class ChartWidget<T extends FlowData> extends StatefulWidget {
|
||||
required this.dashboard,
|
||||
this.onNewConnection,
|
||||
this.menuWidget,
|
||||
});
|
||||
}) : super(key: key);
|
||||
|
||||
FlowChartState flowChart;
|
||||
|
||||
@@ -755,28 +743,24 @@ class ChartWidgetState<T extends FlowData> extends State<ChartWidget> {
|
||||
onTapDown: (details) {
|
||||
hoverImportant = false;
|
||||
tapDownPos = details.localPosition;
|
||||
|
||||
for (var arr in widget.dashboard.arrows) {
|
||||
if (arr.isLine(tapDownPos)) {
|
||||
hoverImportant = true;
|
||||
for (var arr in widget.dashboard.arrows) {
|
||||
arr.isSelected = false;
|
||||
}
|
||||
arr.isSelected = !arr.isSelected;
|
||||
for (var sel in widget.dashboard.elements) {
|
||||
sel.isSelected = false;
|
||||
}
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
widget.dashboard.selectedMenuKey.currentState?.setState(() {});
|
||||
DrawingArrow.instance.notifyListeners();
|
||||
});
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
if (!hoverImportant) {
|
||||
for (var sel in widget.dashboard.elements) { 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(() {});
|
||||
DrawingArrow.instance.notifyListeners();
|
||||
});
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class FlowChartLeftMenu<T extends FlowData> extends StatefulWidget {
|
||||
Dashboard dashboard;
|
||||
List<String> categories;
|
||||
@@ -40,10 +39,10 @@ class FlowChartLeftMenuState<T extends FlowData> extends State<FlowChartLeftMenu
|
||||
: Theme(
|
||||
data: Theme.of(context).copyWith(dividerColor: widget.dashboard.midDashColor),
|
||||
child: ExpansionTile(
|
||||
collapsedShape: const RoundedRectangleBorder(
|
||||
collapsedShape: RoundedRectangleBorder(
|
||||
side: BorderSide.none,
|
||||
),
|
||||
shape: const RoundedRectangleBorder(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide.none,
|
||||
),
|
||||
initiallyExpanded: true,
|
||||
@@ -71,16 +70,16 @@ class FlowChartLeftMenuState<T extends FlowData> extends State<FlowChartLeftMenu
|
||||
);
|
||||
}
|
||||
return Container(
|
||||
height: widget.height,
|
||||
color: widget.dashboard.midDashColor,
|
||||
child: Stack( children: [
|
||||
Container(
|
||||
height: widget.height,
|
||||
color: widget.dashboard.midDashColor,
|
||||
child: Stack( children: [
|
||||
Container(
|
||||
width: widget.innerMenuWidth,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(border: Border(
|
||||
bottom: BorderSide(color: Colors.grey.shade400),
|
||||
right: BorderSide(color: widget.dashboard.midDashColor),
|
||||
left: const BorderSide(color: Colors.white))),
|
||||
left: BorderSide(color: Colors.white))),
|
||||
child: TextFormField(
|
||||
style: const TextStyle(color: Colors.black, fontSize: 15),
|
||||
cursorColor: widget.dashboard.dashColor,
|
||||
@@ -92,7 +91,7 @@ class FlowChartLeftMenuState<T extends FlowData> extends State<FlowChartLeftMenu
|
||||
fillColor: widget.dashboard.midDashColor,
|
||||
filled: true,
|
||||
contentPadding: const EdgeInsets.only(left: 50, right: 50, top: 15, bottom: 15),
|
||||
hintStyle: const TextStyle(
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w400
|
||||
@@ -102,7 +101,7 @@ class FlowChartLeftMenuState<T extends FlowData> extends State<FlowChartLeftMenu
|
||||
)
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(top: 50),
|
||||
margin: EdgeInsets.only(top: 50),
|
||||
height: widget.height - 100,
|
||||
constraints: BoxConstraints(minWidth: widget.itemWidth),
|
||||
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:uuid/uuid.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class FlowChartSelectedMenu extends StatefulWidget {
|
||||
Dashboard dashboard;
|
||||
double height = 100;
|
||||
@@ -22,13 +21,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
width: 200,
|
||||
height: widget.height,
|
||||
color: widget.dashboard.midDashColor,
|
||||
child: SingleChildScrollView( child: Column( children: [
|
||||
...widget.dashboard.infoItemWidget != null ?
|
||||
child: SingleChildScrollView( child: Column( children: [ ...widget.dashboard.infoItemWidget != null ?
|
||||
widget.dashboard.infoItemWidget!(widget.dashboard.elementSelected.first.element, widget.dashboard.elementSelected.first.id) : [],
|
||||
widget.dashboard.arrowsSelected.isNotEmpty || widget.dashboard.elementSelected.isNotEmpty ? Container(
|
||||
width: 200,
|
||||
margin: const EdgeInsets.only(top: 15),
|
||||
decoration: const BoxDecoration(border: Border(
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
decoration: BoxDecoration(border: Border(
|
||||
top: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||
Tooltip( message: "remove",
|
||||
@@ -40,13 +38,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
return element.isSelected;
|
||||
}, context);
|
||||
Future.delayed( const Duration(milliseconds: 100), () {
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
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)),
|
||||
width: 200, height: 30,
|
||||
child: const Icon(Icons.delete_outline, color: Colors.black),
|
||||
child: Icon(Icons.delete_outline, color: Colors.black),
|
||||
))
|
||||
),
|
||||
Tooltip( message: "copy",
|
||||
@@ -54,17 +52,17 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
onTap: () {
|
||||
for (var sel in widget.dashboard.elementSelected) {
|
||||
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.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(() { });
|
||||
});
|
||||
}, 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)),
|
||||
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.arrowsSelected.isNotEmpty || widget.dashboard.elementSelected.isNotEmpty ? Container(
|
||||
width: 200,
|
||||
margin: const EdgeInsets.only(top: 15),
|
||||
decoration: const BoxDecoration(border: Border(top: BorderSide(color: Colors.grey, width: 1))),
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
decoration: BoxDecoration(border: Border(
|
||||
top: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||
Tooltip( message: "remove",
|
||||
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
@@ -93,13 +92,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
return element.isSelected;
|
||||
}, context);
|
||||
Future.delayed( const Duration(milliseconds: 100), () {
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
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)),
|
||||
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,
|
||||
color: widget.dashboard.midDashColor,
|
||||
child: Column( children: [
|
||||
Container( padding: const EdgeInsets.all(10), width: 200, height: 60,
|
||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
Container( padding: EdgeInsets.all(10), width: 200, height: 60,
|
||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Text("STYLE ${widget.dashboard.elementSelected.isNotEmpty ? "ELEMENT" : "ARROW"}",
|
||||
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
||||
Text("<${widget.dashboard.arrowsSelected.isEmpty && widget.dashboard.elementSelected.isEmpty ? "general" : "selected"}>",
|
||||
style: const TextStyle(fontSize: 12), textAlign: TextAlign.center),
|
||||
Text("STYLE ${widget.dashboard.elementSelected.isNotEmpty ? "ELEMENT" : "ARROW"}", style: 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),
|
||||
])),
|
||||
SizedBox( width: 200, height: widget.height - 60, child: SingleChildScrollView( child: Column( children: [
|
||||
widget.dashboard.elementSelected.isNotEmpty ? Container() : Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 20),
|
||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
widget.dashboard.elementSelected.isNotEmpty ? Container() : Container( padding: EdgeInsets.symmetric(horizontal: 10, vertical: 20),
|
||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Column( children: [
|
||||
Row( children: [
|
||||
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>(
|
||||
tooltip: "line defaults",
|
||||
constraints: const BoxConstraints(maxWidth: 100),
|
||||
constraints: BoxConstraints(maxWidth: 100),
|
||||
initialValue: null,
|
||||
onSelected: (ArrowDash value) {
|
||||
if (widget.dashboard.elementSelected.isEmpty) {
|
||||
@@ -203,14 +199,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
dashSpace: widget.dashboard.defaultDashSpace,
|
||||
color: Colors.black
|
||||
),
|
||||
const SizedBox(height: 25, width: 10),
|
||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
SizedBox(height: 25, width: 10),
|
||||
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
),
|
||||
)
|
||||
),
|
||||
PopupMenuButton<void>(
|
||||
tooltip: "color picker",
|
||||
constraints: const BoxConstraints(maxWidth: 664),
|
||||
constraints: BoxConstraints(maxWidth: 664),
|
||||
initialValue: null,
|
||||
onSelected: (void value) {},
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<void>>[
|
||||
@@ -226,12 +222,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
],
|
||||
child: Row( children: [
|
||||
Container(width: 15, height: 15, color: widget.dashboard.defaultColor),
|
||||
const SizedBox(height: 25, width: 5),
|
||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
SizedBox(height: 25, width: 5),
|
||||
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
),
|
||||
Tooltip( message: "stroke width",
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(left: 10),
|
||||
margin: EdgeInsets.only(left: 10),
|
||||
width: 55, height: 25,
|
||||
child: TextFormField( textAlign: TextAlign.center,
|
||||
readOnly: widget.dashboard.defaultDashWidth <= 0,
|
||||
@@ -243,8 +239,8 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
setState(() { widget.dashboard.defaultStroke = double.parse(value); });
|
||||
},
|
||||
style: const TextStyle(fontSize: 12),
|
||||
decoration: const InputDecoration(
|
||||
style: TextStyle(fontSize: 12),
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
labelText: "stroke",
|
||||
@@ -270,7 +266,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
]),
|
||||
Row(children: [
|
||||
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>(
|
||||
initialValue: null,
|
||||
onSelected: (ArrowStyle value) {
|
||||
@@ -283,7 +279,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
},
|
||||
tooltip: "line styles",
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<ArrowStyle>>[
|
||||
const PopupMenuItem<ArrowStyle>(
|
||||
PopupMenuItem<ArrowStyle>(
|
||||
value: ArrowStyle.segmented,
|
||||
child: Row( children: [
|
||||
Icon(Icons.turn_slight_left),
|
||||
@@ -291,7 +287,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: Text('straight', textAlign: TextAlign.center,))
|
||||
]),
|
||||
),
|
||||
const PopupMenuItem<ArrowStyle>(
|
||||
PopupMenuItem<ArrowStyle>(
|
||||
value: ArrowStyle.curve,
|
||||
child: Row( children: [
|
||||
Icon(Icons.roundabout_left),
|
||||
@@ -299,7 +295,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: Text('curved', textAlign: TextAlign.center,))
|
||||
]),
|
||||
),
|
||||
const PopupMenuItem<ArrowStyle>(
|
||||
PopupMenuItem<ArrowStyle>(
|
||||
value: ArrowStyle.rectangular,
|
||||
child: Row( children: [
|
||||
Icon(Icons.turn_sharp_left_outlined),
|
||||
@@ -311,13 +307,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
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
|
||||
, 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",
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
width: 105 / 2, height: 25,
|
||||
child: TextFormField( textAlign: TextAlign.center,
|
||||
readOnly: widget.dashboard.defaultDashWidth <= 0,
|
||||
@@ -329,14 +325,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
setState(() { widget.dashboard.defaultDashWidth = double.parse(value); });
|
||||
},
|
||||
style: const TextStyle(fontSize: 12),
|
||||
style: TextStyle(fontSize: 12),
|
||||
decoration: InputDecoration(
|
||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||
filled: true,
|
||||
labelText: "dash",
|
||||
labelStyle: const TextStyle(fontSize: 10),
|
||||
border: const OutlineInputBorder(),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
labelStyle: TextStyle(fontSize: 10),
|
||||
border: OutlineInputBorder(),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
),
|
||||
inputFormatters: [
|
||||
NumberTextInputFormatter(
|
||||
@@ -355,7 +351,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
))),
|
||||
Tooltip( message: "space width",
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(left: 10, top: 10),
|
||||
margin: EdgeInsets.only(left: 10, top: 10),
|
||||
width: 105 / 2, height: 25,
|
||||
child: TextFormField( textAlign: TextAlign.center,
|
||||
initialValue: "${widget.dashboard.defaultDashSpace}",
|
||||
@@ -366,14 +362,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
setState(() { widget.dashboard.defaultDashSpace = double.parse(value); });
|
||||
},
|
||||
style: const TextStyle(fontSize: 12),
|
||||
style: TextStyle(fontSize: 12),
|
||||
decoration: InputDecoration(
|
||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||
filled: true,
|
||||
labelText: "space",
|
||||
labelStyle: const TextStyle(fontSize: 10),
|
||||
border: const OutlineInputBorder(),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
labelStyle: TextStyle(fontSize: 10),
|
||||
border: OutlineInputBorder(),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
),
|
||||
inputFormatters: [
|
||||
NumberTextInputFormatter(
|
||||
@@ -393,12 +389,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
]),
|
||||
])),
|
||||
widget.dashboard.elementSelected.isNotEmpty ? Container() :
|
||||
Container( padding: const EdgeInsets.only(left: 10, right: 10, bottom: 20, top: 15),
|
||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 20, top: 15),
|
||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Column( children: [
|
||||
Row( mainAxisAlignment: MainAxisAlignment.center, children : [
|
||||
InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
child: Padding( padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Padding( padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: PopupMenuButton<ArrowDirection>(
|
||||
initialValue: null,
|
||||
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',
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<ArrowDirection>>[
|
||||
const PopupMenuItem<ArrowDirection>(
|
||||
PopupMenuItem<ArrowDirection>(
|
||||
value: ArrowDirection.forward,
|
||||
child: Row( children: [
|
||||
Icon(Icons.arrow_forward),
|
||||
@@ -419,7 +415,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: Text('forward', textAlign: TextAlign.center,))
|
||||
]),
|
||||
),
|
||||
const PopupMenuItem<ArrowDirection>(
|
||||
PopupMenuItem<ArrowDirection>(
|
||||
value: ArrowDirection.backward,
|
||||
child: Row( children: [
|
||||
Icon(Icons.arrow_back),
|
||||
@@ -427,7 +423,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: Text('curved', textAlign: TextAlign.center,))
|
||||
]),
|
||||
),
|
||||
const PopupMenuItem<ArrowDirection>(
|
||||
PopupMenuItem<ArrowDirection>(
|
||||
value: ArrowDirection.bidirectionnal,
|
||||
child: Row( children: [
|
||||
Icon(Icons.sync_alt_outlined),
|
||||
@@ -439,16 +435,16 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child:
|
||||
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),
|
||||
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')),
|
||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
),)
|
||||
),
|
||||
]),
|
||||
Row(children: [
|
||||
Tooltip( message: "forward size",
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
width: 150, height: 25,
|
||||
child: TextFormField( textAlign: TextAlign.center,
|
||||
initialValue: "${widget.dashboard.defaultForwardWidth}",
|
||||
@@ -471,14 +467,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
});
|
||||
},
|
||||
style: const TextStyle(fontSize: 12),
|
||||
style: TextStyle(fontSize: 12),
|
||||
decoration: InputDecoration(
|
||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||
filled: true,
|
||||
labelText: "forward size",
|
||||
labelStyle: const TextStyle(fontSize: 10),
|
||||
border: const OutlineInputBorder(),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
labelStyle: TextStyle(fontSize: 10),
|
||||
border: OutlineInputBorder(),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
),
|
||||
inputFormatters: [
|
||||
NumberTextInputFormatter(
|
||||
@@ -495,12 +491,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
],
|
||||
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: [
|
||||
Tooltip( message: "back size",
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
width: 150, height: 25,
|
||||
child: TextFormField( textAlign: TextAlign.center,
|
||||
initialValue: "${widget.dashboard.defaultBackWidth}",
|
||||
@@ -523,14 +519,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
});
|
||||
},
|
||||
style: const TextStyle(fontSize: 12),
|
||||
style: TextStyle(fontSize: 12),
|
||||
decoration: InputDecoration(
|
||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||
filled: true,
|
||||
labelText: "back size",
|
||||
labelStyle: const TextStyle(fontSize: 10),
|
||||
border: const OutlineInputBorder(),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
labelStyle: TextStyle(fontSize: 10),
|
||||
border: OutlineInputBorder(),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
),
|
||||
inputFormatters: [
|
||||
NumberTextInputFormatter(
|
||||
@@ -547,12 +543,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
],
|
||||
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(
|
||||
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: [
|
||||
Tooltip( message: "remove",
|
||||
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
@@ -563,13 +559,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
return element.isSelected;
|
||||
}, context);
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
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)),
|
||||
width: 200, height: 30,
|
||||
child: const Icon(Icons.delete_outline, color: Colors.black),
|
||||
child: Icon(Icons.delete_outline, color: Colors.black),
|
||||
))
|
||||
),
|
||||
Tooltip( message: "copy",
|
||||
@@ -577,15 +573,15 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
onTap: () {
|
||||
for (var sel in widget.dashboard.elementSelected) {
|
||||
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(() { });
|
||||
});
|
||||
}, 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)),
|
||||
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
|
||||
width: 200, height: 50,
|
||||
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: [
|
||||
Tooltip( message: "dashboard information",
|
||||
child: InkWell( onTap: () => setState(() {widget.isDashboardInfo = true; }),
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
child: Container( alignment: Alignment.center,
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
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(
|
||||
@@ -614,19 +610,17 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: InkWell( onTap: () => setState(() {widget.isDashboardInfo = false; }),
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
child: Container( alignment: Alignment.center,
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
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,
|
||||
color: Colors.red,
|
||||
padding: const EdgeInsets.all(10),
|
||||
widget.dashboard.error != null ? Container( width: 200, color: Colors.red, padding: EdgeInsets.all(10),
|
||||
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
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ class ArrowPainter extends CustomPainter {
|
||||
}) : pivots = pivots ?? [];
|
||||
|
||||
List<dynamic> env;
|
||||
List<dynamic> infos = [];
|
||||
List<dynamic> infos;
|
||||
ArrowParams params;
|
||||
String toID;
|
||||
String fromID;
|
||||
@@ -744,28 +744,8 @@ class ArrowPainter extends CustomPainter {
|
||||
return _dashedPathProperties.path;
|
||||
}
|
||||
|
||||
bool isLine(Offset point) {
|
||||
final metrics = path.computeMetrics(forceClosed: false);
|
||||
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}");
|
||||
|
||||
bool isLine(Offset position) {
|
||||
for (double i=-5; i < 5; i++) {
|
||||
for (double y=-5; y < 5; y++) {
|
||||
var pos = position + Offset(i, y);
|
||||
@@ -776,7 +756,7 @@ class ArrowPainter extends CustomPainter {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
@override
|
||||
bool? hitTest(Offset position) {
|
||||
/* graphkey?.currentState?.widget.isShowed = isLine(position);
|
||||
|
||||
@@ -177,7 +177,7 @@ class ElementWidgetState<T extends FlowData> extends State<ElementWidget> {
|
||||
childWhenDragging: const SizedBox.shrink(),
|
||||
feedback: Material(
|
||||
color: Colors.transparent,
|
||||
child: Padding( padding: const EdgeInsets.all(6),
|
||||
child: Padding( padding: EdgeInsets.all(6),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(border: Border.all( color: Colors.red, width: 2)),
|
||||
width: widget.element.size.width - 12,
|
||||
@@ -262,7 +262,7 @@ class ElementWidgetState<T extends FlowData> extends State<ElementWidget> {
|
||||
children: (!widget.isHovered ? [] : [
|
||||
IconButton(tooltip: "remove element", onPressed: () {
|
||||
widget.dashboard.removeElement(widget.element, context);
|
||||
}, icon: const Icon(Icons.delete_outline)),
|
||||
}, icon: Icon(Icons.delete_outline)),
|
||||
IconButton(tooltip: "copy element", onPressed: () {
|
||||
FlowElement<T> newElement = FlowElement<T>(
|
||||
element: widget.element.element as T?,
|
||||
@@ -273,7 +273,7 @@ class ElementWidgetState<T extends FlowData> extends State<ElementWidget> {
|
||||
widget: widget.element.widget,
|
||||
);
|
||||
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';
|
||||
|
||||
/// The arrow tip.
|
||||
// ignore: must_be_immutable
|
||||
class HandlerWidget extends StatelessWidget {
|
||||
///
|
||||
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';
|
||||
|
||||
/// The widget to press and drag to resize the element
|
||||
// ignore: must_be_immutable
|
||||
class ResizeWidget extends StatefulWidget {
|
||||
Widget? bottomLeftBadge;
|
||||
Widget? bottomRightBadge;
|
||||
@@ -24,7 +23,7 @@ class ResizeWidget extends StatefulWidget {
|
||||
super.key,
|
||||
});
|
||||
|
||||
Color handlerColor = const Color.fromRGBO(38, 166, 154, 1);
|
||||
Color handlerColor = Color.fromRGBO(38, 166, 154, 1);
|
||||
final ElementWidgetState comp;
|
||||
///
|
||||
final Dashboard dashboard;
|
||||
|
||||
@@ -115,6 +115,14 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
hover_menu:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: hover_menu
|
||||
sha256: "73d68be1d63462da1fbaa0b6d57cd6939b324b714bb64559b4a1240ec780a9b0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -281,5 +289,5 @@ packages:
|
||||
source: hosted
|
||||
version: "14.2.5"
|
||||
sdks:
|
||||
dart: ">=3.3.0 <4.0.0"
|
||||
dart: ">=3.3.0 <=3.7.12"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
|
||||
@@ -17,6 +17,7 @@ dependencies:
|
||||
# https://pub.dev/packages/uuid
|
||||
flutter_box_transform: ^0.4.4
|
||||
flutter_colorpicker: ^1.1.0
|
||||
hover_menu: ^1.1.1
|
||||
number_text_input_formatter: ^1.0.0+8
|
||||
uuid: ^4.4.0
|
||||
|
||||
|
||||
@@ -6,10 +6,18 @@
|
||||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
||||
#include <desktop_window/desktop_window_plugin.h>
|
||||
#include <irondash_engine_context/irondash_engine_context_plugin.h>
|
||||
#include <super_native_extensions/super_native_extensions_plugin.h>
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
|
||||
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
|
||||
g_autoptr(FlPluginRegistrar) desktop_window_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWindowPlugin");
|
||||
desktop_window_plugin_register_with_registrar(desktop_window_registrar);
|
||||
g_autoptr(FlPluginRegistrar) irondash_engine_context_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "IrondashEngineContextPlugin");
|
||||
irondash_engine_context_plugin_register_with_registrar(irondash_engine_context_registrar);
|
||||
g_autoptr(FlPluginRegistrar) super_native_extensions_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "SuperNativeExtensionsPlugin");
|
||||
super_native_extensions_plugin_register_with_registrar(super_native_extensions_registrar);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
flutter_secure_storage_linux
|
||||
desktop_window
|
||||
irondash_engine_context
|
||||
super_native_extensions
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
||||
@@ -5,14 +5,18 @@
|
||||
import FlutterMacOS
|
||||
import Foundation
|
||||
|
||||
import flutter_appauth
|
||||
import flutter_secure_storage_darwin
|
||||
import desktop_window
|
||||
import device_info_plus
|
||||
import irondash_engine_context
|
||||
import path_provider_foundation
|
||||
import shared_preferences_foundation
|
||||
import super_native_extensions
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
FlutterAppauthPlugin.register(with: registry.registrar(forPlugin: "FlutterAppauthPlugin"))
|
||||
FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin"))
|
||||
DesktopWindowPlugin.register(with: registry.registrar(forPlugin: "DesktopWindowPlugin"))
|
||||
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
||||
IrondashEngineContextPlugin.register(with: registry.registrar(forPlugin: "IrondashEngineContextPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
SuperNativeExtensionsPlugin.register(with: registry.registrar(forPlugin: "SuperNativeExtensionsPlugin"))
|
||||
}
|
||||
|
||||
274
pubspec.lock
274
pubspec.lock
@@ -9,6 +9,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
animated_toggle_switch:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: animated_toggle_switch
|
||||
sha256: "786e82be3b004100299c1c6d023f8f1928decc8353a6fdff191bf78c866262fa"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.3"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -89,6 +97,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.8"
|
||||
dart_earcut:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -98,7 +114,7 @@ packages:
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
dashed_path:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: dashed_path
|
||||
sha256: "711cb86eb57e023e8ad9199ea717eaf0be0906743a884c261fbe2711dc12fe9d"
|
||||
@@ -113,6 +129,30 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
desktop_window:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: desktop_window
|
||||
sha256: cb30b3bcea10931a21333ed044f85054cf9242820f3c240264a4c0df324a9fd6
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.1"
|
||||
device_info_plus:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: device_info_plus
|
||||
sha256: a7fd703482b391a87d60b6061d04dfdeab07826b96f9abd8f5ed98068acc0074
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.1.2"
|
||||
device_info_plus_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: device_info_plus_platform_interface
|
||||
sha256: "282d3cf731045a2feb66abfe61bbc40870ae50a3ed10a4d3d217556c35c8c2ba"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.1"
|
||||
dio:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -137,6 +177,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.3"
|
||||
el_tooltip:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: el_tooltip
|
||||
sha256: "0860b00e9390a31dd98369dc16d3b6fa2668fc52df712bd00e86d8931787fc17"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -182,22 +230,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
flutter_appauth:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_appauth
|
||||
sha256: b09fa8e3eaba12ec341c69ec45063e06eb565304e24cc35caaf105bbae2e955c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.0.1"
|
||||
flutter_appauth_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_appauth_platform_interface
|
||||
sha256: fd2920b853d09741aff2e1178e044ea2ade0c87799cd8e63f094ab35b00fdf70
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.0.0"
|
||||
flutter_box_transform:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -214,6 +246,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
flutter_event_calendar:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_event_calendar
|
||||
sha256: f5b6f22ae01c24a1fc3f6432d3080130bb40efc976e53941b5f6422b6a4f9d64
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
flutter_flow_chart:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -237,54 +277,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.2"
|
||||
flutter_secure_storage:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_secure_storage
|
||||
sha256: da922f2aab2d733db7e011a6bcc4a825b844892d4edd6df83ff156b09a9b2e40
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.0"
|
||||
flutter_secure_storage_darwin:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_darwin
|
||||
sha256: "8878c25136a79def1668c75985e8e193d9d7d095453ec28730da0315dc69aee3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.0"
|
||||
flutter_secure_storage_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_linux
|
||||
sha256: "2b5c76dce569ab752d55a1cee6a2242bcc11fdba927078fb88c503f150767cda"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
flutter_secure_storage_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_platform_interface
|
||||
sha256: "8ceea1223bee3c6ac1a22dabd8feefc550e4729b3675de4b5900f55afcb435d6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
flutter_secure_storage_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_web
|
||||
sha256: "6a1137df62b84b54261dca582c1c09ea72f4f9a4b2fcee21b025964132d5d0c3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
flutter_secure_storage_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_windows
|
||||
sha256: "3b7c8e068875dfd46719ff57c90d8c459c87f2302ed6b00ff006b3c9fcad1613"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
flutter_spinkit:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -319,6 +311,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.8.0"
|
||||
get_it:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: get_it
|
||||
sha256: d85128a5dae4ea777324730dc65edd9c9f43155c109d5cc0a69cab74139fbac1
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.7.0"
|
||||
go_router:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -327,6 +327,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "14.3.0"
|
||||
hover_menu:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: hover_menu
|
||||
sha256: "73d68be1d63462da1fbaa0b6d57cd6939b324b714bb64559b4a1240ec780a9b0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
http:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -343,6 +351,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.2"
|
||||
injectable:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: injectable
|
||||
sha256: "3c8355a29d11ff28c0311bed754649761f345ef7a13ff66a714380954af51226"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.2"
|
||||
intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -351,6 +367,22 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.19.0"
|
||||
irondash_engine_context:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: irondash_engine_context
|
||||
sha256: cd7b769db11a2b5243b037c8a9b1ecaef02e1ae27a2d909ffa78c1dad747bb10
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.4"
|
||||
irondash_message_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: irondash_message_channel
|
||||
sha256: b4101669776509c76133b8917ab8cfc704d3ad92a8c450b92934dd8884a2f060
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.0"
|
||||
json_string:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -367,14 +399,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
jwt_decoder:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: jwt_decoder
|
||||
sha256: "54774aebf83f2923b99e6416b4ea915d47af3bde56884eb622de85feabbc559f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
latlong2:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -504,7 +528,7 @@ packages:
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
path_provider:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path_provider
|
||||
sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378
|
||||
@@ -559,6 +583,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.0.2"
|
||||
pixel_snap:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pixel_snap
|
||||
sha256: "677410ea37b07cd37ecb6d5e6c0d8d7615a7cf3bd92ba406fd1ac57e937d1fb0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.5"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -591,6 +623,22 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
scoped_model:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: scoped_model
|
||||
sha256: "8dacc77cb5de78d5e159d54cab883847491a73dfaa3d28c52f4ec8b0be32645b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
shamsi_date:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shamsi_date
|
||||
sha256: "5df195a0b7794b7d4a8dc9321244400147896def157b7530c5b8a2f9cfc6a7a4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.15.0"
|
||||
shared_preferences:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -684,6 +732,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
star_menu:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: star_menu
|
||||
sha256: f29c7d255677c49ec2412ec2d17220d967f54b72b9e6afc5688fe122ea4d1d78
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -700,6 +756,54 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
super_clipboard:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: super_clipboard
|
||||
sha256: "74098001413e075cc53dee72b68c32eaffc10709df41806800393abaa6dac9d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.19"
|
||||
super_drag_and_drop:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: super_drag_and_drop
|
||||
sha256: "20f4318a6c9e81a76cc090a0f2d845157ff4f3619ed784e3235324a45ce34507"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.19"
|
||||
super_native_extensions:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: super_native_extensions
|
||||
sha256: c24676825c9f3ae844676a843d45ad186f2270539ffe72be4277753e46d14e29
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.19"
|
||||
syncfusion_flutter_calendar:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: syncfusion_flutter_calendar
|
||||
sha256: "1fdbcb8435abc4a1fb36914b83d9690eb0dea617df3ac2772519fba7a3011828"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "27.1.55"
|
||||
syncfusion_flutter_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_flutter_core
|
||||
sha256: bc86234c9a0a87b6c3288b9065175e74e9a73e22b2237989a8bbdeff0c8befd7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "27.1.55"
|
||||
syncfusion_flutter_datepicker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_flutter_datepicker
|
||||
sha256: "54fe7e7a660ecdf072cceec890425d7531b42f647245f9244565c61e96fbca4a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "27.1.55"
|
||||
table_calendar:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -724,6 +828,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.2"
|
||||
timezone:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: timezone
|
||||
sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.4"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -800,10 +912,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e
|
||||
sha256: e1d0cc62e65dc2561f5071fcbccecf58ff20c344f8f3dc7d4922df372a11df1f
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.10.1"
|
||||
version: "5.7.1"
|
||||
win32_registry:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32_registry
|
||||
sha256: "10589e0d7f4e053f2c61023a31c9ce01146656a70b7b7f0828c0b46d7da2a9bb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.3"
|
||||
wkt_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -829,5 +949,5 @@ packages:
|
||||
source: hosted
|
||||
version: "6.5.0"
|
||||
sdks:
|
||||
dart: ">=3.5.0 <4.0.0"
|
||||
dart: ">=3.5.0 <=3.7.12"
|
||||
flutter: ">=3.19.0"
|
||||
|
||||
19
pubspec.yaml
19
pubspec.yaml
@@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: '>=3.4.0 <4.0.0'
|
||||
sdk: '>=3.3.4 <4.0.0'
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
@@ -31,9 +31,11 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
jwt_decoder: ^2.0.1
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.6
|
||||
desktop_window: ^0.4.0
|
||||
flutter_svg: ^2.0.10+1
|
||||
go_router: ^14.2.0
|
||||
shared_preferences: ^2.2.3
|
||||
@@ -42,25 +44,33 @@ dependencies:
|
||||
latlong2: ^0.9.1
|
||||
dio: ^5.5.0
|
||||
alert_banner: ^1.0.1
|
||||
injectable: ^2.4.2
|
||||
convert: ^3.1.1
|
||||
flutter_flow_chart:
|
||||
path: ./library/flutter_flow_chart
|
||||
star_menu: ^4.0.1
|
||||
path_provider: ^2.1.3
|
||||
super_drag_and_drop: ^0.8.17
|
||||
uuid: ^4.4.0
|
||||
box_transform: ^0.4.4
|
||||
flutter_box_transform: ^0.4.4
|
||||
animated_toggle_switch: ^0.8.2
|
||||
el_tooltip: ^2.0.0
|
||||
dashed_path: ^1.0.1
|
||||
dotted_line: ^3.2.2
|
||||
number_text_input_formatter: ^1.0.0+8
|
||||
flutter_colorpicker: ^1.1.0
|
||||
hover_menu: ^1.1.1
|
||||
datetime_picker_formfield: ^2.0.1
|
||||
intl: ^0.19.0
|
||||
flutter_advanced_switch: ^3.1.0
|
||||
cron: ^0.6.1
|
||||
flutter_event_calendar: ^1.0.0
|
||||
syncfusion_flutter_calendar: ^27.1.55
|
||||
json_string: ^3.0.1
|
||||
flutter_spinkit: ^5.2.1
|
||||
localstorage: ^5.0.0
|
||||
font_awesome_flutter: ^10.8.0
|
||||
flutter_appauth: ^9.0.1
|
||||
flutter_secure_storage: ^10.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
@@ -87,7 +97,6 @@ flutter:
|
||||
assets:
|
||||
- assets/images/logo.svg
|
||||
- assets/images/icon.svg
|
||||
- assets/images/workflow_event.svg
|
||||
- assets/config/front.json
|
||||
# To add assets to your application, add an assets section, like this:
|
||||
# assets:
|
||||
|
||||
@@ -6,9 +6,15 @@
|
||||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
|
||||
#include <desktop_window/desktop_window_plugin.h>
|
||||
#include <irondash_engine_context/irondash_engine_context_plugin_c_api.h>
|
||||
#include <super_native_extensions/super_native_extensions_plugin_c_api.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
|
||||
DesktopWindowPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("DesktopWindowPlugin"));
|
||||
IrondashEngineContextPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("IrondashEngineContextPluginCApi"));
|
||||
SuperNativeExtensionsPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("SuperNativeExtensionsPluginCApi"));
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
flutter_secure_storage_windows
|
||||
desktop_window
|
||||
irondash_engine_context
|
||||
super_native_extensions
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
||||
Reference in New Issue
Block a user