Files
SpotiFLAC-Mobile/lib/widgets/app_loading_indicator.dart
T
zarzet 962e582acc chore(flutter): move to Flutter 3.50.0 and the material_ui packages
Flutter 3.50 deprecates its built-in Material and Cupertino libraries in
favour of the material_ui and cupertino_ui packages. The imports move
with the official fix (dart fix, migrate_design_widgets); the app's old
two-library theme bridge collapses into one Theme type.

- MaterialExpressiveScope keeps the complete host theme nearest its
  child. The reduced copy made for the expressive widgets now shares the
  app's Theme type and would hide component themes and extensions.
- LegacyThemeBrightness hands the brightness to the glass package, which
  still reads Flutter's built-in theme.
- appLocalizationsDelegates lists the material_ui localization delegates;
  the generated list still names the built-in ones.
- Tests: findByTooltip and pageBack replace the flutter_test helpers that
  only know the built-in widgets, and several tests that had gone stale
  against earlier app changes are repaired.
2026-11-15 23:33:29 +07:00

52 lines
1.4 KiB
Dart

import 'package:material_ui/material_ui.dart';
import 'package:material_3_expressive/material_3_expressive.dart';
import 'package:mornye/theme/material_expressive.dart';
import 'package:mornye/theme/mornye_theme.dart';
/// Indeterminate loading only. Downloads/analysis keep their real progress.
class AppLoadingIndicator extends StatelessWidget {
const AppLoadingIndicator({
super.key,
this.size = 32,
this.color,
this.semanticLabel,
this.strokeWidth = 3,
});
final double size;
final Color? color;
final String? semanticLabel;
/// Stroke of the Mornye circular indicator.
final double strokeWidth;
@override
Widget build(BuildContext context) {
final animate =
!MediaQuery.disableAnimationsOf(context) &&
TickerMode.valuesOf(context).enabled;
return SizedBox.square(
dimension: size,
child: !context.isMornye
? MaterialExpressiveScope(
child: FittedBox(
child: M3ELoadingIndicator(
size: 48,
color: color,
rotationTurns: animate ? null : 0,
semanticLabel: semanticLabel,
),
),
)
: TickerMode(
enabled: animate,
child: CircularProgressIndicator(
color: color,
strokeWidth: strokeWidth,
semanticsLabel: semanticLabel,
),
),
);
}
}