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"
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
compileSdkVersion 30
|
||||
|
||||
sourceSets {
|
||||
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).
|
||||
applicationId "be.musee.de.la.fraise.tablet_app"
|
||||
minSdkVersion 20
|
||||
targetSdkVersion 29
|
||||
targetSdkVersion 30
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
multiDexEnabled true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
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:mqtt_client/mqtt_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:unique_identifier/unique_identifier.dart';
|
||||
|
||||
import 'DatabaseHelper.dart';
|
||||
|
||||
@ -106,7 +106,7 @@ class MQTTHelper {
|
||||
Future<MqttServerClient> connect(dynamic appContext) async {
|
||||
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);
|
||||
isInstantiated = true;
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'package:device_info/device_info.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.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/rounded_input_field.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/Models/tabletContext.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 'dart:io';
|
||||
|
||||
import 'package:unique_identifier/unique_identifier.dart';
|
||||
|
||||
|
||||
class ConfigViewWidget extends StatefulWidget {
|
||||
ConfigViewWidget();
|
||||
@ -162,7 +162,8 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
|
||||
TabletAppContext tabletAppContext = new TabletAppContext();
|
||||
tabletAppContext.host = url;
|
||||
tabletAppContext.clientAPI = client;
|
||||
var identifier = await UniqueIdentifier.serial;
|
||||
|
||||
var identifier = await DeviceInfoHelper.getDeviceDetails();
|
||||
tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('http://', ''),'tablet_app_'+identifier);
|
||||
setState(() {
|
||||
appContext.setContext(tabletAppContext);
|
||||
@ -197,7 +198,7 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
|
||||
newDevice.configurationId = configurationDTO.id;
|
||||
newDevice.configuration = configurationDTO.label;
|
||||
newDevice.connected = true;
|
||||
newDevice.identifier = await UniqueIdentifier.serial;
|
||||
newDevice.identifier = await DeviceInfoHelper.getDeviceDetails();
|
||||
newDevice.ipAddressWLAN = await getIP(true);
|
||||
newDevice.ipAddressETH = await getIP(false);
|
||||
newDevice.name = newDevice.ipAddressWLAN;
|
||||
|
||||
@ -2,8 +2,6 @@
|
||||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
import FlutterMacOS
|
||||
import Foundation
|
||||
|
||||
|
||||
41
pubspec.lock
@ -7,7 +7,7 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0"
|
||||
version: "2.8.1"
|
||||
auto_size_text:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -42,7 +42,7 @@ packages:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.3.1"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -78,6 +78,20 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -105,7 +119,7 @@ packages:
|
||||
name: flare_flutter
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.2"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@ -141,7 +155,7 @@ packages:
|
||||
name: fluttertoast
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "8.0.7"
|
||||
version: "8.0.8"
|
||||
google_maps_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -155,7 +169,7 @@ packages:
|
||||
name: google_maps_flutter_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.1"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -204,7 +218,7 @@ packages:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.7.0"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -272,14 +286,14 @@ packages:
|
||||
name: sqflite
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0+3"
|
||||
version: "2.0.0+4"
|
||||
sqflite_common:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sqflite_common
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0+2"
|
||||
version: "2.0.1"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -328,7 +342,7 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19"
|
||||
version: "0.4.2"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -336,13 +350,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -363,7 +370,7 @@ packages:
|
||||
name: webview_flutter
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.10"
|
||||
version: "2.0.12"
|
||||
youtube_player_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@ -31,7 +31,7 @@ dependencies:
|
||||
http: ^0.12.2
|
||||
auto_size_text: ^2.1.0
|
||||
fluttertoast:
|
||||
unique_identifier: ^0.0.3
|
||||
device_info: ^2.0.2
|
||||
enum_to_string: ^2.0.1
|
||||
carousel_slider: ^4.0.0
|
||||
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
|
||||
# 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.
|
||||
flutter:
|
||||
|
||||
# The following line ensures that the Material Icons font is
|
||||
# included with your application, so that you can use the icons in
|
||||
# the material Icons class.
|
||||
|
||||