mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 08:31:19 +00:00
Fix map select point + add version number on mainview + section detail image video + fix quizz
This commit is contained in:
parent
d3fc3c416c
commit
17538eb223
@ -12,6 +12,7 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
||||||
import 'package:manager_api/api.dart';
|
import 'package:manager_api/api.dart';
|
||||||
|
import 'package:package_info/package_info.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:tablet_app/Components/loading_common.dart';
|
import 'package:tablet_app/Components/loading_common.dart';
|
||||||
@ -176,6 +177,22 @@ class _MainViewWidget extends State<MainViewWidget> {
|
|||||||
) : getGridSections(appContext, textColor),
|
) : getGridSections(appContext, textColor),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 0,
|
||||||
|
right: 0,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(4.0),
|
||||||
|
child: FutureBuilder(
|
||||||
|
future: getPlatformInfo(),
|
||||||
|
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
||||||
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
|
return Text(snapshot.data.version, style: TextStyle(fontSize: 8));
|
||||||
|
}
|
||||||
|
return SizedBox();
|
||||||
|
}
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
/*if(configurationDTO.weatherCity != null && configurationDTO.weatherCity!.length > 2 && configurationDTO.weatherResult != null)
|
/*if(configurationDTO.weatherCity != null && configurationDTO.weatherCity!.length > 2 && configurationDTO.weatherResult != null)
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
@ -381,6 +398,10 @@ class _MainViewWidget extends State<MainViewWidget> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPlatformInfo() async {
|
||||||
|
return await PackageInfo.fromPlatform();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boxDecoration(AppContext appContext, SectionDTO section, bool isSelected) {
|
boxDecoration(AppContext appContext, SectionDTO section, bool isSelected) {
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import 'package:tablet_app/Screens/MainView/main_view.dart';
|
|||||||
import 'package:tablet_app/Screens/Map/geo_point_filter.dart';
|
import 'package:tablet_app/Screens/Map/geo_point_filter.dart';
|
||||||
import 'package:tablet_app/Screens/Map/map_context.dart';
|
import 'package:tablet_app/Screens/Map/map_context.dart';
|
||||||
import 'package:html/parser.dart' show parse;
|
import 'package:html/parser.dart' show parse;
|
||||||
|
import 'package:tablet_app/Screens/Menu/menu_view.dart';
|
||||||
import 'package:tablet_app/app_context.dart';
|
import 'package:tablet_app/app_context.dart';
|
||||||
import 'package:tablet_app/constants.dart';
|
import 'package:tablet_app/constants.dart';
|
||||||
|
|
||||||
@ -109,11 +110,11 @@ class _SectionPageDetailState extends State<SectionPageDetail> {
|
|||||||
decoration: boxDecoration(appContext, widget.sectionDTO, true),
|
decoration: boxDecoration(appContext, widget.sectionDTO, true),
|
||||||
) : Container(
|
) : Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: widget.sectionDTO.imageSource == null ? kBackgroundLight : null, // default color if no image
|
color: widget.sectionDTO.imageSource == null && widget.sectionDTO.type != SectionType.Video ? kBackgroundLight : null, // default color if no image
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
image: widget.sectionDTO.imageSource != null ? new DecorationImage(
|
image: widget.sectionDTO.imageSource != null || widget.sectionDTO.type == SectionType.Video ? new DecorationImage(
|
||||||
fit: BoxFit.cover,
|
fit: widget.sectionDTO.type == SectionType.Video && widget.sectionDTO.imageId == null ? BoxFit.contain : BoxFit.cover,
|
||||||
image: ImageCustomProvider.getImageProvider(appContext, widget.sectionDTO.imageId!, widget.sectionDTO.imageSource!),
|
image: ImageCustomProvider.getImageProvider(appContext, widget.sectionDTO.imageId, widget.sectionDTO.type == SectionType.Video ? getYoutubeThumbnailUrl(widget.sectionDTO) : widget.sectionDTO.imageSource!),
|
||||||
): null,
|
): null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -67,6 +67,7 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
//setState(() {
|
//setState(() {
|
||||||
mapContext.setSelectedPoint(point);
|
mapContext.setSelectedPoint(point);
|
||||||
|
mapContext.setSelectedPointForNavigate(point);
|
||||||
//});
|
//});
|
||||||
},
|
},
|
||||||
infoWindow: InfoWindow.noText));
|
infoWindow: InfoWindow.noText));
|
||||||
@ -97,8 +98,6 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
|
|
||||||
pointsToShow = widget.geoPoints;
|
pointsToShow = widget.geoPoints;
|
||||||
|
|
||||||
GeoPointDTO? selectedPointNavigate = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
|
||||||
|
|
||||||
/*if(!init) {
|
/*if(!init) {
|
||||||
print("getmarkers in build");*/
|
print("getmarkers in build");*/
|
||||||
getMarkers(widget.language, mapContext);
|
getMarkers(widget.language, mapContext);
|
||||||
@ -157,10 +156,9 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
},
|
},
|
||||||
markers: markers,
|
markers: markers,
|
||||||
onTap: (LatLng location) {
|
onTap: (LatLng location) {
|
||||||
//setState(() {
|
print(location);
|
||||||
print(location);
|
mapContext.setSelectedPoint(null);
|
||||||
mapContext.setSelectedPoint(null);
|
mapContext.setSelectedPointForNavigate(null);
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -177,7 +175,7 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
target: LatLng(double.tryParse(geopoint.latitude!)!, double.tryParse(geopoint.longitude!)!),
|
target: LatLng(double.tryParse(geopoint.latitude!)!, double.tryParse(geopoint.longitude!)!),
|
||||||
tilt: 0.0,
|
tilt: 0.0,
|
||||||
bearing: 0.0,
|
bearing: 0.0,
|
||||||
zoom: 15.0
|
zoom: 16.0
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,7 @@ class AnnotationClickListener extends mapBox.OnPointAnnotationClickListener {
|
|||||||
try{
|
try{
|
||||||
var markerToShow = markersList.firstWhere((ml) => "${parse(ml.title!.first.value).documentElement!.text}${ml.latitude}${ml.longitude}" == annotation.textField);
|
var markerToShow = markersList.firstWhere((ml) => "${parse(ml.title!.first.value).documentElement!.text}${ml.latitude}${ml.longitude}" == annotation.textField);
|
||||||
mapContext.setSelectedPoint(markerToShow);
|
mapContext.setSelectedPoint(markerToShow);
|
||||||
|
mapContext.setSelectedPointForNavigate(markerToShow);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
print("ISSSUE setSelectedMarker");
|
print("ISSSUE setSelectedMarker");
|
||||||
print(e);
|
print(e);
|
||||||
@ -179,6 +180,7 @@ class _MapBoxViewState extends State<MapBoxView> {
|
|||||||
onTapListener: (listener) {
|
onTapListener: (listener) {
|
||||||
// close on tap
|
// close on tap
|
||||||
mapContext.setSelectedPoint(null);
|
mapContext.setSelectedPoint(null);
|
||||||
|
mapContext.setSelectedPointForNavigate(null);
|
||||||
},
|
},
|
||||||
cameraOptions: mapBox.CameraOptions(
|
cameraOptions: mapBox.CameraOptions(
|
||||||
center: mapBox.Point(coordinates: widget.mapDTO!.longitude != null && widget.mapDTO!.latitude != null ? mapBox.Position(double.tryParse(widget.mapDTO!.longitude!)!, double.tryParse(widget.mapDTO!.latitude!)!) : mapBox.Position(4.865105, 50.465503)).toJson(),
|
center: mapBox.Point(coordinates: widget.mapDTO!.longitude != null && widget.mapDTO!.latitude != null ? mapBox.Position(double.tryParse(widget.mapDTO!.longitude!)!, double.tryParse(widget.mapDTO!.latitude!)!) : mapBox.Position(4.865105, 50.465503)).toJson(),
|
||||||
@ -196,7 +198,7 @@ class _MapBoxViewState extends State<MapBoxView> {
|
|||||||
mapboxMap?.easeTo(
|
mapboxMap?.easeTo(
|
||||||
mapBox.CameraOptions(
|
mapBox.CameraOptions(
|
||||||
center: mapBox.Point(coordinates: mapBox.Position(double.tryParse(geoPoint.longitude!)!, double.tryParse(geoPoint.latitude!)!)).toJson(),
|
center: mapBox.Point(coordinates: mapBox.Position(double.tryParse(geoPoint.longitude!)!, double.tryParse(geoPoint.latitude!)!)).toJson(),
|
||||||
zoom: 15,
|
zoom: 16,
|
||||||
bearing: 0,
|
bearing: 0,
|
||||||
pitch: 3),
|
pitch: 3),
|
||||||
mapBox.MapAnimationOptions(duration: 2000, startDelay: 0));
|
mapBox.MapAnimationOptions(duration: 2000, startDelay: 0));
|
||||||
|
|||||||
@ -88,13 +88,13 @@ class _QuizzView extends State<QuizzView> {
|
|||||||
var test = goodResponses/quizzDTO.questions!.length;
|
var test = goodResponses/quizzDTO.questions!.length;
|
||||||
|
|
||||||
if(0 == test || test < 0.25)
|
if(0 == test || test < 0.25)
|
||||||
levelToShow = quizzDTO.badLevel!;
|
levelToShow = quizzDTO.badLevel;
|
||||||
if(test>=0.25 && test < 0.5)
|
if(test>=0.25 && test < 0.5)
|
||||||
levelToShow = quizzDTO.mediumLevel!;
|
levelToShow = quizzDTO.mediumLevel;
|
||||||
if(test>=0.5 && test < 0.75)
|
if(test>=0.5 && test < 0.75)
|
||||||
levelToShow = quizzDTO.goodLevel!;
|
levelToShow = quizzDTO.goodLevel;
|
||||||
if(test>=0.75 && test <= 1)
|
if(test>=0.75 && test <= 1)
|
||||||
levelToShow = quizzDTO.greatLevel!;
|
levelToShow = quizzDTO.greatLevel;
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround, //
|
mainAxisAlignment: MainAxisAlignment.spaceAround, //
|
||||||
@ -122,7 +122,7 @@ class _QuizzView extends State<QuizzView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (!showResponses && levelToShow!.label != null && levelToShow.label!.firstWhere((translation) => translation.language == appContext.getContext().language).resourceId != null)
|
if (levelToShow != null && !showResponses && levelToShow.label != null && levelToShow.label!.firstWhere((translation) => translation.language == appContext.getContext().language).resourceId != null)
|
||||||
Container(
|
Container(
|
||||||
//height: size.height * 0.2,
|
//height: size.height * 0.2,
|
||||||
//width: size.width * 0.25,
|
//width: size.width * 0.25,
|
||||||
|
|||||||
@ -4,7 +4,8 @@ import 'dart:io';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:manager_api/api.dart';
|
import 'package:manager_api/api.dart';
|
||||||
//import 'package:ota_update/ota_update.dart';
|
import 'package:ota_update/ota_update.dart';
|
||||||
|
import 'package:package_info/package_info.dart';
|
||||||
//import 'package:package_info_plus/package_info_plus.dart';
|
//import 'package:package_info_plus/package_info_plus.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:tablet_app/Models/tabletContext.dart';
|
import 'package:tablet_app/Models/tabletContext.dart';
|
||||||
@ -30,29 +31,36 @@ class _DownloadConfigurationWidgetState extends State<DownloadConfigurationWidge
|
|||||||
|
|
||||||
Future<void> tryOtaUpdate() async {
|
Future<void> tryOtaUpdate() async {
|
||||||
try {
|
try {
|
||||||
//print('ABI Platform: ${await OtaUpdate().getAbi()}');
|
print('ABI Platform: ${await OtaUpdate().getAbi()}');
|
||||||
//final info = await PackageInfo.fromPlatform();
|
final info = await PackageInfo.fromPlatform();
|
||||||
|
|
||||||
/*var test = info.version;
|
var test = info.version;
|
||||||
var test0 = info.appName;
|
var test0 = info.appName;
|
||||||
var test1 = info.buildNumber;
|
var test1 = info.buildNumber;
|
||||||
var test2 = info.buildSignature;
|
var test4 = info.packageName;
|
||||||
var test3 = info.installerStore;
|
|
||||||
var test4 = info.packageName;*/
|
|
||||||
|
|
||||||
|
var versionDispo = 13;
|
||||||
|
var versionDispoURL = 'https://drive.usercontent.google.com/download?id=1rO8eZBvmDcmARTOtUeGfeuN1buvafg6Z&export=download&authuser=0&confirm=t&uuid=8f923b32-bf10-4f98-abd6-7995cdc2af5e&at=APZUnTUSU7f9pLr8nN4hgW7wvEv6%3A1713883987919';
|
||||||
|
|
||||||
|
|
||||||
|
if(int.parse(test1) <= versionDispo) {
|
||||||
|
OtaUpdate()
|
||||||
|
.execute(
|
||||||
|
versionDispoURL,
|
||||||
|
destinationFilename: 'app-release_version_2_0_7.apk',
|
||||||
|
//FOR NOW ANDROID ONLY - ABILITY TO VALIDATE CHECKSUM OF FILE:
|
||||||
|
//sha256checksum: 'd6da28451a1e15cf7a75f2c3f151befad3b80ad0bb232ab15c20897e54f21478',
|
||||||
|
)
|
||||||
|
.listen(
|
||||||
|
(OtaEvent event) {
|
||||||
|
print("OtaEvent");
|
||||||
|
print(event);
|
||||||
|
//setState(() => currentEvent = event);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
//LINK CONTAINS APK OF FLUTTER HELLO WORLD FROM FLUTTER SDK EXAMPLES
|
//LINK CONTAINS APK OF FLUTTER HELLO WORLD FROM FLUTTER SDK EXAMPLES
|
||||||
/*OtaUpdate()
|
/**/
|
||||||
.execute(
|
|
||||||
'https://drive.google.com/file/d/1geAwa_GBiK_lNx_KE4PzzUfybjFFLZsX/view?usp=drive_link',
|
|
||||||
destinationFilename: 'myinfomate.apk',
|
|
||||||
//FOR NOW ANDROID ONLY - ABILITY TO VALIDATE CHECKSUM OF FILE:
|
|
||||||
//sha256checksum: 'd6da28451a1e15cf7a75f2c3f151befad3b80ad0bb232ab15c20897e54f21478',
|
|
||||||
)
|
|
||||||
.listen(
|
|
||||||
(OtaEvent event) {
|
|
||||||
setState(() => currentEvent = event);
|
|
||||||
},
|
|
||||||
);*/
|
|
||||||
// ignore: avoid_catches_without_on_clauses
|
// ignore: avoid_catches_without_on_clauses
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Failed to make OTA update. Details: $e');
|
print('Failed to make OTA update. Details: $e');
|
||||||
@ -70,7 +78,7 @@ class _DownloadConfigurationWidgetState extends State<DownloadConfigurationWidge
|
|||||||
Map<Permission, PermissionStatus> statuses = await [
|
Map<Permission, PermissionStatus> statuses = await [
|
||||||
Permission.requestInstallPackages,
|
Permission.requestInstallPackages,
|
||||||
].request();
|
].request();
|
||||||
tryOtaUpdate();
|
//tryOtaUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExportConfigurationDTO? exportConfigurationDTO;
|
ExportConfigurationDTO? exportConfigurationDTO;
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import audio_session
|
|||||||
import firebase_core
|
import firebase_core
|
||||||
import firebase_storage
|
import firebase_storage
|
||||||
import just_audio
|
import just_audio
|
||||||
|
import package_info
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
import shared_preferences_foundation
|
import shared_preferences_foundation
|
||||||
import sqflite
|
import sqflite
|
||||||
@ -20,6 +21,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||||||
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
|
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
|
||||||
FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin"))
|
FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin"))
|
||||||
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
|
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
|
||||||
|
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||||
|
|||||||
@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 2.0.6+12
|
version: 2.0.6+13
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.1.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
@ -34,10 +34,11 @@ dependencies:
|
|||||||
google_maps_flutter_web: ^0.5.4+3 # Specific WEB
|
google_maps_flutter_web: ^0.5.4+3 # Specific WEB
|
||||||
youtube_player_iframe: ^4.0.4 # Handle mobile and web here => TO TEST
|
youtube_player_iframe: ^4.0.4 # Handle mobile and web here => TO TEST
|
||||||
|
|
||||||
mapbox_maps_flutter: ^1.0.0
|
mapbox_maps_flutter: ^1.1.0
|
||||||
|
|
||||||
ota_update: ^6.0.0
|
ota_update: ^6.0.0
|
||||||
#package_info_plus: ^6.0.0
|
package_info: ^2.0.2
|
||||||
|
#package_info_plus: ^8.0.0 # chewie version casse couille
|
||||||
qr_flutter: ^4.1.0
|
qr_flutter: ^4.1.0
|
||||||
|
|
||||||
flare_flutter: ^3.0.2
|
flare_flutter: ^3.0.2
|
||||||
@ -46,7 +47,7 @@ dependencies:
|
|||||||
auto_size_text: ^3.0.0
|
auto_size_text: ^3.0.0
|
||||||
fluttertoast:
|
fluttertoast:
|
||||||
device_info: ^2.0.2 # DISCONTINUED
|
device_info: ^2.0.2 # DISCONTINUED
|
||||||
#device_info_plus: ^10.0.1 // chewie version casse couille, retourne à la 1.0.0 qui fout la merde
|
#device_info_plus: ^10.0.1 # chewie version casse couille, retourne à la 1.0.0 qui fout la merde
|
||||||
enum_to_string: ^2.0.1
|
enum_to_string: ^2.0.1
|
||||||
carousel_slider: ^4.2.1
|
carousel_slider: ^4.2.1
|
||||||
mqtt_client: ^10.0.0
|
mqtt_client: ^10.0.0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user