mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 14:29:35 +00:00
45 lines
998 B
Dart
45 lines
998 B
Dart
|
|
import 'package:flutter/material.dart';
|
||
|
|
import 'package:shimmer/shimmer.dart';
|
||
|
|
|
||
|
|
/// 加载框
|
||
|
|
|
||
|
|
// 页面加载
|
||
|
|
class PageSkeleton extends StatelessWidget {
|
||
|
|
const PageSkeleton({super.key});
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return const Scaffold(
|
||
|
|
body: Center(
|
||
|
|
child: CircularProgressIndicator(),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// a skeleton for the book cover
|
||
|
|
class BookCoverSkeleton extends StatelessWidget {
|
||
|
|
const BookCoverSkeleton({
|
||
|
|
super.key,
|
||
|
|
});
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return AspectRatio(
|
||
|
|
aspectRatio: 1,
|
||
|
|
child: SizedBox(
|
||
|
|
width: 150,
|
||
|
|
child: Shimmer.fromColors(
|
||
|
|
baseColor:
|
||
|
|
Theme.of(context).colorScheme.surface.withValues(alpha: 0.3),
|
||
|
|
highlightColor:
|
||
|
|
Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.1),
|
||
|
|
child: Container(
|
||
|
|
color: Theme.of(context).colorScheme.surface,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|