opt: 搜索结果为空

This commit is contained in:
guozhigq
2024-06-16 19:09:05 +08:00
parent 568642ad2f
commit 3b75b0ce7d
5 changed files with 72 additions and 43 deletions

View File

@ -2,12 +2,18 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class HttpError extends StatelessWidget {
const HttpError(
{required this.errMsg, required this.fn, this.btnText, super.key});
const HttpError({
required this.errMsg,
required this.fn,
this.btnText,
this.isShowBtn = true,
super.key,
});
final String? errMsg;
final Function()? fn;
final String? btnText;
final bool isShowBtn;
@override
Widget build(BuildContext context) {
@ -29,20 +35,22 @@ class HttpError extends StatelessWidget {
style: Theme.of(context).textTheme.titleSmall,
),
const SizedBox(height: 20),
FilledButton.tonal(
onPressed: () {
fn!();
},
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith((states) {
return Theme.of(context).colorScheme.primary.withAlpha(20);
}),
if (isShowBtn)
FilledButton.tonal(
onPressed: () {
fn!();
},
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith((states) {
return Theme.of(context).colorScheme.primary.withAlpha(20);
}),
),
child: Text(
btnText ?? '点击重试',
style:
TextStyle(color: Theme.of(context).colorScheme.primary),
),
),
child: Text(
btnText ?? '点击重试',
style: TextStyle(color: Theme.of(context).colorScheme.primary),
),
),
],
),
),