Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add attribute emptyImage #344

Merged
merged 2 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions example/lib/sample/home/card_data_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,11 @@ class CardDataConfig {
appBarTitle: '城市单选',
hotCityTitle: '这里是推荐城市',
hotCityList: hotCityList,
emptyImage: Image.network(
"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F01d29258cce264a801219c77ec3f60.png%401280w_1l_2o_100sh.png&refer=http%3A%2F%2Fimg.zcool.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1667024486&t=891b720f3322872b1a8b87dc5dd9546e",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不建议这么写,或者可以 Icon(Icons.filter_none) ,最好用系统自带的。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea 替换成授权图了

width: 200,
height: 200,
fit: BoxFit.cover),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class BrnSingleSelectCityPage extends StatefulWidget {
/// 单选项 点击的回调
final ValueChanged<BrnSelectCityModel>? onValueChanged;

/// 空页面中间展位图展示
final Image? emptyImage;

BrnSingleSelectCityPage({
this.appBarTitle = '',
this.hotCityTitle = '',
Expand All @@ -46,6 +49,7 @@ class BrnSingleSelectCityPage extends StatefulWidget {
this.showSearchBar = true,
this.locationText = '',
this.onValueChanged,
this.emptyImage,
});

@override
Expand Down Expand Up @@ -359,7 +363,7 @@ class _BrnSingleSelectCityPageState extends State<BrnSingleSelectCityPage> {
Widget _noDataWidget() {
return Container(
child: BrnAbnormalStateWidget(
img: BrunoTools.getAssetImage(BrnAsset.emptyState),
img: widget.emptyImage ?? BrunoTools.getAssetImage(BrnAsset.emptyState),
title: BrnStrings.noSearchData,
),
);
Expand Down