import 'package:flutter/material.dart'; import 'package:huixiang/view_widget/round_button.dart'; class NoDataView extends StatelessWidget { final bool isShowBtn; final String text; final double fontSize; final EdgeInsets margin; NoDataView( {this.isShowBtn = true, this.text, this.fontSize, this.margin = const EdgeInsets.only(top: 30)}); @override Widget build(BuildContext context) { return Container( margin: margin, alignment: Alignment.center, child: Column( children: [ Image(image: AssetImage("assets/image/icon_empty.png")), SizedBox( height: 35, ), Text( text, style: TextStyle(fontSize: fontSize, color: Color(0xFF353535)), ), SizedBox( height: 10, ), if (isShowBtn) Container( margin: EdgeInsets.symmetric(horizontal: 16), child: RoundButton( text: "返回首页", textColor: Colors.white, fontSize: 14, padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), backgroup: Color(0xFF32A060), radius: 4, ), ) ], ), ); } }