mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-20 21:12:21 +01:00
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,free-days-interop) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / free-days-interop (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Flutter 3.50 deprecates package:flutter/material.dart, so the app moves to material_ui 1.11.0 together with sync_settings_ui 0.8.0 and github_device_auth 0.5.0 (crdt_sync 0.13.1 rides along). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
1.2 KiB
Dart
27 lines
1.2 KiB
Dart
import 'package:material_ui/material_ui.dart';
|
|
|
|
import 'package:wake_alarm_sync/main.dart';
|
|
import 'package:wake_alarm_sync/services/alarm_scheduler.dart';
|
|
|
|
/// Debug entrypoint that arms a real alarm a minute out, then shows the app.
|
|
///
|
|
/// Exercises the true `AlarmManager.setAlarmClock` path — the receiver, the
|
|
/// foreground service and the full-screen intent all firing on their own —
|
|
/// rather than the `ringNow` shortcut, which skips the scheduler entirely.
|
|
/// The offset comes from `--dart-define=ARM_IN_MINUTES`.
|
|
///
|
|
/// Not part of the shipped app: `flutter build apk` uses `lib/main.dart`.
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
const offset = int.fromEnvironment('ARM_IN_MINUTES', defaultValue: 1);
|
|
final scheduler = AlarmScheduler();
|
|
final at = DateTime.now().add(const Duration(minutes: offset));
|
|
final fsi = await scheduler.canUseFullScreenIntent();
|
|
// Printed so the harness can read the armed time out of logcat; this is a
|
|
// debug entrypoint, so stdout is the interface.
|
|
// ignore: avoid_print
|
|
print('ARM_PROBE armed=${at.hour}:${at.minute} fsi=$fsi');
|
|
await scheduler.schedule(at.hour, at.minute);
|
|
runApp(const WakeAlarmSyncApp());
|
|
}
|