diff --git a/assets/images/app_logo.png b/assets/images/app_logo.png new file mode 100755 index 0000000..0e6a0bc Binary files /dev/null and b/assets/images/app_logo.png differ diff --git a/lib/data/data_sqlite3_helper.dart b/lib/data/data_sqlite3_helper.dart index 34f07d6..0038069 100644 --- a/lib/data/data_sqlite3_helper.dart +++ b/lib/data/data_sqlite3_helper.dart @@ -15,7 +15,7 @@ class SQLite3Helper { SQLite3Helper._internal(); static const String DB_NAME = "virtual_throttle_database.db"; - static const int DB_VERSION = 5; + static const int DB_VERSION = 6; Database _db; diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 0a15a09..84ffb3c 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -9,6 +9,7 @@ "pageMainPanel_FAB_panels": "Panel", "pageMainPanel_FAB_network": "Network", "pageMainPanel_FAB_settings": "Setting", + "pageMainPanel_FAB_about": "About", @@ -56,8 +57,8 @@ "pageNetwork_state_findingDeviceServer": "Finding Device Server...", - "pageNetwork_state_notFound": "PC side Device Server not found.", - "pageNetwork_state_notFound_description": "Please check if {interfaceName} is turned on or PC side device is running.", + "pageNetwork_state_notFound": "VFT Device Server not found.", + "pageNetwork_state_notFound_description": "Please check if {interfaceName} is turned on or VFT Device Server is running.", "pageNetwork_state_found": "Found {count} PC-side devices.", "pageNetwork_state_found_tapToConnection": "Tap to connect with this device", @@ -84,9 +85,9 @@ "dialogPanelBuilder_panelPreferences_blocks": "blocks", "dialogPanelBuilder_panelPreferences_width": "Panel width", - "dialogPanelBuilder_panelPreferences_widthError": "This device allows up to {maxWidth} width.", + "dialogPanelBuilder_panelPreferences_widthError": "This device allows up to {maxWidth}blocks width.", "dialogPanelBuilder_panelPreferences_height": "Panel height", - "dialogPanelBuilder_panelPreferences_heightError": "This device allows up to {maxHeight} height.", + "dialogPanelBuilder_panelPreferences_heightError": "This device allows up to {maxHeight}blocks height.", "dialogPanelBuilder_panelPreferences_jsonData": "JSON data", "dialogPanelBuilder_panelPreferences_jsonDataError_tooLarge": "This panel is larger than the maximum size supported by this device.", @@ -101,8 +102,8 @@ "pagePanelBuilder_components": "Components", - "pagePanelBuilder_infoBar_selectMode": "Select an empty space to specify location and size of the component.", - "pagePanelBuilder_infoBar_editMode": "Tap on components to modify components.", + "pagePanelBuilder_infoBar_selectMode": "Select an empty space to specify location and size of component.", + "pagePanelBuilder_infoBar_editMode": "Tap component to modify component preference.", @@ -152,5 +153,12 @@ "componentSettingInfo_sliderDetentPoints_description": "Set detent positions", "componentSettingInfo_buttonLabel_name": "Button label", - "componentSettingInfo_buttonLabel_description": "Set button label" + "componentSettingInfo_buttonLabel_description": "Set button label", + + + + "pageAboutApp_title": "About VFT Flight Throttle app", + + "pageAboutApp_developerInfo": "Developed by junghyun397." + } \ No newline at end of file diff --git a/lib/l10n/intl_ko.arb b/lib/l10n/intl_ko.arb index 0b141ea..755e3fe 100644 --- a/lib/l10n/intl_ko.arb +++ b/lib/l10n/intl_ko.arb @@ -152,5 +152,12 @@ "componentSettingInfo_sliderDetentPoints_description": "멈춤쇠 위치를 설정 합니다", "componentSettingInfo_buttonLabel_name": "버튼 라벨", - "componentSettingInfo_buttonLabel_description": "버튼 위에 표시되는 라벨을 설정합니다." + "componentSettingInfo_buttonLabel_description": "버튼 위에 표시되는 라벨을 설정합니다.", + + + + "pageAboutApp_title": "VFT Flight Throttle 앱 정보", + + "pageAboutApp_developerInfo": "junghyun397에 의해 개발됨." + } diff --git a/lib/main.dart b/lib/main.dart index c009449..710be64 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,9 +3,6 @@ import 'dart:ui'; import 'package:VirtualFlightThrottle/data/data_settings.dart'; import 'package:VirtualFlightThrottle/data/data_sqlite3_helper.dart'; import 'package:VirtualFlightThrottle/network/network_manager.dart'; -import 'package:VirtualFlightThrottle/page/panel/builder/page_panel_builder.dart'; -import 'package:VirtualFlightThrottle/page/panel/list/page_panel_list.dart'; -import 'package:VirtualFlightThrottle/page/panel/store/page_panel_store.dart'; import 'package:VirtualFlightThrottle/panel/panel_manager.dart'; import 'package:VirtualFlightThrottle/routes.dart'; import 'package:VirtualFlightThrottle/utility/utility_system.dart'; @@ -16,9 +13,6 @@ import 'package:flutter_localizations/flutter_localizations.dart'; import 'generated/l10n.dart'; import 'page/direction_state.dart'; -import 'page/main/page_main_panel.dart'; -import 'page/network/page_network.dart'; -import 'page/settings/page_settings.dart'; class VirtualThrottleApp extends StatelessWidget { @@ -50,15 +44,8 @@ class VirtualThrottleApp extends StatelessWidget { ], supportedLocales: S.delegate.supportedLocales, - initialRoute: "/", - routes: { - Routes.PAGE_MAIN_PANEL: (context) => PageMainPanel(), - Routes.PAGE_PANEL_LIST: (context) => PagePanelList(), - Routes.PAGE_PANEL_BUILDER: (context) => PagePanelBuilder(), - Routes.PAGE_PANEL_STORE: (context) => PagePanelStore(), - Routes.PAGE_NETWORK: (context) => PageNetwork(), - Routes.PAGE_SETTING: (context) => PageSettings(), - }, + initialRoute: Routes.PAGE_MAIN_PANEL, + routes: Routes.routes, navigatorObservers: [routeObserver], ); } diff --git a/lib/page/about/page_about_app.dart b/lib/page/about/page_about_app.dart new file mode 100644 index 0000000..662d4b7 --- /dev/null +++ b/lib/page/about/page_about_app.dart @@ -0,0 +1,98 @@ +import 'package:VirtualFlightThrottle/generated/l10n.dart'; +import 'package:VirtualFlightThrottle/page/direction_state.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class PageAboutApp extends StatefulWidget { + + @override + State createState() => _PageAboutAppState(); + +} + +class _PageAboutAppState extends DynamicDirectionState { + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + automaticallyImplyLeading: true, + title: Text(S.of(context).pageAboutApp_title), + ), + body: Container( + child: Center( + child: Column( + children: [ + Image( + width: 150, + height: 150, + image: AssetImage("assets/images/app_logo.png"), + ), + Padding(padding: EdgeInsets.all(5)), + Text( + "VFT Flight Throttle", + style: TextStyle(fontSize: 30), + ), + Padding(padding: EdgeInsets.all(2)), + Text.rich( + TextSpan( + children: [ + _LinkTextSpan( + text: "Github Repository", + url: "https://github.com/junghyun397/VirtualThrottle", + ), + TextSpan(text: " • "), + _LinkTextSpan( + text: "Project Wiki", + url: "https://github.com/junghyun397/VirtualThrottle/wiki", + ), + ], + ) + ), + Padding(padding: EdgeInsets.all(20)), + Text( + S.of(context).pageAboutApp_developerInfo, + style: TextStyle(fontSize: 17), + ), + Padding(padding: EdgeInsets.all(5)), + Text.rich( + TextSpan( + children: [ + _LinkTextSpan( + text: "Github Profile", + url: "https://github.com/junghyun397", + ), + TextSpan(text: " • "), + _LinkTextSpan( + text: "LinkedIn", + url: "https://www.linkedin.com/in/choi-jeonghyeon-207272177/", + ), + TextSpan(text: " • "), + _LinkTextSpan( + text: "Discord", + url: "https://discordapp.com/users/365253864649392128", + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + +} + +class _LinkTextSpan extends TextSpan { + + _LinkTextSpan({@required String text, @required String url}) : super( + style: TextStyle(color: Colors.blueAccent), + text: text ?? url, + recognizer: TapGestureRecognizer()..onTap = () { + launch(url, forceSafariVC: false); + } + ); + +} \ No newline at end of file diff --git a/lib/page/main/page_main_panel.dart b/lib/page/main/page_main_panel.dart index 5c0f2e8..40d8208 100644 --- a/lib/page/main/page_main_panel.dart +++ b/lib/page/main/page_main_panel.dart @@ -172,6 +172,18 @@ class _PageMainPanelState extends FixedDirectionState { ), onTap: () => Navigator.pushNamed(context, Routes.PAGE_SETTING), ), + SpeedDialChild( + child: const Icon( + Icons.info_outline, + color: Colors.black87, + ), + backgroundColor: Colors.white, + label: S.of(context).pageMainPanel_FAB_about, + labelStyle: const TextStyle( + color: Colors.black54, + ), + onTap: () => Navigator.pushNamed(context, Routes.PAGE_ABOUT), + ), ], ), ); diff --git a/lib/routes.dart b/lib/routes.dart index c5dc38e..66cb30a 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,3 +1,12 @@ +import 'package:VirtualFlightThrottle/page/about/page_about_app.dart'; +import 'package:VirtualFlightThrottle/page/main/page_main_panel.dart'; +import 'package:VirtualFlightThrottle/page/network/page_network.dart'; +import 'package:VirtualFlightThrottle/page/panel/builder/page_panel_builder.dart'; +import 'package:VirtualFlightThrottle/page/panel/list/page_panel_list.dart'; +import 'package:VirtualFlightThrottle/page/panel/store/page_panel_store.dart'; +import 'package:VirtualFlightThrottle/page/settings/page_settings.dart'; +import 'package:flutter/material.dart'; + class Routes { static const String PAGE_MAIN_PANEL = "/"; @@ -10,4 +19,16 @@ class Routes { static const String PAGE_NETWORK = "/network"; + static const String PAGE_ABOUT = "/about"; + + static final Map routes = { + Routes.PAGE_MAIN_PANEL: (context) => PageMainPanel(), + Routes.PAGE_PANEL_LIST: (context) => PagePanelList(), + Routes.PAGE_PANEL_BUILDER: (context) => PagePanelBuilder(), + Routes.PAGE_PANEL_STORE: (context) => PagePanelStore(), + Routes.PAGE_NETWORK: (context) => PageNetwork(), + Routes.PAGE_SETTING: (context) => PageSettings(), + Routes.PAGE_ABOUT: (context) => PageAboutApp(), + }; + } \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 36c9d43..1ceea6b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -142,6 +142,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" flutter_xlider: dependency: "direct main" description: @@ -218,7 +223,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.6.0" pedantic: dependency: transitive description: @@ -247,13 +252,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.1" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "4.0.2" quiver: dependency: transitive description: @@ -307,7 +319,7 @@ packages: name: synchronized url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.2.0" term_glyph: dependency: transitive description: @@ -329,6 +341,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.6" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "5.4.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+2" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0+2" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 75f40bc..63fa3f1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: VirtualFlightThrottle description: Customizable Virtual Flight-Throttle/Controller -version: 0.1.0+1 +version: 0.2.0 environment: sdk: ">=2.2.2 <3.0.0" @@ -36,6 +36,8 @@ dependencies: dotted_border: ^1.0.4 + url_launcher: ^5.4.1 + flutter_localizations: sdk: flutter @@ -48,6 +50,7 @@ flutter: assets: - assets/jsons/ + - assets/images/ flutter_intl: enabled: true \ No newline at end of file diff --git a/vftdevice/network_interface.py b/vftdevice/network_interface.py index f67638d..50860de 100644 --- a/vftdevice/network_interface.py +++ b/vftdevice/network_interface.py @@ -92,7 +92,8 @@ def _run_socket(self): while True: try: data = client_socket.recv(1024).decode() - except ConnectionResetError: + except ConnectionResetError as error: + print("[!] handle error:", str(error)) self.kill_socket() return diff --git a/vftdevice/vft_device_server_linux.py b/vftdevice/vft_device_server_linux.py index a20397c..14f256a 100644 --- a/vftdevice/vft_device_server_linux.py +++ b/vftdevice/vft_device_server_linux.py @@ -4,6 +4,5 @@ print("[!] warning! VFT-device-server for linux is write for debugging. " "linux version has no functionality other than to receive packets.") - socket = SocketListener(on_packet_receive=lambda _: None, use_recover_socket=False) + socket = SocketListener(on_packet_receive=lambda _: None, use_recover_socket=True) socket.start_socket() -