2024-03-18 13:23:58 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2024-04-12 09:56:00 +08:00
|
|
|
import 'package:sk_base_mobile/app_theme.dart';
|
2024-03-18 13:23:58 +08:00
|
|
|
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
|
|
|
|
|
|
|
|
class Empty extends StatelessWidget {
|
2024-03-20 18:31:37 +08:00
|
|
|
final String? text;
|
2024-04-12 09:56:00 +08:00
|
|
|
final Widget? icon;
|
|
|
|
final void Function()? onTap;
|
|
|
|
const Empty({super.key, this.text, this.icon, this.onTap});
|
2024-03-18 13:23:58 +08:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-04-12 09:56:00 +08:00
|
|
|
return GestureDetector(
|
2024-04-15 10:59:12 +08:00
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: ScreenAdaper.height(10)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Center(
|
|
|
|
child: icon ??
|
|
|
|
Icon(Icons.error_outline,
|
|
|
|
size: ScreenAdaper.height(40),
|
|
|
|
color: AppTheme.dangerColor)),
|
|
|
|
SizedBox(
|
|
|
|
width: ScreenAdaper.width(10),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
text ?? '',
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(fontSize: ScreenAdaper.height(30)),
|
|
|
|
)
|
|
|
|
]),
|
|
|
|
));
|
2024-03-18 13:23:58 +08:00
|
|
|
}
|
|
|
|
}
|