mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-20 05:34:23 +01:00
Flutter 3.50 deprecates package:flutter/material.dart, which made flutter-analyze report 27 deprecated_member_use infos and blocked the gate. workout_app now imports material_ui 1.11.0, with crdt_sync_dart 0.14.1 and sync_settings_ui 0.8.2 (both on material_ui). material_ui's MaterialApp ships its own MaterialLocalizations, so a package that still calls the framework showDialog threw a null check. WorkoutApp now adds the framework delegate, and a widget test opens a material_ui and a framework dialog through the real app root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWWfb63jncj9Lca2jeX
44 lines
1.3 KiB
Dart
44 lines
1.3 KiB
Dart
// The lifecycle observer that starts and stops the phone's HTTP socket.
|
|
//
|
|
// Linux returns early because main() never starts the socket there, so a
|
|
// resume must not start one behind the lock screen's back.
|
|
import 'package:material_ui/material_ui.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
|
|
import 'package:workout_app/main.dart';
|
|
import 'package:workout_app/services/storage_service.dart';
|
|
|
|
import 'fake_secure_storage.dart';
|
|
|
|
void main() {
|
|
TestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
setUpAll(() {
|
|
// The widget-test host has no Android sqflite plugin; the FFI factory
|
|
// drives the same schema, as everywhere else in this suite.
|
|
sqfliteFfiInit();
|
|
databaseFactory = databaseFactoryFfi;
|
|
});
|
|
|
|
setUp(() async {
|
|
StorageService.resetForTesting();
|
|
await StorageService.init();
|
|
installFakeSecureStorage();
|
|
});
|
|
|
|
testWidgets('every lifecycle transition is handled without throwing', (
|
|
tester,
|
|
) async {
|
|
await tester.pumpWidget(const WorkoutApp());
|
|
await tester.pump();
|
|
|
|
// Drives didChangeAppLifecycleState for each state the switch names.
|
|
for (final state in AppLifecycleState.values) {
|
|
tester.binding.handleAppLifecycleStateChanged(state);
|
|
await tester.pump();
|
|
}
|
|
|
|
expect(tester.takeException(), isNull);
|
|
});
|
|
}
|