mobile_skt/lib/widgets/empty.dart

35 lines
990 B
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(
onTap: onTap,
child: Center(
child: Row(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(35)),
),
]),
),
);
}
}