For apk compilation + icons
@ -0,0 +1 @@
|
|||||||
|
{"images":[]}
|
||||||
BIN
AppIcons (2)/android/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
AppIcons (2)/android/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
AppIcons (2)/android/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
AppIcons (2)/android/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
AppIcons (2)/android/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
AppIcons (2)/appstore.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
AppIcons (2)/playstore.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
|
|||||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 30
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main.java.srcDirs += 'src/main/kotlin'
|
main.java.srcDirs += 'src/main/kotlin'
|
||||||
@ -40,9 +40,10 @@ android {
|
|||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "be.musee.de.la.fraise.tablet_app"
|
applicationId "be.musee.de.la.fraise.tablet_app"
|
||||||
minSdkVersion 20
|
minSdkVersion 20
|
||||||
targetSdkVersion 29
|
targetSdkVersion 30
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
|
multiDexEnabled true
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
||||||
|
|||||||
BIN
assets/icons/icon.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
33
lib/Helpers/DeviceInfoHelper.dart
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:device_info/device_info.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
class DeviceInfoHelper {
|
||||||
|
static Future<String> getDeviceDetails() async {
|
||||||
|
/* String deviceName;
|
||||||
|
String deviceVersion;*/
|
||||||
|
String identifier;
|
||||||
|
final DeviceInfoPlugin deviceInfoPlugin = new DeviceInfoPlugin();
|
||||||
|
try {
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
var build = await deviceInfoPlugin.androidInfo;
|
||||||
|
/*deviceName = build.model;
|
||||||
|
deviceVersion = build.version.toString();*/
|
||||||
|
identifier = build.androidId; //UUID for Android
|
||||||
|
print(identifier);
|
||||||
|
|
||||||
|
} else if (Platform.isIOS) {
|
||||||
|
var data = await deviceInfoPlugin.iosInfo;
|
||||||
|
/*deviceName = data.name;
|
||||||
|
deviceVersion = data.systemVersion;*/
|
||||||
|
identifier = data.identifierForVendor; //UUID for iOS
|
||||||
|
}
|
||||||
|
} on PlatformException {
|
||||||
|
print('Failed to get platform version');
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (!mounted) return;
|
||||||
|
return identifier;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,8 +5,8 @@ import 'package:fluttertoast/fluttertoast.dart';
|
|||||||
import 'package:managerapi/api.dart';
|
import 'package:managerapi/api.dart';
|
||||||
import 'package:mqtt_client/mqtt_client.dart';
|
import 'package:mqtt_client/mqtt_client.dart';
|
||||||
import 'package:mqtt_client/mqtt_server_client.dart';
|
import 'package:mqtt_client/mqtt_server_client.dart';
|
||||||
|
import 'package:tablet_app/Helpers/DeviceInfoHelper.dart';
|
||||||
import 'package:tablet_app/Models/tabletContext.dart';
|
import 'package:tablet_app/Models/tabletContext.dart';
|
||||||
import 'package:unique_identifier/unique_identifier.dart';
|
|
||||||
|
|
||||||
import 'DatabaseHelper.dart';
|
import 'DatabaseHelper.dart';
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ class MQTTHelper {
|
|||||||
Future<MqttServerClient> connect(dynamic appContext) async {
|
Future<MqttServerClient> connect(dynamic appContext) async {
|
||||||
TabletAppContext tabletAppContext = appContext.getContext();
|
TabletAppContext tabletAppContext = appContext.getContext();
|
||||||
|
|
||||||
var identifier = await UniqueIdentifier.serial;
|
var identifier = await DeviceInfoHelper.getDeviceDetails();
|
||||||
tabletAppContext.clientMQTT = MqttServerClient.withPort(tabletAppContext.host.replaceAll('http://', ''), 'tablet_app_'+identifier, 1883);
|
tabletAppContext.clientMQTT = MqttServerClient.withPort(tabletAppContext.host.replaceAll('http://', ''), 'tablet_app_'+identifier, 1883);
|
||||||
isInstantiated = true;
|
isInstantiated = true;
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:device_info/device_info.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@ -9,6 +10,7 @@ import 'package:tablet_app/Components/Buttons/rounded_button.dart';
|
|||||||
import 'package:tablet_app/Components/loading.dart';
|
import 'package:tablet_app/Components/loading.dart';
|
||||||
import 'package:tablet_app/Components/rounded_input_field.dart';
|
import 'package:tablet_app/Components/rounded_input_field.dart';
|
||||||
import 'package:tablet_app/Helpers/DatabaseHelper.dart';
|
import 'package:tablet_app/Helpers/DatabaseHelper.dart';
|
||||||
|
import 'package:tablet_app/Helpers/DeviceInfoHelper.dart';
|
||||||
import 'package:tablet_app/Helpers/MQTTHelper.dart';
|
import 'package:tablet_app/Helpers/MQTTHelper.dart';
|
||||||
import 'package:tablet_app/Models/tabletContext.dart';
|
import 'package:tablet_app/Models/tabletContext.dart';
|
||||||
import 'package:tablet_app/Screens/MainView/dropDown_configuration.dart';
|
import 'package:tablet_app/Screens/MainView/dropDown_configuration.dart';
|
||||||
@ -18,8 +20,6 @@ import 'package:tablet_app/client.dart';
|
|||||||
import 'package:tablet_app/constants.dart';
|
import 'package:tablet_app/constants.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:unique_identifier/unique_identifier.dart';
|
|
||||||
|
|
||||||
|
|
||||||
class ConfigViewWidget extends StatefulWidget {
|
class ConfigViewWidget extends StatefulWidget {
|
||||||
ConfigViewWidget();
|
ConfigViewWidget();
|
||||||
@ -162,7 +162,8 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
|
|||||||
TabletAppContext tabletAppContext = new TabletAppContext();
|
TabletAppContext tabletAppContext = new TabletAppContext();
|
||||||
tabletAppContext.host = url;
|
tabletAppContext.host = url;
|
||||||
tabletAppContext.clientAPI = client;
|
tabletAppContext.clientAPI = client;
|
||||||
var identifier = await UniqueIdentifier.serial;
|
|
||||||
|
var identifier = await DeviceInfoHelper.getDeviceDetails();
|
||||||
tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('http://', ''),'tablet_app_'+identifier);
|
tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('http://', ''),'tablet_app_'+identifier);
|
||||||
setState(() {
|
setState(() {
|
||||||
appContext.setContext(tabletAppContext);
|
appContext.setContext(tabletAppContext);
|
||||||
@ -197,7 +198,7 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
|
|||||||
newDevice.configurationId = configurationDTO.id;
|
newDevice.configurationId = configurationDTO.id;
|
||||||
newDevice.configuration = configurationDTO.label;
|
newDevice.configuration = configurationDTO.label;
|
||||||
newDevice.connected = true;
|
newDevice.connected = true;
|
||||||
newDevice.identifier = await UniqueIdentifier.serial;
|
newDevice.identifier = await DeviceInfoHelper.getDeviceDetails();
|
||||||
newDevice.ipAddressWLAN = await getIP(true);
|
newDevice.ipAddressWLAN = await getIP(true);
|
||||||
newDevice.ipAddressETH = await getIP(false);
|
newDevice.ipAddressETH = await getIP(false);
|
||||||
newDevice.name = newDevice.ipAddressWLAN;
|
newDevice.name = newDevice.ipAddressWLAN;
|
||||||
|
|||||||
@ -2,8 +2,6 @@
|
|||||||
// Generated file. Do not edit.
|
// Generated file. Do not edit.
|
||||||
//
|
//
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|||||||
41
pubspec.lock
@ -7,7 +7,7 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.0"
|
version: "2.8.1"
|
||||||
auto_size_text:
|
auto_size_text:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -42,7 +42,7 @@ packages:
|
|||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.3.1"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -78,6 +78,20 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.3"
|
version: "1.0.3"
|
||||||
|
device_info:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: device_info
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.2"
|
||||||
|
device_info_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: device_info_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
enum_to_string:
|
enum_to_string:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -105,7 +119,7 @@ packages:
|
|||||||
name: flare_flutter
|
name: flare_flutter
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
version: "3.0.2"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@ -141,7 +155,7 @@ packages:
|
|||||||
name: fluttertoast
|
name: fluttertoast
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.0.7"
|
version: "8.0.8"
|
||||||
google_maps_flutter:
|
google_maps_flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -155,7 +169,7 @@ packages:
|
|||||||
name: google_maps_flutter_platform_interface
|
name: google_maps_flutter_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
http:
|
http:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -204,7 +218,7 @@ packages:
|
|||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.7.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -272,14 +286,14 @@ packages:
|
|||||||
name: sqflite
|
name: sqflite
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0+3"
|
version: "2.0.0+4"
|
||||||
sqflite_common:
|
sqflite_common:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: sqflite_common
|
name: sqflite_common
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0+2"
|
version: "2.0.1"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -328,7 +342,7 @@ packages:
|
|||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.19"
|
version: "0.4.2"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -336,13 +350,6 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
unique_identifier:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: unique_identifier
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.0.3"
|
|
||||||
uuid:
|
uuid:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -363,7 +370,7 @@ packages:
|
|||||||
name: webview_flutter
|
name: webview_flutter
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.10"
|
version: "2.0.12"
|
||||||
youtube_player_flutter:
|
youtube_player_flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -31,7 +31,7 @@ dependencies:
|
|||||||
http: ^0.12.2
|
http: ^0.12.2
|
||||||
auto_size_text: ^2.1.0
|
auto_size_text: ^2.1.0
|
||||||
fluttertoast:
|
fluttertoast:
|
||||||
unique_identifier: ^0.0.3
|
device_info: ^2.0.2
|
||||||
enum_to_string: ^2.0.1
|
enum_to_string: ^2.0.1
|
||||||
carousel_slider: ^4.0.0
|
carousel_slider: ^4.0.0
|
||||||
youtube_player_flutter: ^7.0.0+7
|
youtube_player_flutter: ^7.0.0+7
|
||||||
@ -50,9 +50,13 @@ dev_dependencies:
|
|||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
||||||
|
flutter_icons:
|
||||||
|
android: "launcher_icon"
|
||||||
|
ios: false
|
||||||
|
image_path: "assets/icons/icon.png"
|
||||||
|
|
||||||
# The following section is specific to Flutter.
|
# The following section is specific to Flutter.
|
||||||
flutter:
|
flutter:
|
||||||
|
|
||||||
# The following line ensures that the Material Icons font is
|
# The following line ensures that the Material Icons font is
|
||||||
# included with your application, so that you can use the icons in
|
# included with your application, so that you can use the icons in
|
||||||
# the material Icons class.
|
# the material Icons class.
|
||||||
|
|||||||