42 lines
1.1 KiB
Dart
42 lines
1.1 KiB
Dart
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:forui/forui.dart';
|
|
|
|
Widget appEmpty(
|
|
BuildContext context, {
|
|
bool loading = false,
|
|
String loadingText = "正在识别中",
|
|
SvgAsset? emptyIcon,
|
|
String emptyText = "请让用户放置饭卡",
|
|
}) {
|
|
final theme = FTheme.of(context);
|
|
emptyIcon ??= FAssets.icons.idCard;
|
|
if (loading) {
|
|
return <Widget>[
|
|
CircularProgressIndicator(
|
|
color: theme.colorScheme.primary,
|
|
).width(100.w).height(100.w).center(),
|
|
SizedBox(height: 10.h),
|
|
Text(
|
|
loadingText,
|
|
style: theme.typography.base.copyWith(
|
|
color: theme.colorScheme.primary,
|
|
),
|
|
),
|
|
].toColumn(mainAxisAlignment: MainAxisAlignment.center);
|
|
}
|
|
return <Widget>[
|
|
FIcon(
|
|
emptyIcon,
|
|
size: theme.typography.xl4.fontSize,
|
|
),
|
|
SizedBox(height: 10.h),
|
|
Text(
|
|
emptyText,
|
|
style: theme.typography.base.copyWith(
|
|
color: theme.colorScheme.primary,
|
|
),
|
|
),
|
|
].toColumn(mainAxisAlignment: MainAxisAlignment.center);
|
|
}
|