opt: pages

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-24 16:36:26 +08:00
parent 4d7d9abc60
commit c28729af5b
27 changed files with 266 additions and 310 deletions

View File

@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
class StyleString {
static const double cardSpace = 8;
static const double safeSpace = 12;
static BorderRadius mdRadius = BorderRadius.circular(10);
static const BorderRadius mdRadius = BorderRadius.all(Radius.circular(10));
static const Radius imgRadius = Radius.circular(10);
static const double aspectRatio = 16 / 10;
}

View File

@@ -99,7 +99,7 @@ class ShimmerState extends State<Shimmer> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return widget.child ?? const SizedBox();
return widget.child ?? const SizedBox.shrink();
}
}
@@ -165,7 +165,7 @@ class _ShimmerLoadingState extends State<ShimmerLoading> {
final shimmer = Shimmer.of(context)!;
if (!shimmer.isSized) {
return const SizedBox();
return const SizedBox.shrink();
}
final shimmerSize = shimmer.size;
final gradient = shimmer.gradient;

View File

@@ -37,11 +37,12 @@ class HttpError extends StatelessWidget {
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 5),
child: SelectableText(
errMsg ?? '没有数据',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleSmall,
scrollPhysics: const NeverScrollableScrollPhysics(),
),
),
if (onReload != null)

View File

@@ -97,7 +97,7 @@ class NetworkImgLayer extends StatelessWidget {
),
),
child: type == 'bg'
? const SizedBox()
? const SizedBox.shrink()
: Center(
child: Image.asset(
type == 'avatar'

View File

@@ -38,7 +38,7 @@ class _SelfSizedHorizontalListState extends State<SelfSizedHorizontalList> {
if (height == null) {
WidgetsBinding.instance.addPostFrameCallback((v) => setState(() {}));
}
if (widget.itemCount == 0) return const SizedBox();
if (widget.itemCount == 0) return const SizedBox.shrink();
if (isInit) {
return Container(
key: infoKey,