// Gadgetbridge's database export on this phone, through Android's file picker: picked once (the read // permission is kept), then read again after every new export — from the app and from background tasks // (a plugin, so WorkManager's engine has it too). Android: GbExportPlugin.kt. import 'package:flutter/services.dart'; const _channel = MethodChannel('dash/gbexport'); /// The system file picker → the file's uri (null = cancelled). Needs the app on screen. Future pickExport() => _channel.invokeMethod('pick'); /// {size, modified (ms)} — null when the file is gone or no longer readable. Future?> exportInfo(String uri) => _channel.invokeMapMethod('info', {'uri': uri}); /// The phone's time zone ("Europe/Bucharest"); null where there's no Android (tests). Future timeZone() async { try { return await _channel.invokeMethod('timeZone'); } on MissingPluginException { return null; } } /// Copy the file to [path] → true when copied. Future copyExport(String uri, String path) async => await _channel.invokeMethod('copy', {'uri': uri, 'path': path}) ?? false;