fix(theme): every spinner is Material 3 Expressive's, pulling down too
The app's spinner is Material 3 Expressive's morphing indicator, but pulling a list down (the library, a studyset's parts, Explore) showed Flutter's older circular one, as did the spinners in buttons and a few dialogs. Pulling down now brings the app's spinner in a small round container that comes down with the pull and stays while it refreshes (AppRefreshIndicator, over Flutter's RefreshIndicator without its own spinner), and buttons show it small in their own colour (ButtonLoadingIndicator). Only determinate progress (a mastery ring) stays a circle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
5455453d20
commit
a57816a869
1 changed files with 194 additions and 25 deletions
|
|
@ -0,0 +1,44 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:expressive_loading_indicator/expressive_loading_indicator.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:halkyon_learn_flutter/src/core/theme/app_theme.dart';
|
||||
import 'package:halkyon_learn_flutter/src/core/widget/app_loading_indicator.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("pulled down, it refreshes with the app's spinner, Material 3 "
|
||||
"Expressive's, not Flutter's older one", (tester) async {
|
||||
final refreshing = Completer<void>();
|
||||
var refreshes = 0;
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: appTheme(Brightness.light),
|
||||
home: Scaffold(
|
||||
body: AppRefreshIndicator(
|
||||
onRefresh: () {
|
||||
refreshes++;
|
||||
return refreshing.future;
|
||||
},
|
||||
child: ListView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
children: const [Text('Japanese')],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(find.byType(ExpressiveLoadingIndicator), findsNothing);
|
||||
|
||||
await tester.fling(find.text('Japanese'), const Offset(0, 400), 1000);
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 300));
|
||||
expect(refreshes, 1);
|
||||
expect(find.byType(ExpressiveLoadingIndicator), findsOneWidget);
|
||||
expect(find.byType(CircularProgressIndicator), findsNothing);
|
||||
|
||||
refreshing.complete();
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(ExpressiveLoadingIndicator), findsNothing);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue