v1.0.1
This commit is contained in:
38
lib/widgets/status/app_empty_widget.dart
Normal file
38
lib/widgets/status/app_empty_widget.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dmzj/app/app_style.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
|
||||
class AppEmptyWidget extends StatelessWidget {
|
||||
final Function()? onRefresh;
|
||||
const AppEmptyWidget({this.onRefresh, Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
onRefresh?.call();
|
||||
},
|
||||
child: Padding(
|
||||
padding: AppStyle.edgeInsetsA12,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
LottieBuilder.asset(
|
||||
'assets/lotties/empty.json',
|
||||
width: 200,
|
||||
height: 200,
|
||||
repeat: false,
|
||||
),
|
||||
const Text(
|
||||
"这里什么都没有",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
63
lib/widgets/status/app_error_widget.dart
Normal file
63
lib/widgets/status/app_error_widget.dart
Normal file
@@ -0,0 +1,63 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dmzj/app/app_style.dart';
|
||||
import 'package:flutter_dmzj/app/utils.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:lottie/lottie.dart';
|
||||
|
||||
class AppErrorWidget extends StatelessWidget {
|
||||
final Function()? onRefresh;
|
||||
final String errorMsg;
|
||||
final Error? error;
|
||||
const AppErrorWidget(
|
||||
{this.errorMsg = "", this.onRefresh, this.error, Key? key})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
onRefresh?.call();
|
||||
},
|
||||
child: Padding(
|
||||
padding: AppStyle.edgeInsetsA12,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
LottieBuilder.asset(
|
||||
'assets/lotties/error.json',
|
||||
width: 260,
|
||||
repeat: false,
|
||||
),
|
||||
Text(
|
||||
"$errorMsg\r\n点击刷新",
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 12, color: Colors.grey),
|
||||
),
|
||||
Visibility(
|
||||
visible: error != null,
|
||||
child: Padding(
|
||||
padding: AppStyle.edgeInsetsT12,
|
||||
child: OutlinedButton(
|
||||
style: OutlinedButton.styleFrom(
|
||||
textStyle: Get.textTheme.bodySmall,
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
onPressed: () {
|
||||
Utils.copyText(
|
||||
"$errorMsg\n${error?.stackTrace?.toString()}");
|
||||
SmartDialog.showToast("已复制详细信息");
|
||||
},
|
||||
child: const Text("复制详细信息"),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
20
lib/widgets/status/app_loadding_widget.dart
Normal file
20
lib/widgets/status/app_loadding_widget.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dmzj/app/app_style.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
|
||||
class AppLoaddingWidget extends StatelessWidget {
|
||||
const AppLoaddingWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: AppStyle.edgeInsetsA12,
|
||||
child: LottieBuilder.asset(
|
||||
'assets/lotties/loadding.json',
|
||||
width: 200,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user