46 lines
1.3 KiB
Dart
46 lines
1.3 KiB
Dart
// Author: fruit.com.cn
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../../../core/theme/app_colors.dart';
|
|
import '../../../core/theme/app_dimens.dart';
|
|
|
|
class PlayerLoadingOverlay extends StatelessWidget {
|
|
const PlayerLoadingOverlay({
|
|
super.key,
|
|
required this.opacity,
|
|
required this.onFadeEnd,
|
|
});
|
|
|
|
final double opacity;
|
|
final VoidCallback onFadeEnd;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AnimatedOpacity(
|
|
opacity: opacity,
|
|
duration: const Duration(milliseconds: 140),
|
|
curve: Curves.easeOut,
|
|
onEnd: onFadeEnd,
|
|
child: Container(
|
|
key: const Key('player-loading-surface'),
|
|
width: AppDimens.refreshIndicatorSize,
|
|
height: AppDimens.refreshIndicatorSize,
|
|
decoration: BoxDecoration(
|
|
color: AppColors.refreshIndicatorSurface,
|
|
borderRadius: BorderRadius.circular(AppDimens.refreshIndicatorRadius),
|
|
),
|
|
alignment: Alignment.center,
|
|
child: const SizedBox.square(
|
|
dimension: AppDimens.refreshSpinnerSize,
|
|
child: CircularProgressIndicator(
|
|
key: Key('player-entry-loading'),
|
|
color: Colors.white,
|
|
strokeWidth: AppDimens.refreshSpinnerStroke,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|