Commit 52eb7efe authored by Nicolas Richard Walter Boeckh's avatar Nicolas Richard Walter Boeckh 💬
Browse files

Create a notification and a to force the app to remain awake, :kotlin first

parent e2873e65
{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"battery","dependencies":[]},{"name":"geolocator","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","dependencies":[]},{"name":"location_permissions","dependencies":[]},{"name":"path_provider","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"plugin_scaffold","dependencies":[]},{"name":"rx_ble","dependencies":["plugin_scaffold"]},{"name":"sqflite","dependencies":[]}]}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"battery","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\battery-0.3.1+7\\\\","dependencies":[]},{"name":"geolocator","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\geolocator-5.2.1\\\\","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_api_availability-2.0.2\\\\","dependencies":[]},{"name":"location_permissions","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location_permissions-2.0.4+1\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.0\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-4.2.0+hotfix.3\\\\","dependencies":[]},{"name":"plugin_scaffold","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\plugin_scaffold-1.2.0\\\\","dependencies":[]},{"name":"rx_ble","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\rx_ble-0.6.1\\\\","dependencies":["plugin_scaffold"]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.2.0\\\\","dependencies":[]}],"android":[{"name":"battery","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\battery-0.3.1+7\\\\","dependencies":[]},{"name":"geolocator","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\geolocator-5.2.1\\\\","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_api_availability-2.0.2\\\\","dependencies":[]},{"name":"location_permissions","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location_permissions-2.0.4+1\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.0\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-4.2.0+hotfix.3\\\\","dependencies":[]},{"name":"plugin_scaffold","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\plugin_scaffold-1.2.0\\\\","dependencies":[]},{"name":"rx_ble","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\rx_ble-0.6.1\\\\","dependencies":["plugin_scaffold"]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.2.0\\\\","dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.2.0\\\\","dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"battery","dependencies":[]},{"name":"geolocator","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","dependencies":[]},{"name":"location_permissions","dependencies":[]},{"name":"path_provider","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"plugin_scaffold","dependencies":[]},{"name":"rx_ble","dependencies":["plugin_scaffold"]},{"name":"sqflite","dependencies":[]}],"date_created":"2020-02-07 07:07:12.872699","version":"1.14.7-pre.83"}
\ No newline at end of file
......@@ -29,6 +29,7 @@ Thought of firmware implementation for obfuscation / integrity verification. See
- [Permissions aaS](https://www.filledstacks.com/snippet/request-permissions-in-flutter-as-a-service/)
- [Toasts](https://www.filledstacks.com/snippet/easy-toasts-with-ok-toast/)
- [Theme Manager](https://www.filledstacks.com/snippet/build-a-theme-manager-in-flutter/)
- [Splash Screen](https://www.filledstacks.com/snippet/setting-up-your-splash-screen-in-flutter/)
- [Dialogs](https://www.filledstacks.com/snippet/quick-and-easy-dialogs-in-flutter-with-rf-flutter/)
- [Platform Channels](https://flutter.dev/docs/development/platform-integration/platform-channels?tab=ios-channel-swift-tab) \[[Code](https://github.com/flutter/flutter/tree/master/examples/platform_channel_swift)\]
......@@ -37,6 +38,11 @@ Thought of firmware implementation for obfuscation / integrity verification. See
- [Streams Channel](https://pub.dev/packages/streams_channel)
- [More Channels](https://programming.vip/docs/flutter-learning-notes-29-how-flutter-communicates-with-native.html)
- [More Channels - SO](https://stackoverflow.com/questions/56170451/what-is-the-difference-between-methodchannel-eventchannel-basicmessagechannel)
- [Gist with multiple Flutter projects](https://solido.github.io/awesome-flutter/)
- [Bluetooth but foreground](https://medium.com/flutter-community/flutter-adding-bluetooth-functionality-1b9715ccc698)
- [Use to check wakedness](https://github.com/transistorsoft/flutter_background_fetch)
- [Workmanager](https://medium.com/vrt-digital-studio/flutter-workmanager-81e0cfbd6f6e) \[[Pub Repo](https://pub.dev/packages/workmanager)\]
- [flutter_map Pub repo](https://pub.dev/packages/flutter_map)
## [0.0.1] - 05/02/2020
......
......@@ -6,6 +6,7 @@
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="logair_application"
......
......@@ -16,8 +16,9 @@ import io.flutter.plugin.common.MethodChannel
class Channels {
val BATTERY_CHANNEL = "logair.application/battery";
val BATTERY_CHARGE = "logair.aplication/battery_charge_status";
val BLUETOOTH_CHANNEL = "logair.application/btle";
}
}
class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
......@@ -34,6 +35,8 @@ class MainActivity: FlutterActivity() {
} else
result.notImplemented()
}
val channel = BasicMessageChannel<String>(flutterView, "foo", StringCodec.INSTANCE);
}
private fun getBatteryLevel(): Int {
......
/*package com.logair.logair_application
import android.app.*
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.os.IBinder
import android.os.PowerManager
import android.provider.Settings
import android.widget.Toast
import java.text.SimpleDateFormat
import java.util.*
import java.util.*
class WakeService : Service() {
private var wakeLock: PowerManager.WakeLock? = null
private var isServiceStarted = false
override fun onBind(intent: Intent): IBinder? {
log("Some component want to bind with the service")
// We don't provide binding, so return null
return null
}
}*/
\ No newline at end of file
class Channels {
static const String BATTERY = 'logair.aplication/battery';
static const String BATTERY_CHARGE = 'logair.aplication/battery_charge_status';
static const String BLUETOOTH = 'logair.aplication/btle';
}
\ No newline at end of file
import 'package:flutter/services.dart';
import 'package:logair_application/enums/platform_channels.dart';
class BatteryService {
static const platform = const MethodChannel('logair.application/battery');
static const MethodChannel methodChannel = const MethodChannel(Channels.BATTERY);
static const EventChannel eventChannel = const EventChannel(Channels.BATTERY_CHARGE);
Future<int> get batteryLevel async {
int batteryLevel;
try {
batteryLevel = await platform.invokeMethod('getBatteryLevel');
batteryLevel = await methodChannel.invokeMethod('getBatteryLevel');
} on PlatformException catch (e) {
print('BATTERY_SERVICE : $e');
}
......
......@@ -3,5 +3,9 @@ import 'package:flutter/services.dart';
class BTLEHandler {
static const platform = const MethodChannel('logair.application/btle');
Future<void> bluetoothTick() {
// Do BTLE stuff
return null;
}
}
\ No newline at end of file
......@@ -225,7 +225,7 @@ packages:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.0"
version: "0.16.1"
intl_translation:
dependency: "direct main"
description:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment