mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 00:21:19 +00:00
Added load local cert + misc map
This commit is contained in:
parent
dfa3cc6458
commit
2953c769f7
BIN
RELEASE/app-release_version_2_1_2.aab
Normal file
BIN
RELEASE/app-release_version_2_1_2.aab
Normal file
Binary file not shown.
@ -34,7 +34,7 @@ class ConfigViewWidget extends StatefulWidget {
|
|||||||
|
|
||||||
class _ConfigViewWidget extends State<ConfigViewWidget> {
|
class _ConfigViewWidget extends State<ConfigViewWidget> {
|
||||||
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
|
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
|
||||||
String url = "https://api.mymuseum.be"; //DEV "http://192.168.31.96" http://192.168.31.140:8089 // PROD MDLF "http://192.168.1.19"
|
String url = "https://api.myinfomate.be"; //DEV "http://192.168.31.96" http://192.168.31.140:8089 // PROD MDLF "http://192.168.1.19"
|
||||||
int? pinCode;
|
int? pinCode;
|
||||||
bool configOk = false;
|
bool configOk = false;
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class _FlutterMapViewState extends State<FlutterMapView> {
|
|||||||
mapContext.setSelectedPoint(point);
|
mapContext.setSelectedPoint(point);
|
||||||
mapContext.setSelectedPointForNavigate(point);*/
|
mapContext.setSelectedPointForNavigate(point);*/
|
||||||
mapContext.setSelectedPoint(point);
|
mapContext.setSelectedPoint(point);
|
||||||
mapContext.setSelectedPointForNavigate(point);
|
//mapContext.setSelectedPointForNavigate(point);
|
||||||
},
|
},
|
||||||
child: widget.icons.firstWhere((i) => i['id'] == point.categorieId, orElse: () => widget.icons.first)['icon'] != null ? Image.memory(widget.icons.firstWhere((i) => i['id'] == point.categorieId, orElse: () => widget.icons.first)['icon']) : Icon(Icons.pin_drop, color: Colors.red),//widget.icons.firstWhere((i) => i['id'] == point.categorieId, orElse: () => widget.icons.first)['icon'],
|
child: widget.icons.firstWhere((i) => i['id'] == point.categorieId, orElse: () => widget.icons.first)['icon'] != null ? Image.memory(widget.icons.firstWhere((i) => i['id'] == point.categorieId, orElse: () => widget.icons.first)['icon']) : Icon(Icons.pin_drop, color: Colors.red),//widget.icons.firstWhere((i) => i['id'] == point.categorieId, orElse: () => widget.icons.first)['icon'],
|
||||||
)
|
)
|
||||||
@ -122,7 +122,7 @@ class _FlutterMapViewState extends State<FlutterMapView> {
|
|||||||
var geoPoint = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
var geoPoint = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
||||||
if (geoPoint != null && mapController != null) {
|
if (geoPoint != null && mapController != null) {
|
||||||
print("COUCOU IL FAUT NAVIGATE FLUTTER MAP");
|
print("COUCOU IL FAUT NAVIGATE FLUTTER MAP");
|
||||||
mapController!.move(LatLng(double.tryParse(geoPoint.latitude!)!, double.tryParse(geoPoint.longitude!)!), 16);
|
mapController!.move(LatLng(double.tryParse(geoPoint.latitude!)!, double.tryParse(geoPoint.longitude!)!), mapController!.camera.zoom/*, widget.mapDTO!.zoom != null ? widget.mapDTO!.zoom!.toDouble() : 16*/); // keep actual zoom
|
||||||
}
|
}
|
||||||
return SizedBox();
|
return SizedBox();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -154,16 +154,49 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
|||||||
if (node.children.isNotEmpty) {
|
if (node.children.isNotEmpty) {
|
||||||
for (var childNode in node.children) {
|
for (var childNode in node.children) {
|
||||||
if (childNode.checked) {
|
if (childNode.checked) {
|
||||||
checkedGeoPoints.add(widget.geoPoints.firstWhere((point) => int.parse(
|
var point = widget.geoPoints.firstWhere(
|
||||||
(point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "").replaceAll("-", "")
|
(point) {
|
||||||
) == childNode.id));
|
String latitudePart = (point.latitude ?? '')
|
||||||
|
.substring(0, min(point.latitude!.length, 10))
|
||||||
|
.replaceAll(".", "")
|
||||||
|
.replaceAll("-", "");
|
||||||
|
String longitudePart = (point.longitude ?? '')
|
||||||
|
.substring(0, min(point.longitude!.length, 10))
|
||||||
|
.replaceAll(".", "")
|
||||||
|
.replaceAll("-", "");
|
||||||
|
int combinedValue = int.parse(latitudePart + longitudePart);
|
||||||
|
|
||||||
|
return combinedValue == node.id;
|
||||||
|
},
|
||||||
|
orElse: () => GeoPointDTO(id: -1),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (point.id != -1) {
|
||||||
|
checkedGeoPoints.add(point);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(node.checked) {
|
if(node.checked) {
|
||||||
checkedGeoPoints.add(widget.geoPoints.firstWhere((point) => int.parse(
|
var point = widget.geoPoints.firstWhere(
|
||||||
(point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "").replaceAll("-", "")
|
(point) {
|
||||||
) == node.id));
|
String latitudePart = (point.latitude ?? '')
|
||||||
|
.substring(0, min(point.latitude!.length, 10))
|
||||||
|
.replaceAll(".", "")
|
||||||
|
.replaceAll("-", "");
|
||||||
|
String longitudePart = (point.longitude ?? '')
|
||||||
|
.substring(0, min(point.longitude!.length, 10))
|
||||||
|
.replaceAll(".", "")
|
||||||
|
.replaceAll("-", "");
|
||||||
|
int combinedValue = int.parse(latitudePart + longitudePart);
|
||||||
|
return combinedValue == node.id;
|
||||||
|
},
|
||||||
|
orElse: () => GeoPointDTO(id: -1),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (point.id != -1) {
|
||||||
|
checkedGeoPoints.add(point);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -305,11 +338,29 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
|||||||
sendFilteredGeoPoint();
|
sendFilteredGeoPoint();
|
||||||
},
|
},
|
||||||
onClicked: (node, commonID) {
|
onClicked: (node, commonID) {
|
||||||
print("its clicked ! " + commonID.toString());
|
var selectedNode = widget.geoPoints.firstWhere(
|
||||||
var selectedNode = widget.geoPoints.firstWhere((point) => int.parse(
|
(point) {
|
||||||
(point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "").replaceAll("-", "")
|
String latitudePart = (point.latitude ?? '')
|
||||||
) == commonID);
|
.substring(0, min(point.latitude!.length, 10))
|
||||||
mapContext.setSelectedPointForNavigate(selectedNode);
|
.replaceAll(".", "")
|
||||||
|
.replaceAll("-", "");
|
||||||
|
String longitudePart = (point.longitude ?? '')
|
||||||
|
.substring(0, min(point.longitude!.length, 10))
|
||||||
|
.replaceAll(".", "")
|
||||||
|
.replaceAll("-", "");
|
||||||
|
|
||||||
|
int combinedValue = int.parse(latitudePart + longitudePart);
|
||||||
|
|
||||||
|
return combinedValue == commonID;
|
||||||
|
},
|
||||||
|
orElse: () => GeoPointDTO(id: -1),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedNode.id != -1) {
|
||||||
|
mapContext.setSelectedPointForNavigate(selectedNode);
|
||||||
|
} else {
|
||||||
|
print('Aucun point correspondant trouvé.');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
checkBoxColor: primaryColor,
|
checkBoxColor: primaryColor,
|
||||||
childrenPadding: EdgeInsets.only(left: 20, top: 10, right: 0, bottom: 10),
|
childrenPadding: EdgeInsets.only(left: 20, top: 10, right: 0, bottom: 10),
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
//setState(() {
|
//setState(() {
|
||||||
mapContext.setSelectedPoint(point);
|
mapContext.setSelectedPoint(point);
|
||||||
mapContext.setSelectedPointForNavigate(point);
|
//mapContext.setSelectedPointForNavigate(point);
|
||||||
//});
|
//});
|
||||||
},
|
},
|
||||||
infoWindow: InfoWindow.noText));
|
infoWindow: InfoWindow.noText));
|
||||||
@ -170,14 +170,18 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
var geopoint = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
var geopoint = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
||||||
if (geopoint != null && _GoogleMapcontroller != null) {
|
if (geopoint != null && _GoogleMapcontroller != null) {
|
||||||
print("COUCOU IL FAUT NAVUGATE");
|
print("COUCOU IL FAUT NAVUGATE");
|
||||||
_GoogleMapcontroller!.animateCamera(CameraUpdate.newCameraPosition(
|
// TODO Handle zoomDetail
|
||||||
CameraPosition(
|
_GoogleMapcontroller!.getZoomLevel().then((actualZoom) {
|
||||||
target: LatLng(double.tryParse(geopoint.latitude!)!, double.tryParse(geopoint.longitude!)!),
|
_GoogleMapcontroller!.animateCamera(CameraUpdate.newCameraPosition(
|
||||||
tilt: 0.0,
|
CameraPosition(
|
||||||
bearing: 0.0,
|
target: LatLng(double.tryParse(geopoint.latitude!)!, double.tryParse(geopoint.longitude!)!),
|
||||||
zoom: 16.0
|
tilt: 0.0,
|
||||||
)
|
bearing: 0.0,
|
||||||
));
|
zoom: actualZoom
|
||||||
|
//zoom: widget.mapDTO.zoom != null ? widget.mapDTO.zoom!.toDouble() : 16
|
||||||
|
)
|
||||||
|
));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return SizedBox();
|
return SizedBox();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -42,7 +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);
|
//mapContext.setSelectedPointForNavigate(markerToShow);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
print("ISSSUE setSelectedMarker");
|
print("ISSSUE setSelectedMarker");
|
||||||
print(e);
|
print(e);
|
||||||
@ -198,6 +198,7 @@ class _MapBoxViewState extends State<MapBoxView> {
|
|||||||
var geoPoint = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
var geoPoint = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
||||||
if (geoPoint != null && mapboxMap != null) {
|
if (geoPoint != null && mapboxMap != null) {
|
||||||
print("COUCOU IL FAUT NAVUGATE MAPBOX");
|
print("COUCOU IL FAUT NAVUGATE MAPBOX");
|
||||||
|
// TODO Handle zoomDetail
|
||||||
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()
|
||||||
|
|||||||
@ -111,7 +111,7 @@ class _MyAppState extends State<MyApp> {
|
|||||||
create: (_) => AppContext(widget.tabletAppContext),
|
create: (_) => AppContext(widget.tabletAppContext),
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
title: 'Tablet App Demo',
|
title: 'MyInfoMate Tablet App',
|
||||||
initialRoute: widget.initialRoute,
|
initialRoute: widget.initialRoute,
|
||||||
/*supportedLocales: [
|
/*supportedLocales: [
|
||||||
const Locale('en', 'US'),
|
const Locale('en', 'US'),
|
||||||
|
|||||||
@ -17,6 +17,8 @@ import 'dart:io';
|
|||||||
import 'package:http/http.dart';
|
import 'package:http/http.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:http/io_client.dart';
|
||||||
|
|
||||||
part 'api_client.dart';
|
part 'api_client.dart';
|
||||||
part 'api_helper.dart';
|
part 'api_helper.dart';
|
||||||
|
|||||||
@ -11,21 +11,23 @@
|
|||||||
part of openapi.api;
|
part of openapi.api;
|
||||||
|
|
||||||
class ApiClient {
|
class ApiClient {
|
||||||
ApiClient({this.basePath = 'https://api.myinfomate.be', this.authentication,});
|
ApiClient({this.basePath = 'https://api.myinfomate.be', this.authentication,}) {
|
||||||
|
_client = createIOClient();
|
||||||
|
}
|
||||||
|
|
||||||
final String basePath;
|
final String basePath;
|
||||||
final Authentication? authentication;
|
final Authentication? authentication;
|
||||||
|
|
||||||
var _client = Client();
|
late http.Client _client;
|
||||||
final _defaultHeaderMap = <String, String>{};
|
final _defaultHeaderMap = <String, String>{};
|
||||||
|
|
||||||
/// Returns the current HTTP [Client] instance to use in this class.
|
/// Returns the current HTTP [Client] instance to use in this class.
|
||||||
///
|
///
|
||||||
/// The return value is guaranteed to never be null.
|
/// The return value is guaranteed to never be null.
|
||||||
Client get client => _client;
|
http.Client get client => _client;
|
||||||
|
|
||||||
/// Requests to use a new HTTP [Client] in this class.
|
/// Requests to use a new HTTP [Client] in this class.
|
||||||
set client(Client newClient) {
|
set client(http.Client newClient) {
|
||||||
_client = newClient;
|
_client = newClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,6 +37,27 @@ class ApiClient {
|
|||||||
_defaultHeaderMap[key] = value;
|
_defaultHeaderMap[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HttpClient createHttpClient() {
|
||||||
|
SecurityContext context = SecurityContext.defaultContext;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Assumes that the certificate is in PEM format and located in the assets
|
||||||
|
context.setTrustedCertificates('/storage/emulated/0/Download/isrgrootx1.pem'); // Hardcoded for MDLF
|
||||||
|
} on TlsException catch (e) {
|
||||||
|
print('Error loading certificate: $e');
|
||||||
|
} on Exception catch (error) {
|
||||||
|
print('I guess not found, but nevermind for other than MDLF');
|
||||||
|
}
|
||||||
|
|
||||||
|
return HttpClient(context: context);
|
||||||
|
//..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
|
||||||
|
}
|
||||||
|
|
||||||
|
IOClient createIOClient() {
|
||||||
|
HttpClient httpClient = createHttpClient();
|
||||||
|
return IOClient(httpClient);
|
||||||
|
}
|
||||||
|
|
||||||
// We don't use a Map<String, String> for queryParams.
|
// We don't use a Map<String, String> for queryParams.
|
||||||
// If collectionFormat is 'multi', a key might appear multiple times.
|
// If collectionFormat is 'multi', a key might appear multiple times.
|
||||||
Future<Response> invokeAPI(
|
Future<Response> invokeAPI(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user