diff --git a/lib/model/user/blacklist_model.dart b/lib/model/user/blacklist_model.dart index f1419f68..709d15bf 100644 --- a/lib/model/user/blacklist_model.dart +++ b/lib/model/user/blacklist_model.dart @@ -9,14 +9,16 @@ class BlacklistModel extends Equatable { final int id; final List imgList; final String? name; + final String nickName; factory BlacklistModel.fromJson(Map json) => _$BlacklistModelFromJson(json); - BlacklistModel({ + const BlacklistModel({ required this.id, required this.imgList, - required this.name, + this.name, + required this.nickName, }); @override @@ -24,5 +26,6 @@ class BlacklistModel extends Equatable { id, imgList, name, + nickName, ]; } diff --git a/lib/model/user/blacklist_model.g.dart b/lib/model/user/blacklist_model.g.dart index fe41c88e..c4fa615e 100644 --- a/lib/model/user/blacklist_model.g.dart +++ b/lib/model/user/blacklist_model.g.dart @@ -13,4 +13,5 @@ BlacklistModel _$BlacklistModelFromJson(Map json) => .map((e) => ImgModel.fromJson(e as Map)) .toList(), name: json['name'] as String?, + nickName: json['nickName'] as String, ); diff --git a/lib/pages/setting_page/blacklist_page/blacklist_page.dart b/lib/pages/setting_page/blacklist_page/blacklist_page.dart index 985ca960..d1cfea1e 100644 --- a/lib/pages/setting_page/blacklist_page/blacklist_page.dart +++ b/lib/pages/setting_page/blacklist_page/blacklist_page.dart @@ -102,6 +102,7 @@ class _blackListPageState extends State { TextStyle(fontSize: 24.sp, color: Color(0xA6000000))), ])), ), + 20.hb, Expanded( child: // ListView.builder( @@ -192,7 +193,7 @@ class _blackListPageState extends State { // ) , title: Text( - model.name == null ? '' : _getText(model.name!), + model.nickName ?? '', style: TextStyle(fontSize: 28.sp, color: ktextSubColor), ), trailing: GestureDetector( @@ -240,13 +241,13 @@ class _blackListPageState extends State { ); } - _getText(String name) { - String name2 = name.substring(0, 1); - for (var i = 0; i < name.length - 1; i++) { - name2 += '*'; - } - return name2; - } +// _getText(String name) { +// String name2 = name.substring(0, 1); +// for (var i = 0; i < name.length - 1; i++) { +// name2 += '*'; +// } +// return name2; +// } // _blackList(BlacklistModel model) { // return ListTile( // leading: Container( diff --git a/lib/ui/community/community_views/widgets/chat_card.dart b/lib/ui/community/community_views/widgets/chat_card.dart index c59f7127..e414b185 100644 --- a/lib/ui/community/community_views/widgets/chat_card.dart +++ b/lib/ui/community/community_views/widgets/chat_card.dart @@ -272,11 +272,10 @@ class _ChatCardState extends State { .make(), onPressed: () //=> Get.back(result: true), async { - var isShielding = - await BlackListFunc.Block(widget.model.id); - if (isShielding) { - Get.back(); - } + //var isShielding = + await BlackListFunc.Block( + widget.model.createId); + Get.back(); }, ), ],