Three-way switch in the sidebar footer next to the settings gear. Cycles system → light → dark → system. Choice persists via shared_preferences across app launches; restored before the first frame so there's no theme flicker on startup. The icon changes per state (auto / sun / moon) and the tooltip spells it out so the cycling behaviour is discoverable. - StudioApp is now stateful; exposes StudioApp.of(context) to let descendants flip the theme without prop-drilling. - ThemeModeValue enum lives in data/hub.dart so the persistence layer stays free of flutter/material imports. Bumps fai_studio 0.6.0 -> 0.7.0. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
21 lines
680 B
Dart
21 lines
680 B
Dart
// Smoke test: app boots without crashing and shows the four
|
|
// MVP destinations in the sidebar.
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:fai_studio/data/hub.dart';
|
|
import 'package:fai_studio/main.dart';
|
|
|
|
void main() {
|
|
testWidgets('Studio shell shows the four destinations',
|
|
(tester) async {
|
|
await tester.pumpWidget(
|
|
const StudioApp(initialThemeMode: ThemeModeValue.system),
|
|
);
|
|
|
|
expect(find.text('F∆I Studio'), findsOneWidget);
|
|
expect(find.text('Doctor'), findsWidgets);
|
|
expect(find.text('Modules'), findsWidgets);
|
|
expect(find.text('Audit'), findsWidgets);
|
|
expect(find.text('Approvals'), findsWidgets);
|
|
});
|
|
}
|