novyronst/lib/pages/widgets/ny_empty_view.dart

81 lines
2.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:novyronst/common/const/const_color.dart';
import 'package:novyronst/common/help/help_image.dart';
import 'package:novyronst/tools/widgets/novy_com_widget.dart';
class NyEmptyView extends StatelessWidget {
const NyEmptyView({super.key,
this.title = 'No Data',
// 'Nothing here yet.\nCome back later for more fun!',
// Something went wrong.\nPlease try again.
this.subtitle = 'Nothing here yet.\nCome back later for more fun!',
this.btnText = 'RETRY',
this.imgName,
});
final String title;
final String subtitle;
final String btnText;
final String? imgName;
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 100),
HelpImage.asset(ConstImage.emptyImg, width: 136),
const SizedBox(height: 14),
// _customText(title),
// const SizedBox(height: 10),
NovyText( title,
fontSize: 16,
color: Colors.white.withAlpha(127),
textAlign: TextAlign.center,
),
// const SizedBox(height: 14),
],
),
);
}
_customText(String text) {
return Text(
text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
color: Colors.white, // 内部字体白色
fontStyle: FontStyle.italic,
fontFamily: 'Inter',
fontWeight: FontWeight.w600,
shadows: [
Shadow(
color: Colors.black, // 描边颜色
offset: Offset(1, 1), // 偏移量
blurRadius: 0, // 不模糊,形成硬边描边
),
Shadow(
color: Colors.black,
offset: Offset(-1, -1),
blurRadius: 0,
),
Shadow(
color: Colors.black,
offset: Offset(1, -1),
blurRadius: 0,
),
Shadow(
color: Colors.black,
offset: Offset(-1, 1),
blurRadius: 0,
),
],
),
);
}
}