Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #62 from Myzel394/feat/0.9.0
Browse files Browse the repository at this point in the history
Feat/0.9.0
  • Loading branch information
Myzel394 authored Jun 17, 2023
2 parents f3f4071 + 58b1349 commit 4e4afac
Show file tree
Hide file tree
Showing 80 changed files with 3,645 additions and 1,177 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.10.0'
flutter-version: '3.10.1'

- name: Opt out of telemetry
run: flutter --disable-telemetry
Expand All @@ -33,6 +33,9 @@ jobs:
- name: Generate Localizations 🌐
run: flutter gen-l10n

- name: Run Tests 🧪
run: flutter test

- name: Build Android App - GMS variant 📱
run: flutter build apk --dart-define=app.flavor=gms --debug

Expand Down
5 changes: 5 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

<uses-permission android:name="android.permission.VIBRATE" />

<!-- Required for file transfer -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
Expand All @@ -24,6 +26,9 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

<uses-permission android:name="android.permission.USE_BIOMETRIC" />

<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES" />

<application
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/kotlin/com/example/locus/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.myzel394.locus

import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity : FlutterActivity() {
class MainActivity : FlutterFragmentActivity() {
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-mdpi/ic_launcher_monochrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions android/build/.last_build_id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
da915289e0fbb29c059c95e449e35540
19 changes: 12 additions & 7 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ PODS:
- Flutter
- geolocator_apple (1.2.0):
- Flutter
- local_auth_ios (0.0.1):
- Flutter
- map_launcher (0.0.1):
- Flutter
- path_provider_foundation (0.0.1):
Expand All @@ -78,15 +80,14 @@ PODS:
- SDWebImage/Core (5.15.6)
- share_plus (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- SwiftyGif (5.4.4)
- Tangram-es (0.17.1)
- uni_links (0.0.1):
- Flutter
- url_launcher_ios (0.0.1):
- Flutter
- vibration (1.7.5):
- Flutter
- ZIPFoundation (0.9.15)

DEPENDENCIES:
Expand All @@ -104,14 +105,15 @@ DEPENDENCIES:
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- geocoding_ios (from `.symlinks/plugins/geocoding_ios/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- local_auth_ios (from `.symlinks/plugins/local_auth_ios/ios`)
- map_launcher (from `.symlinks/plugins/map_launcher/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- quick_actions_ios (from `.symlinks/plugins/quick_actions_ios/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- uni_links (from `.symlinks/plugins/uni_links/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- vibration (from `.symlinks/plugins/vibration/ios`)

SPEC REPOS:
trunk:
Expand Down Expand Up @@ -153,6 +155,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/geocoding_ios/ios"
geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/ios"
local_auth_ios:
:path: ".symlinks/plugins/local_auth_ios/ios"
map_launcher:
:path: ".symlinks/plugins/map_launcher/ios"
path_provider_foundation:
Expand All @@ -163,12 +167,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/quick_actions_ios/ios"
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
uni_links:
:path: ".symlinks/plugins/uni_links/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
vibration:
:path: ".symlinks/plugins/vibration/ios"

SPEC CHECKSUMS:
Alamofire: d368e1ff8a298e6dde360e35a3e68e6c610e7204
Expand All @@ -188,18 +192,19 @@ SPEC CHECKSUMS:
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
geocoding_ios: a389ea40f6f548de6e63006a2e31bf66ff80769a
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
local_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605
map_launcher: e325db1261d029ff33e08e03baccffe09593ffea
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
Polyline: 2a1f29f87f8d9b7de868940f4f76deb8c678a5b1
quick_actions_ios: 9e80dcfadfbc5d47d9cf8f47bcf428b11cf383d4
SDWebImage: d47d81bea8a77187896b620dc79c3c528e8906b9
share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
Tangram-es: 628b634f7fc09d2217469b9914de00d9de49ff9d
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241
ZIPFoundation: 063163dc828bf699c5be160eb4f58f676322d94f

PODFILE CHECKSUM: 819f6e738594296500811eae0a41f3dceed5a207
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSFaceIDUsageDescription</key>
<string>Locus uses Face ID to lock the app if you enable biometric unlock</string>
</dict>
</plist>
45 changes: 24 additions & 21 deletions lib/App.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:locus/constants/colors.dart';
import 'package:locus/screens/BiometricsRequiredStartupScreen.dart';
import 'package:locus/screens/MainScreen.dart';
import 'package:locus/screens/WelcomeScreen.dart';
import 'package:locus/services/settings_service.dart';
import 'package:locus/utils/PageRoute.dart';
import 'package:locus/utils/color.dart';
import 'package:locus/widgets/DismissKeyboard.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
Expand Down Expand Up @@ -36,14 +38,7 @@ ColorScheme createColorScheme(
}

class App extends StatelessWidget {
final bool hasLocationAlwaysGranted;
final bool hasNotificationGranted;
final bool isIgnoringBatteryOptimizations;

const App({
required this.hasLocationAlwaysGranted,
required this.hasNotificationGranted,
required this.isIgnoringBatteryOptimizations,
super.key,
});

Expand Down Expand Up @@ -189,21 +184,29 @@ class App extends StatelessWidget {
),
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
onGenerateRoute: (settings) {
final screen = hasLocationAlwaysGranted &&
isIgnoringBatteryOptimizations &&
hasNotificationGranted
? const MainScreen()
: WelcomeScreen(
hasLocationAlwaysGranted: hasLocationAlwaysGranted,
hasNotificationGranted: hasNotificationGranted,
isIgnoringBatteryOptimizations:
isIgnoringBatteryOptimizations,
);
onGenerateRoute: (routeSettings) {
final screen = (() {
if (settings.getRequireBiometricAuthenticationOnStart()) {
return const BiometricsRequiredStartupScreen();
}

if (!settings.userHasSeenWelcomeScreen) {
return const WelcomeScreen();
}

return const MainScreen();
})();

if (isCupertino(context)) {
return MaterialWithModalsPageRoute(
builder: (_) => screen,
settings: routeSettings,
);
}

return MaterialWithModalsPageRoute(
builder: (context) => screen,
settings: settings,
return NativePageRoute(
builder: (_) => screen,
context: context,
);
},
),
Expand Down
5 changes: 4 additions & 1 deletion lib/api/get-address.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ Future<String> getAddressSystem(
final double latitude,
final double longitude,
) async {
List<Placemark> placemarks = await placemarkFromCoordinates(52.2165157, 6.9437819);
List<Placemark> placemarks = await placemarkFromCoordinates(
latitude,
longitude,
);

for (final placemark in placemarks) {
final address = [
Expand Down
34 changes: 33 additions & 1 deletion lib/api/get-locations.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:io';

import 'package:cryptography/cryptography.dart';
Expand Down Expand Up @@ -109,7 +110,8 @@ VoidCallback getLocations({
kinds: [1000],
authors: [nostrPublicKey],
limit: limit,
until: until == null ? null : (until.millisecondsSinceEpoch / 1000).floor(),
until:
until == null ? null : (until.millisecondsSinceEpoch / 1000).floor(),
since: from == null ? null : (from.millisecondsSinceEpoch / 1000).floor(),
),
]);
Expand Down Expand Up @@ -150,3 +152,33 @@ VoidCallback getLocations({
}
};
}

Future<List<LocationPointService>> getLocationsAsFuture({
required final String nostrPublicKey,
required final SecretKey encryptionPassword,
required final List<String> relays,
int? limit,
DateTime? from,
DateTime? until,
}) async {
final completer = Completer<List<LocationPointService>>();

final List<LocationPointService> locations = [];

getLocations(
nostrPublicKey: nostrPublicKey,
encryptionPassword: encryptionPassword,
relays: relays,
limit: limit,
from: from,
until: until,
onLocationFetched: (final LocationPointService location) {
locations.add(location);
},
onEnd: () {
completer.complete(locations);
},
);

return completer.future;
}
7 changes: 7 additions & 0 deletions lib/constants/notifications.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
enum AndroidChannelIDs {
locationAlarms,
}

enum NotificationActionType {
openTaskView,
}
3 changes: 2 additions & 1 deletion lib/constants/values.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ const LOCATION_INTERVAL = Duration(minutes: 2);
const TRANSFER_DATA_USERNAME = "locus_transfer";
final TRANSFER_SUCCESS_MESSAGE = Uint8List.fromList([1, 2, 3, 4]);

const CURRENT_APP_VERSION = "0.8.3";
const CURRENT_APP_VERSION = "0.9.0";

const LOG_TAG = "LocusLog";

const HTTP_TIMEOUT = Duration(seconds: 30);
const MAYBE_TRIGGER_MINIMUM_TIME_BETWEEN = Duration(hours: 4);
Loading

0 comments on commit 4e4afac

Please sign in to comment.