Compare commits
9 Commits
7eb09390ad
...
master
Author | SHA1 | Date | |
---|---|---|---|
d428be6504 | |||
608ef75f9f | |||
4474eb0aa9 | |||
8be01e92a8 | |||
b64e1525ae | |||
27ffb07256 | |||
9fbc19ff7e | |||
a2326118d2 | |||
169ebeb30a |
@ -41,6 +41,8 @@
|
||||
<data android:mimeType="text/plain"/>
|
||||
</intent>
|
||||
</queries>
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
</manifest>
|
||||
|
30
assets/ca/lets-encrypt-r3.pem
Normal file
30
assets/ca/lets-encrypt-r3.pem
Normal file
@ -0,0 +1,30 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw
|
||||
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
|
||||
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMjAwOTA0MDAwMDAw
|
||||
WhcNMjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
|
||||
RW5jcnlwdDELMAkGA1UEAxMCUjMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
|
||||
AoIBAQC7AhUozPaglNMPEuyNVZLD+ILxmaZ6QoinXSaqtSu5xUyxr45r+XXIo9cP
|
||||
R5QUVTVXjJ6oojkZ9YI8QqlObvU7wy7bjcCwXPNZOOftz2nwWgsbvsCUJCWH+jdx
|
||||
sxPnHKzhm+/b5DtFUkWWqcFTzjTIUu61ru2P3mBw4qVUq7ZtDpelQDRrK9O8Zutm
|
||||
NHz6a4uPVymZ+DAXXb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7mP3GFxJSqv3+0lUFJoi5Lc5da149p90Ids
|
||||
hCExroL1+7mryIkXPeFM5TgO9r0rvZaBFOvV2z0gp35Z0+L4WPlbuEjN/lxPFin+
|
||||
HlUjr8gRsI3qfJOQFy/9rKIJR0Y/8Omwt/8oTWgy1mdeHmmjk7j1nYsvC9JSQ6Zv
|
||||
MldlTTKB3zhThV1+XWYp6rjd5JW1zbVWEkLNxE7GJThEUG3szgBVGP7pSWTUTsqX
|
||||
nLRbwHOoq7hHwg==
|
||||
-----END CERTIFICATE-----
|
@ -1,10 +1,19 @@
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:app/state/timeStatusState.dart';
|
||||
import 'package:app/state/mapState.dart';
|
||||
import 'package:app/view/home.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
void main() {
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
ByteData data = await PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem');
|
||||
SecurityContext.defaultContext.setTrustedCertificatesBytes(data.buffer.asUint8List());
|
||||
|
||||
runApp(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
|
@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:app/extensions/obtainProviderExtension.dart';
|
||||
import 'package:app/extensions/positionLatLngExtension.dart';
|
||||
import 'package:app/state/mapState.dart';
|
||||
@ -32,14 +34,42 @@ class _HomePageState extends State<HomeView> {
|
||||
});
|
||||
});
|
||||
|
||||
requestLiveLocation(context.obtainState<MapState>(), false, true, true);
|
||||
requestLiveLocation(false, true, true);
|
||||
}
|
||||
|
||||
Future<void> requestLiveLocation(MapState mapState, bool ask, bool orLast, bool loadingIndicator) async {
|
||||
Future<void> requestLiveLocation(bool ask, bool orLast, bool loadingIndicator) async {
|
||||
Position? position;
|
||||
MapState mapState = context.obtainState<MapState>();
|
||||
LocationPermission permission = await Geolocator.checkPermission();
|
||||
log(permission.toString());
|
||||
|
||||
if (loadingIndicator && permission != LocationPermission.deniedForever) {
|
||||
if(
|
||||
permission == LocationPermission.denied
|
||||
|| permission == LocationPermission.deniedForever
|
||||
|| permission == LocationPermission.unableToDetermine
|
||||
) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text("Standort"),
|
||||
content: const Text("Dein Standort konnte nicht bestimmt werden.\nAktiviere für die Standortbestimmung deinen Standort und gib der App die entsprechenden Berechtigungen."),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text("Okay"),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
loadingIndicator
|
||||
&& permission != LocationPermission.deniedForever
|
||||
&& permission != LocationPermission.denied
|
||||
) {
|
||||
setState(() {
|
||||
locationLoading = true;
|
||||
});
|
||||
@ -125,7 +155,7 @@ class _HomePageState extends State<HomeView> {
|
||||
}
|
||||
return const Icon(Icons.location_disabled);
|
||||
}),
|
||||
onPressed: () => requestLiveLocation(context.obtainState<MapState>(), true, false, true),
|
||||
onPressed: () => requestLiveLocation(true, false, true),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
|
@ -33,12 +33,12 @@ class TimeWarningView extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
"In Fußgängerzone?",
|
||||
"In einer Fußgängerzone?",
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
Flexible(
|
||||
child: Text(
|
||||
"hier ist der Konsum nur\nzwischen 20 und 7 Uhr gestattet!",
|
||||
"hier ist der Konsum nur\nzwischen 20 und 7 Uhr gestattet",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
|
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 1.0.0+1
|
||||
version: 1.1.1+6
|
||||
|
||||
environment:
|
||||
sdk: '>=3.3.2 <4.0.0'
|
||||
@ -70,7 +70,8 @@ flutter:
|
||||
|
||||
# To add assets to your application, add an assets section, like this:
|
||||
assets:
|
||||
- assets/splash/splash.png
|
||||
- assets/ca/
|
||||
- assets/splash/splash.png
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.dev/assets-and-images/#resolution-aware
|
||||
|
Reference in New Issue
Block a user