mobile_skt/lib/widgets/empty.dart

38 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
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;
final Widget? icon;
final void Function()? onTap;
const Empty({super.key, this.text, this.icon, this.onTap});
@override
Widget build(BuildContext context) {
return GestureDetector(
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)),
)
]),
));
}
}