Skip to content

Commit

Permalink
Add about-app page and update db version and app version
Browse files Browse the repository at this point in the history
  • Loading branch information
junghyun397 committed Feb 3, 2020
1 parent 590f0c6 commit bd13698
Show file tree
Hide file tree
Showing 12 changed files with 207 additions and 31 deletions.
Binary file added assets/images/app_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/data/data_sqlite3_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
22 changes: 15 additions & 7 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"pageMainPanel_FAB_panels": "Panel",
"pageMainPanel_FAB_network": "Network",
"pageMainPanel_FAB_settings": "Setting",
"pageMainPanel_FAB_about": "About",



Expand Down Expand Up @@ -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",
Expand All @@ -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.",
Expand All @@ -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.",



Expand Down Expand Up @@ -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."

}
9 changes: 8 additions & 1 deletion lib/l10n/intl_ko.arb
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,12 @@
"componentSettingInfo_sliderDetentPoints_description": "멈춤쇠 위치를 설정 합니다",

"componentSettingInfo_buttonLabel_name": "버튼 라벨",
"componentSettingInfo_buttonLabel_description": "버튼 위에 표시되는 라벨을 설정합니다."
"componentSettingInfo_buttonLabel_description": "버튼 위에 표시되는 라벨을 설정합니다.",



"pageAboutApp_title": "VFT Flight Throttle 앱 정보",

"pageAboutApp_developerInfo": "junghyun397에 의해 개발됨."

}
17 changes: 2 additions & 15 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 {

Expand Down Expand Up @@ -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],
);
}
Expand Down
98 changes: 98 additions & 0 deletions lib/page/about/page_about_app.dart
Original file line number Diff line number Diff line change
@@ -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<StatefulWidget> createState() => _PageAboutAppState();

}

class _PageAboutAppState extends DynamicDirectionState<PageAboutApp> {

@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: <Widget>[
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);
}
);

}
12 changes: 12 additions & 0 deletions lib/page/main/page_main_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ class _PageMainPanelState extends FixedDirectionState<PageMainPanel> {
),
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),
),
],
),
);
Expand Down
21 changes: 21 additions & 0 deletions lib/routes.dart
Original file line number Diff line number Diff line change
@@ -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 = "/";
Expand All @@ -10,4 +19,16 @@ class Routes {

static const String PAGE_NETWORK = "/network";

static const String PAGE_ABOUT = "/about";

static final Map<String, Widget Function(BuildContext)> 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(),
};

}
46 changes: 43 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: VirtualFlightThrottle
description: Customizable Virtual Flight-Throttle&#x2F;Controller

version: 0.1.0+1
version: 0.2.0

environment:
sdk: ">=2.2.2 <3.0.0"
Expand Down Expand Up @@ -36,6 +36,8 @@ dependencies:

dotted_border: ^1.0.4

url_launcher: ^5.4.1

flutter_localizations:
sdk: flutter

Expand All @@ -48,6 +50,7 @@ flutter:

assets:
- assets/jsons/
- assets/images/

flutter_intl:
enabled: true
3 changes: 2 additions & 1 deletion vftdevice/network_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions vftdevice/vft_device_server_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit bd13698

Please sign in to comment.