mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-21 23:11:45 +02:00
The Material theme now draws its main surfaces with rounded Material Symbols: navigation, player, mini player, queue, settings, sheets, dialogs and shared controls. AppIcon maps legacy Icons to their symbol and keeps outlined glyphs unfilled. Mornye keeps its original icons. Icon buttons, text and filled buttons, dialog actions, sliders, the setup FAB and indeterminate spinners use the Material 3 Expressive components. Each wrapper falls back to the standard Flutter widget for Mornye, reduced motion and custom sizing, so existing layouts and hit areas stay intact.
52 lines
1.5 KiB
Dart
52 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:material_3_expressive/material_3_expressive.dart';
|
|
import 'package:spotiflac_android/theme/material_expressive.dart';
|
|
import 'package:spotiflac_android/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,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|