mobile_skt/lib/widgets/empty.dart

38 lines
1.2 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
2024-04-12 09:56:00 +08:00
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
class Empty extends StatelessWidget {
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});
@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)),
)
]),
));
}
}