diff --git a/distribute_options.yaml b/distribute_options.yaml new file mode 100644 index 00000000..ed828b77 --- /dev/null +++ b/distribute_options.yaml @@ -0,0 +1,24 @@ +env: +output: dist/ +releases: + - name: dev + jobs: + # Build and publish your apk pkg to pgyer + - name: release-dev-android + package: + platform: android + target: apk + build_args: + target-platform: android-arm,android-arm64 + dart-define: + APP_ENV: dev + publish_to: pgyer + # Build and publish your ipa pkg to pgyer + - name: release-dev-ios + package: + platform: ios + target: ipa + build_args: + export-options-plist: ios/dev_ExportOptions.plist + dart-define: + APP_ENV: dev \ No newline at end of file diff --git a/lib/base/base_style.dart b/lib/base/base_style.dart index 040b318d..bc586500 100644 --- a/lib/base/base_style.dart +++ b/lib/base/base_style.dart @@ -1,7 +1,8 @@ -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/utils/headers.dart'; + const ktextPrimary = Color(0xff333333); const ktextSubColor = Color(0xff666666); const ktextThirdColor = Color(0xff999999); diff --git a/lib/constants/app_theme.dart b/lib/constants/app_theme.dart index f098d8b9..f1ec0a96 100644 --- a/lib/constants/app_theme.dart +++ b/lib/constants/app_theme.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class AppTheme { diff --git a/lib/constants/application_objects.dart b/lib/constants/application_objects.dart index 74b1b3d0..65f2dc0f 100644 --- a/lib/constants/application_objects.dart +++ b/lib/constants/application_objects.dart @@ -1,5 +1,7 @@ // import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:flutter/material.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/pages/community_introduce/community_introduce_page.dart'; @@ -32,7 +34,6 @@ import 'package:aku_new_community/ui/profile/car/car_manage_page.dart'; import 'package:aku_new_community/ui/profile/car_parking/car_parking_page.dart'; import 'package:aku_new_community/ui/profile/house/house_owners_page.dart'; import 'package:aku_new_community/ui/service/task_page.dart'; -import 'package:flutter/material.dart'; ///应用对象 ///Application Object diff --git a/lib/constants/sars_api.dart b/lib/constants/sars_api.dart index cc7558e2..2a7bd4d3 100644 --- a/lib/constants/sars_api.dart +++ b/lib/constants/sars_api.dart @@ -1,3 +1,5 @@ +import 'package:aku_new_community/widget/others/user_tool.dart'; + part 'market_api.dart'; part 'profile_api.dart'; @@ -9,7 +11,8 @@ class SARSAPI { static const String baseURL = '$host'; ///静态资源路径 - static String get resource => '$host/static'; + static String get resource => + 'https://saas.kaidalai.cn/resource/${UserTool.userProvider.userInfoModel!.communityCode}/'; static String image(String? path) => '$resource$path'; @@ -23,6 +26,7 @@ class SARSAPI { static _House house = _House(); static _File uploadFile = _File(); static _Message message = _Message(); + static _Community community = _Community(); ///二级分类 static _ProfileApi profile = _ProfileApi(); @@ -99,6 +103,9 @@ class _Message { } class _Community { + ///话题详情 + String get topicDetail => '/app/user/community/topic/findById'; + ///动态信息详情 String get dynamicDetail => '/app/user/community/dynamic/details'; diff --git a/lib/extensions/num_ext.dart b/lib/extensions/num_ext.dart index aa6d5bad..e3157dc9 100644 --- a/lib/extensions/num_ext.dart +++ b/lib/extensions/num_ext.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; extension NumExt on num { diff --git a/lib/main.dart b/lib/main.dart index e4c18ec6..ed62b44c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,11 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/constants/app_theme.dart'; import 'package:aku_new_community/main_initialize.dart'; import 'package:aku_new_community/pages/splash/splash_page.dart'; @@ -7,12 +15,6 @@ import 'package:aku_new_community/provider/sign_up_provider.dart'; import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/utils/developer_util.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; void main() async { const buildType = const String.fromEnvironment('BUILD_TYPE'); diff --git a/lib/main_initialize.dart b/lib/main_initialize.dart index 56827f80..3db0f816 100644 --- a/lib/main_initialize.dart +++ b/lib/main_initialize.dart @@ -1,19 +1,21 @@ import 'dart:io'; -import 'package:aku_new_community/constants/app_theme.dart'; -import 'package:aku_new_community/constants/config.dart'; -import 'package:aku_new_community/provider/app_provider.dart'; -import 'package:aku_new_community/utils/message_parser.dart'; -import 'package:aku_new_community/utils/websocket/fire_dialog.dart'; -import 'package:aku_new_community/utils/websocket/web_socket_util.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; + import 'package:fluwx/fluwx.dart'; import 'package:get/get.dart'; import 'package:jpush_flutter/jpush_flutter.dart'; import 'package:power_logger/power_logger.dart'; import 'package:provider/provider.dart'; +import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/config.dart'; +import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/utils/message_parser.dart'; +import 'package:aku_new_community/utils/websocket/fire_dialog.dart'; +import 'package:aku_new_community/utils/websocket/web_socket_util.dart'; + class MainInitialize { ///初始化firebase // static Future initFirebase() async { diff --git a/lib/model/community/activity_detail_model.dart b/lib/model/community/activity_detail_model.dart index d522cc98..25f41e0d 100644 --- a/lib/model/community/activity_detail_model.dart +++ b/lib/model/community/activity_detail_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + class ActivityDetailModel { int? id; String? title; diff --git a/lib/model/community/activity_item_model.dart b/lib/model/community/activity_item_model.dart index 4163aca2..1def725b 100644 --- a/lib/model/community/activity_item_model.dart +++ b/lib/model/community/activity_item_model.dart @@ -1,7 +1,9 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; class ActivityItemModel { int? id; diff --git a/lib/model/community/board_model.dart b/lib/model/community/board_model.dart index 5f3ab635..4ac447b7 100644 --- a/lib/model/community/board_model.dart +++ b/lib/model/community/board_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + class BoardItemModel { int? id; String? title; diff --git a/lib/model/community/community_topic_model.dart b/lib/model/community/community_topic_model.dart index 622ae145..94c87f14 100644 --- a/lib/model/community/community_topic_model.dart +++ b/lib/model/community/community_topic_model.dart @@ -1,5 +1,6 @@ import 'package:aku_new_community/model/common/img_model.dart'; +@Deprecated('old model to deprecate') class CommunityTopicModel { int? id; String? title; diff --git a/lib/model/community/event_item_model.dart b/lib/model/community/event_item_model.dart index 623a4b87..757a3967 100644 --- a/lib/model/community/event_item_model.dart +++ b/lib/model/community/event_item_model.dart @@ -1,6 +1,8 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + +@Deprecated('old model to deprecate') class EventItemModel { int? id; int? createId; diff --git a/lib/model/community/my_event_item_model.dart b/lib/model/community/my_event_item_model.dart index b28a52d2..a7deb53c 100644 --- a/lib/model/community/my_event_item_model.dart +++ b/lib/model/community/my_event_item_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + class MyEventItemModel { int? id; String? content; diff --git a/lib/model/manager/advice_detail_model.dart b/lib/model/manager/advice_detail_model.dart index 62b828b7..1ea5e6c9 100644 --- a/lib/model/manager/advice_detail_model.dart +++ b/lib/model/manager/advice_detail_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + class AdviceDetailModel { AppAdviceDetailVo? appAdviceDetailVo; diff --git a/lib/model/manager/suggestion_or_complain_model.dart b/lib/model/manager/suggestion_or_complain_model.dart index b66ee463..c022b91c 100644 --- a/lib/model/manager/suggestion_or_complain_model.dart +++ b/lib/model/manager/suggestion_or_complain_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + class SuggestionOrComplainModel { int? id; int? type; diff --git a/lib/model/user/car_parking_model.dart b/lib/model/user/car_parking_model.dart index 21933df9..bd256669 100644 --- a/lib/model/user/car_parking_model.dart +++ b/lib/model/user/car_parking_model.dart @@ -1,5 +1,6 @@ -import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class CarParkingModel { diff --git a/lib/models/community/all_dynamic_list_model.dart b/lib/models/community/all_dynamic_list_model.dart new file mode 100644 index 00000000..06d9defa --- /dev/null +++ b/lib/models/community/all_dynamic_list_model.dart @@ -0,0 +1,63 @@ +import 'package:json_annotation/json_annotation.dart'; + +import 'package:aku_new_community/model/common/img_model.dart'; + +part 'all_dynamic_list_model.g.dart'; + +@JsonSerializable() +class AllDynamicListModel { + final int id; + final String? content; + final int isComment; + final int isPublic; + final int createId; + final String createName; + final String createDate; + final List? avatarImgList; + final int likes; + final int views; + final int commentNum; + final List? dynamicImgList; + final bool allowDelete; + final List topicTags; + final bool isLike; + + factory AllDynamicListModel.fromJson(Map json) => + _$AllDynamicListModelFromJson(json); + + List get dynamicList => dynamicImgList ?? []; + + const AllDynamicListModel({ + required this.id, + this.content, + required this.isComment, + required this.isPublic, + required this.createId, + required this.createName, + required this.createDate, + this.avatarImgList, + required this.likes, + required this.views, + required this.commentNum, + this.dynamicImgList, + required this.allowDelete, + required this.topicTags, + required this.isLike, + }); +} + +@JsonSerializable() +class TopicTag { + final int id; + final String title; + final int type; + + factory TopicTag.fromJson(Map json) => + _$TopicTagFromJson(json); + + const TopicTag({ + required this.id, + required this.title, + required this.type, + }); +} diff --git a/lib/models/community/all_dynamic_list_model.g.dart b/lib/models/community/all_dynamic_list_model.g.dart new file mode 100644 index 00000000..87be3d76 --- /dev/null +++ b/lib/models/community/all_dynamic_list_model.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'all_dynamic_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AllDynamicListModel _$AllDynamicListModelFromJson(Map json) => + AllDynamicListModel( + id: json['id'] as int, + content: json['content'] as String?, + isComment: json['isComment'] as int, + isPublic: json['isPublic'] as int, + createId: json['createId'] as int, + createName: json['createName'] as String, + createDate: json['createDate'] as String, + avatarImgList: (json['avatarImgList'] as List?) + ?.map((e) => ImgModel.fromJson(e as Map)) + .toList(), + likes: json['likes'] as int, + views: json['views'] as int, + commentNum: json['commentNum'] as int, + dynamicImgList: (json['dynamicImgList'] as List?) + ?.map((e) => ImgModel.fromJson(e as Map)) + .toList(), + allowDelete: json['allowDelete'] as bool, + topicTags: (json['topicTags'] as List) + .map((e) => TopicTag.fromJson(e as Map)) + .toList(), + isLike: json['isLike'] as bool, + ); + +TopicTag _$TopicTagFromJson(Map json) => TopicTag( + id: json['id'] as int, + title: json['title'] as String, + type: json['type'] as int, + ); diff --git a/lib/models/community/comment_list_model.dart b/lib/models/community/comment_list_model.dart new file mode 100644 index 00000000..78266c03 --- /dev/null +++ b/lib/models/community/comment_list_model.dart @@ -0,0 +1,65 @@ +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'comment_list_model.g.dart'; + +@JsonSerializable() +class CommentListModel { + final int id; + final String content; + final int createId; + final String createName; + final String createDate; + final List avatarImgList; + final int likes; + final int commentNum; + final bool allowDelete; + final bool isLike; + final List commentTwoList; + factory CommentListModel.fromJson(Map json) => + _$CommentListModelFromJson(json); + + const CommentListModel({ + required this.id, + required this.content, + required this.createId, + required this.createName, + required this.createDate, + required this.avatarImgList, + required this.likes, + required this.commentNum, + required this.allowDelete, + required this.isLike, + required this.commentTwoList, + }); +} + +@JsonSerializable() +class CommentTwoList { + final int id; + final String content; + final int createId; + final String createName; + final int parentId; + final String? parentName; + final String createDate; + final List avatarImgList; + final int likes; + final bool allowDelete; + final bool isLike; + factory CommentTwoList.fromJson(Map json) => + _$CommentTwoListFromJson(json); + const CommentTwoList({ + required this.id, + required this.content, + required this.createId, + required this.createName, + required this.parentId, + required this.parentName, + required this.createDate, + required this.avatarImgList, + required this.likes, + required this.allowDelete, + required this.isLike, + }); +} diff --git a/lib/models/community/comment_list_model.g.dart b/lib/models/community/comment_list_model.g.dart new file mode 100644 index 00000000..db45f831 --- /dev/null +++ b/lib/models/community/comment_list_model.g.dart @@ -0,0 +1,43 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'comment_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CommentListModel _$CommentListModelFromJson(Map json) => + CommentListModel( + id: json['id'] as int, + content: json['content'] as String, + createId: json['createId'] as int, + createName: json['createName'] as String, + createDate: json['createDate'] as String, + avatarImgList: (json['avatarImgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + likes: json['likes'] as int, + commentNum: json['commentNum'] as int, + allowDelete: json['allowDelete'] as bool, + isLike: json['isLike'] as bool, + commentTwoList: (json['commentTwoList'] as List) + .map((e) => CommentTwoList.fromJson(e as Map)) + .toList(), + ); + +CommentTwoList _$CommentTwoListFromJson(Map json) => + CommentTwoList( + id: json['id'] as int, + content: json['content'] as String, + createId: json['createId'] as int, + createName: json['createName'] as String, + parentId: json['parentId'] as int, + parentName: json['parentName'] as String, + createDate: json['createDate'] as String, + avatarImgList: (json['avatarImgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + likes: json['likes'] as int, + allowDelete: json['allowDelete'] as bool, + isLike: json['isLike'] as bool, + ); diff --git a/lib/models/community/dynamic_detail_model.dart b/lib/models/community/dynamic_detail_model.dart new file mode 100644 index 00000000..b1a7f87c --- /dev/null +++ b/lib/models/community/dynamic_detail_model.dart @@ -0,0 +1,45 @@ +import 'package:json_annotation/json_annotation.dart'; + +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:aku_new_community/models/community/all_dynamic_list_model.dart'; + +part 'dynamic_detail_model.g.dart'; + +@JsonSerializable() +class DynamicDetailModel { + final int id; + final String? content; + final int isComment; + final int isPublic; + final int createId; + final String createName; + final String createDate; + final List avatarImgList; + final int likes; + final int views; + final int commentNum; + final List dynamicImgList; + final bool allowDelete; + final List topicTags; + final bool isLike; + factory DynamicDetailModel.fromJson(Map json) => + _$DynamicDetailModelFromJson(json); + + const DynamicDetailModel({ + required this.id, + this.content, + required this.isComment, + required this.isPublic, + required this.createId, + required this.createName, + required this.createDate, + required this.avatarImgList, + required this.likes, + required this.views, + required this.commentNum, + required this.dynamicImgList, + required this.allowDelete, + required this.topicTags, + required this.isLike, + }); +} diff --git a/lib/models/community/dynamic_detail_model.g.dart b/lib/models/community/dynamic_detail_model.g.dart new file mode 100644 index 00000000..b0259ba9 --- /dev/null +++ b/lib/models/community/dynamic_detail_model.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'dynamic_detail_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DynamicDetailModel _$DynamicDetailModelFromJson(Map json) => + DynamicDetailModel( + id: json['id'] as int, + content: json['content'] as String?, + isComment: json['isComment'] as int, + isPublic: json['isPublic'] as int, + createId: json['createId'] as int, + createName: json['createName'] as String, + createDate: json['createDate'] as String, + avatarImgList: (json['avatarImgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + likes: json['likes'] as int, + views: json['views'] as int, + commentNum: json['commentNum'] as int, + dynamicImgList: (json['dynamicImgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + allowDelete: json['allowDelete'] as bool, + topicTags: (json['topicTags'] as List) + .map((e) => TopicTag.fromJson(e as Map)) + .toList(), + isLike: json['isLike'] as bool, + ); diff --git a/lib/models/community/top_detail_model.dart b/lib/models/community/top_detail_model.dart new file mode 100644 index 00000000..b755e508 --- /dev/null +++ b/lib/models/community/top_detail_model.dart @@ -0,0 +1,30 @@ +import 'package:json_annotation/json_annotation.dart'; + +import 'package:aku_new_community/model/common/img_model.dart'; + +part 'top_detail_model.g.dart'; + +@JsonSerializable() +class TopDetailModel { + final int id; + final String title; + final String content; + final int isPublic; + final int isRating; + final int dynamicNum; + final int commentNum; + final List imgList; + factory TopDetailModel.fromJson(Map json) => + _$TopDetailModelFromJson(json); + + const TopDetailModel({ + required this.id, + required this.title, + required this.content, + required this.isPublic, + required this.isRating, + required this.dynamicNum, + required this.commentNum, + required this.imgList, + }); +} diff --git a/lib/models/community/top_detail_model.g.dart b/lib/models/community/top_detail_model.g.dart new file mode 100644 index 00000000..896a4da6 --- /dev/null +++ b/lib/models/community/top_detail_model.g.dart @@ -0,0 +1,21 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'top_detail_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopDetailModel _$TopDetailModelFromJson(Map json) => + TopDetailModel( + id: json['id'] as int, + title: json['title'] as String, + content: json['content'] as String, + isPublic: json['isPublic'] as int, + isRating: json['isRating'] as int, + dynamicNum: json['dynamicNum'] as int, + commentNum: json['commentNum'] as int, + imgList: (json['imgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + ); diff --git a/lib/models/community/topic_list_model.dart b/lib/models/community/topic_list_model.dart new file mode 100644 index 00000000..c925ea11 --- /dev/null +++ b/lib/models/community/topic_list_model.dart @@ -0,0 +1,29 @@ +import 'package:json_annotation/json_annotation.dart'; + +import 'package:aku_new_community/model/common/img_model.dart'; + +part 'topic_list_model.g.dart'; + +@JsonSerializable() +class TopicListModel { + final int id; + final String title; + final String content; + final int isPublic; + final int isRating; + final int dynamicNum; + final int commentNum; + final List imgList; + factory TopicListModel.fromJson(Map json) => + _$TopicListModelFromJson(json); + const TopicListModel({ + required this.id, + required this.title, + required this.content, + required this.isPublic, + required this.isRating, + required this.dynamicNum, + required this.commentNum, + required this.imgList, + }); +} diff --git a/lib/models/community/topic_list_model.g.dart b/lib/models/community/topic_list_model.g.dart new file mode 100644 index 00000000..c7e3c021 --- /dev/null +++ b/lib/models/community/topic_list_model.g.dart @@ -0,0 +1,21 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'topic_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopicListModel _$TopicListModelFromJson(Map json) => + TopicListModel( + id: json['id'] as int, + title: json['title'] as String, + content: json['content'] as String, + isPublic: json['isPublic'] as int, + isRating: json['isRating'] as int, + dynamicNum: json['dynamicNum'] as int, + commentNum: json['commentNum'] as int, + imgList: (json['imgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + ); diff --git a/lib/models/community/topic_model.dart b/lib/models/community/topic_model.dart new file mode 100644 index 00000000..c0492545 --- /dev/null +++ b/lib/models/community/topic_model.dart @@ -0,0 +1,32 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'topic_model.g.dart'; + +@JsonSerializable() +class TopicModel { + final int id; + final String title; + final int type; + + factory TopicModel.fromJson(Map json) => + _$TopicModelFromJson(json); + + String get typeToString { + switch (type) { + case 1: + return '普通'; + case 2: + return '推荐'; + case 3: + return '热门'; + default: + return ''; + } + } + + const TopicModel({ + required this.id, + required this.title, + required this.type, + }); +} diff --git a/lib/models/community/topic_model.g.dart b/lib/models/community/topic_model.g.dart new file mode 100644 index 00000000..40ed073a --- /dev/null +++ b/lib/models/community/topic_model.g.dart @@ -0,0 +1,13 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'topic_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopicModel _$TopicModelFromJson(Map json) => TopicModel( + id: json['id'] as int, + title: json['title'] as String, + type: json['type'] as int, + ); diff --git a/lib/models/community_introduce/community_introduce_model.dart b/lib/models/community_introduce/community_introduce_model.dart index b22a0b16..d7cbc9bd 100644 --- a/lib/models/community_introduce/community_introduce_model.dart +++ b/lib/models/community_introduce/community_introduce_model.dart @@ -1,7 +1,8 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'community_introduce_model.g.dart'; @JsonSerializable() diff --git a/lib/models/electronic_commerc/electronic_commerc_list_model.dart b/lib/models/electronic_commerc/electronic_commerc_list_model.dart index 4f3da491..791bc35b 100644 --- a/lib/models/electronic_commerc/electronic_commerc_list_model.dart +++ b/lib/models/electronic_commerc/electronic_commerc_list_model.dart @@ -1,7 +1,8 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'electronic_commerc_list_model.g.dart'; @JsonSerializable() diff --git a/lib/models/facility/facility_appointment_model.dart b/lib/models/facility/facility_appointment_model.dart index af03ed2a..07df27fe 100644 --- a/lib/models/facility/facility_appointment_model.dart +++ b/lib/models/facility/facility_appointment_model.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/base/base_style.dart'; + part 'facility_appointment_model.g.dart'; @JsonSerializable() diff --git a/lib/models/facility/facility_type_model.dart b/lib/models/facility/facility_type_model.dart index 5172e7f0..defe6c87 100644 --- a/lib/models/facility/facility_type_model.dart +++ b/lib/models/facility/facility_type_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'facility_type_model.g.dart'; @JsonSerializable() diff --git a/lib/models/geographic_information/geographic_information_model.dart b/lib/models/geographic_information/geographic_information_model.dart index 9119f9fb..bd247e74 100644 --- a/lib/models/geographic_information/geographic_information_model.dart +++ b/lib/models/geographic_information/geographic_information_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + class GeographicInformationModel { int? id; String? name; diff --git a/lib/models/house/lease_detail_model.dart b/lib/models/house/lease_detail_model.dart index 0639115c..cb3b7998 100644 --- a/lib/models/house/lease_detail_model.dart +++ b/lib/models/house/lease_detail_model.dart @@ -1,7 +1,8 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'lease_detail_model.g.dart'; @JsonSerializable() diff --git a/lib/models/house_introduce/house_introduce_model.dart b/lib/models/house_introduce/house_introduce_model.dart index d66e7e50..3afab9e7 100644 --- a/lib/models/house_introduce/house_introduce_model.dart +++ b/lib/models/house_introduce/house_introduce_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + class HouseIntroduceModel { int? id; String? name; diff --git a/lib/models/house_keeping/house_keeping_list_model.dart b/lib/models/house_keeping/house_keeping_list_model.dart index fb52d64b..e8ff5914 100644 --- a/lib/models/house_keeping/house_keeping_list_model.dart +++ b/lib/models/house_keeping/house_keeping_list_model.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; + +import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'house_keeping_list_model.g.dart'; @JsonSerializable() diff --git a/lib/models/integral/integral_info_model.dart b/lib/models/integral/integral_info_model.dart index 5077276e..2b6a99f5 100644 --- a/lib/models/integral/integral_info_model.dart +++ b/lib/models/integral/integral_info_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/models/integral/clocked_record_list_model.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/models/integral/clocked_record_list_model.dart'; + part 'integral_info_model.g.dart'; @JsonSerializable() diff --git a/lib/models/login/history_login_model.dart b/lib/models/login/history_login_model.dart index aa522e70..e60f2877 100644 --- a/lib/models/login/history_login_model.dart +++ b/lib/models/login/history_login_model.dart @@ -1,8 +1,9 @@ -import 'package:aku_new_community/models/login/community_model.dart'; -import 'package:aku_new_community/models/login/picked_city_model.dart'; import 'package:hive/hive.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/models/login/community_model.dart'; +import 'package:aku_new_community/models/login/picked_city_model.dart'; + part 'history_login_model.g.dart'; @JsonSerializable() diff --git a/lib/models/login/picked_city_model.dart b/lib/models/login/picked_city_model.dart index 02022fe8..d8cfa276 100644 --- a/lib/models/login/picked_city_model.dart +++ b/lib/models/login/picked_city_model.dart @@ -1,6 +1,6 @@ -import 'package:aku_new_community/utils/hive_store.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/utils/hive_store.dart'; import 'china_region_model.dart'; part 'picked_city_model.g.dart'; diff --git a/lib/models/manage/fix_report/fix_detail_model.dart b/lib/models/manage/fix_report/fix_detail_model.dart index a006d909..ca8d64ac 100644 --- a/lib/models/manage/fix_report/fix_detail_model.dart +++ b/lib/models/manage/fix_report/fix_detail_model.dart @@ -1,7 +1,8 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'fix_detail_model.g.dart'; @JsonSerializable() diff --git a/lib/models/market/good_detail_model.dart b/lib/models/market/good_detail_model.dart index b0534efd..87efa3d9 100644 --- a/lib/models/market/good_detail_model.dart +++ b/lib/models/market/good_detail_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/ui/market/shop_car/shop_car_func.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/ui/market/shop_car/shop_car_func.dart'; + part 'good_detail_model.g.dart'; @JsonSerializable() diff --git a/lib/models/market/order/my_order_list_model.dart b/lib/models/market/order/my_order_list_model.dart index 63cb4f21..1c852758 100644 --- a/lib/models/market/order/my_order_list_model.dart +++ b/lib/models/market/order/my_order_list_model.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:flutter/material.dart'; + import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'my_order_list_model.g.dart'; @JsonSerializable() diff --git a/lib/models/market/order/order_detail_model.dart b/lib/models/market/order/order_detail_model.dart index 47c0cdbb..ae88bfd5 100644 --- a/lib/models/market/order/order_detail_model.dart +++ b/lib/models/market/order/order_detail_model.dart @@ -1,7 +1,8 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'order_detail_model.g.dart'; @JsonSerializable() diff --git a/lib/models/market/shop_car/shop_car_list_model.dart b/lib/models/market/shop_car/shop_car_list_model.dart index c0da9cc8..e14c86c1 100644 --- a/lib/models/market/shop_car/shop_car_list_model.dart +++ b/lib/models/market/shop_car/shop_car_list_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/ui/market/shop_car/shop_car_func.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/ui/market/shop_car/shop_car_func.dart'; + part 'shop_car_list_model.g.dart'; @JsonSerializable() diff --git a/lib/models/message/reply_list_model.dart b/lib/models/message/reply_list_model.dart index 48727ebc..c46fd140 100644 --- a/lib/models/message/reply_list_model.dart +++ b/lib/models/message/reply_list_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'reply_list_model.g.dart'; @JsonSerializable() diff --git a/lib/models/new_renovation/new_renovation_list_model.dart b/lib/models/new_renovation/new_renovation_list_model.dart index 96346d13..b722bdb7 100644 --- a/lib/models/new_renovation/new_renovation_list_model.dart +++ b/lib/models/new_renovation/new_renovation_list_model.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/base/base_style.dart'; +import 'package:flutter/material.dart'; + import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/base/base_style.dart'; + part 'new_renovation_list_model.g.dart'; @JsonSerializable() diff --git a/lib/models/news/news_item_model.dart b/lib/models/news/news_item_model.dart index fed9ce67..f50aea45 100644 --- a/lib/models/news/news_item_model.dart +++ b/lib/models/news/news_item_model.dart @@ -1,7 +1,8 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'news_item_model.g.dart'; @JsonSerializable() diff --git a/lib/models/search/search_model.dart b/lib/models/search/search_model.dart index 19db6cd9..2fc38edf 100644 --- a/lib/models/search/search_model.dart +++ b/lib/models/search/search_model.dart @@ -1,8 +1,9 @@ -import 'package:aku_new_community/model/community/activity_item_model.dart'; -import 'package:aku_new_community/model/community/community_topic_model.dart'; import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/community/activity_item_model.dart'; +import 'package:aku_new_community/model/community/community_topic_model.dart'; + part 'search_model.g.dart'; @JsonSerializable() diff --git a/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart b/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart index 0e3de459..8156420d 100644 --- a/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart +++ b/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + class SurroundingEnterprisesModel { int? id; String? name; diff --git a/lib/models/user/passed_house_list_model.dart b/lib/models/user/passed_house_list_model.dart index 66f45139..f690b5a2 100644 --- a/lib/models/user/passed_house_list_model.dart +++ b/lib/models/user/passed_house_list_model.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'passed_house_list_model.g.dart'; diff --git a/lib/models/user/user_info_model.dart b/lib/models/user/user_info_model.dart index 0ee743bd..944a1c68 100644 --- a/lib/models/user/user_info_model.dart +++ b/lib/models/user/user_info_model.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/model/common/img_model.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; + part 'user_info_model.g.dart'; @JsonSerializable() diff --git a/lib/pages/community_introduce/community_introduce_page.dart b/lib/pages/community_introduce/community_introduce_page.dart index 76200488..b18cb927 100644 --- a/lib/pages/community_introduce/community_introduce_page.dart +++ b/lib/pages/community_introduce/community_introduce_page.dart @@ -1,6 +1,7 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/community_introduce/community_introduce_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; @@ -47,7 +48,7 @@ class _CommunityIntroducePageState extends State { child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, fit: BoxFit.cover, - image: API.image(ImgModel.first(_model.imgList))), + image: SARSAPI.image(ImgModel.first(_model.imgList))), width: double.infinity, height: 424.w, ), diff --git a/lib/pages/convenient_phone/convenient_phone_page.dart b/lib/pages/convenient_phone/convenient_phone_page.dart index 6ec89518..0e954537 100644 --- a/lib/pages/convenient_phone/convenient_phone_page.dart +++ b/lib/pages/convenient_phone/convenient_phone_page.dart @@ -124,7 +124,7 @@ class _ConvenientPhonePageState extends State { controller: _easyRefreshController, path: API.manager.convenientPhone, convert: (model) { - return model.tableList! + return model.rows .map((e) => ConvenientPhoneModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/electronic_commerc/electronic_commerc_card.dart b/lib/pages/electronic_commerc/electronic_commerc_card.dart index ccacd1fe..3aa3987a 100644 --- a/lib/pages/electronic_commerc/electronic_commerc_card.dart +++ b/lib/pages/electronic_commerc/electronic_commerc_card.dart @@ -1,6 +1,6 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/electronic_commerc/electronic_commerc_list_model.dart'; import 'package:aku_new_community/pages/electronic_commerc/electronic_commerc_detail_page.dart'; @@ -70,7 +70,7 @@ class _ElectronicCommercCardState extends State { width: 240.w, height: 200.w, fit: BoxFit.cover, - image: API.image(ImgModel.first(model.imgList)), + image: SARSAPI.image(ImgModel.first(model.imgList)), ), ], ), diff --git a/lib/pages/electronic_commerc/electronic_commerc_detail_page.dart b/lib/pages/electronic_commerc/electronic_commerc_detail_page.dart index 460b2fe2..51e6809f 100644 --- a/lib/pages/electronic_commerc/electronic_commerc_detail_page.dart +++ b/lib/pages/electronic_commerc/electronic_commerc_detail_page.dart @@ -70,7 +70,7 @@ class _ElectronicCommercDetailPageState // width: double.infinity, // child: FadeInImage.assetNetwork( // placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - // image: API.image(ImgModel.first(_detailModel.imgList))), + // image: SARSAPI.image(ImgModel.first(_detailModel.imgList))), // ), // 24.w.heightBox, _detailModel.title.text diff --git a/lib/pages/electronic_commerc/electronic_commerc_view.dart b/lib/pages/electronic_commerc/electronic_commerc_view.dart index 64c7a1d9..0b81db3f 100644 --- a/lib/pages/electronic_commerc/electronic_commerc_view.dart +++ b/lib/pages/electronic_commerc/electronic_commerc_view.dart @@ -44,7 +44,7 @@ class _ElectronicCommercViewState extends State { controller: _refreshController, extraParams: {"electronicCommerceCategoryId": widget.id}, convert: (models) { - return models.tableList! + return models.rows .map((e) => ElectronicCommercListModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/event_activity/event_voting_page.dart b/lib/pages/event_activity/event_voting_page.dart index 4bdb52e3..e4b80837 100644 --- a/lib/pages/event_activity/event_voting_page.dart +++ b/lib/pages/event_activity/event_voting_page.dart @@ -1,5 +1,6 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/manager/event_voting_model.dart'; import 'package:aku_new_community/pages/event_activity/voting_detail_page.dart'; @@ -60,7 +61,7 @@ class _EventVotingPageState extends State { child: ClipRect( child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: SARSAPI.image(ImgModel.first(model.imgUrls)), fit: BoxFit.cover, ), ), @@ -137,9 +138,7 @@ class _EventVotingPageState extends State { path: API.manager.enventVotingList, controller: _controller, convert: (model) { - return model.tableList! - .map((e) => EventVotingModel.fromJson(e)) - .toList(); + return model.rows.map((e) => EventVotingModel.fromJson(e)).toList(); }, builder: (items) { return ListView.separated( diff --git a/lib/pages/event_activity/voting_detail_page.dart b/lib/pages/event_activity/voting_detail_page.dart index d08e1e99..7adf227f 100644 --- a/lib/pages/event_activity/voting_detail_page.dart +++ b/lib/pages/event_activity/voting_detail_page.dart @@ -1,6 +1,6 @@ import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/manager/voting_detail_model.dart'; import 'package:aku_new_community/pages/manager_func.dart'; @@ -133,7 +133,7 @@ class _VotingDetailPageState extends State { borderRadius: BorderRadius.circular(4.w), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image( + image: SARSAPI.image( ImgModel.first(model.imgUrls), ), fit: BoxFit.cover, @@ -232,7 +232,7 @@ class _VotingDetailPageState extends State { borderRadius: BorderRadius.circular(8.w), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(_model.imgUrls)), + image: SARSAPI.image(ImgModel.first(_model.imgUrls)), ), ), 44.w.heightBox, diff --git a/lib/pages/express_packages/express_package_page.dart b/lib/pages/express_packages/express_package_page.dart index de8ca1b4..44f6431d 100644 --- a/lib/pages/express_packages/express_package_page.dart +++ b/lib/pages/express_packages/express_package_page.dart @@ -1,9 +1,10 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/pages/express_packages/express_package_view.dart'; import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/utils/websocket/tips_dialog.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; -import 'package:flutter/material.dart'; class ExpressPackagePage extends StatefulWidget { ExpressPackagePage({Key? key}) : super(key: key); diff --git a/lib/pages/express_packages/express_package_view.dart b/lib/pages/express_packages/express_package_view.dart index af3eda8e..8facdff5 100644 --- a/lib/pages/express_packages/express_package_view.dart +++ b/lib/pages/express_packages/express_package_view.dart @@ -40,10 +40,9 @@ class _ExpressPackageViewState extends State { "packageCollectionStatus": widget.index + 1, }, convert: (models) { - return models.tableList - ?.map((e) => ExpressPackageListModel.fromJson(e)) - .toList() ?? - []; + return models.rows + .map((e) => ExpressPackageListModel.fromJson(e)) + .toList(); }, builder: (items) { return ListView.separated( diff --git a/lib/pages/geographic_information/geograhic_information.dart b/lib/pages/geographic_information/geograhic_information.dart index d5198bf3..14920f81 100644 --- a/lib/pages/geographic_information/geograhic_information.dart +++ b/lib/pages/geographic_information/geograhic_information.dart @@ -1,6 +1,7 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/geographic_information/geographic_information_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; @@ -50,7 +51,7 @@ class _GeographicInformationPageState extends State { child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, fit: BoxFit.cover, - image: API.image(ImgModel.first(_model.imgUrls))), + image: SARSAPI.image(ImgModel.first(_model.imgUrls))), width: double.infinity, height: 424.w, ), diff --git a/lib/pages/geographic_information/geographic_information_page.dart b/lib/pages/geographic_information/geographic_information_page.dart index b4ddfefb..7f13d0f7 100644 --- a/lib/pages/geographic_information/geographic_information_page.dart +++ b/lib/pages/geographic_information/geographic_information_page.dart @@ -1,6 +1,7 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/geographic_information/geographic_information_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; @@ -50,7 +51,7 @@ class _GeographicInformationPageState extends State { child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, fit: BoxFit.cover, - image: API.image(ImgModel.first(_model.imgUrls))), + image: SARSAPI.image(ImgModel.first(_model.imgUrls))), width: double.infinity, height: 424.w, ), diff --git a/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart b/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart index f7672625..3c76e827 100644 --- a/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart +++ b/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart @@ -1,14 +1,16 @@ -import 'package:aku_new_community/model/manager/article_QR_code_model.dart'; -import 'package:aku_new_community/provider/app_provider.dart'; -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/dotted_line.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_icons/flutter_icons.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:qr_flutter/qr_flutter.dart'; +import 'package:aku_new_community/model/manager/article_QR_code_model.dart'; +import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/dotted_line.dart'; + class DetoCodePage extends StatelessWidget { final int? id; final ArticleQRModel? model; diff --git a/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart b/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart index e02f148c..bb7718ad 100644 --- a/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart +++ b/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; class CommonRadio extends StatefulWidget { final T? value; diff --git a/lib/pages/goods_deto_page/goods_deto_page.dart b/lib/pages/goods_deto_page/goods_deto_page.dart index 7f07a475..5be77d6b 100644 --- a/lib/pages/goods_deto_page/goods_deto_page.dart +++ b/lib/pages/goods_deto_page/goods_deto_page.dart @@ -77,9 +77,7 @@ class _GoodsDetoPageState extends State { controller: _refreshController, path: API.manager.articleOut, convert: (model) { - return model.tableList! - .map((e) => GoodsOutModel.fromJson(e)) - .toList(); + return model.rows.map((e) => GoodsOutModel.fromJson(e)).toList(); }, builder: (items) { return ListView.builder( diff --git a/lib/pages/goods_deto_page/select_move_company_page.dart b/lib/pages/goods_deto_page/select_move_company_page.dart index f13fa99e..010a6502 100644 --- a/lib/pages/goods_deto_page/select_move_company_page.dart +++ b/lib/pages/goods_deto_page/select_move_company_page.dart @@ -1,3 +1,10 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/manager/moving_company_model.dart'; import 'package:aku_new_community/pages/goods_deto_page/deto_create_page/widget/common_radio.dart'; @@ -6,11 +13,6 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; class SelectMoveCompanyPage extends StatefulWidget { SelectMoveCompanyPage({Key? key}) : super(key: key); diff --git a/lib/pages/goods_deto_page/widget/goods_info_card.dart b/lib/pages/goods_deto_page/widget/goods_info_card.dart index bf8b36fd..143f20c1 100644 --- a/lib/pages/goods_deto_page/widget/goods_info_card.dart +++ b/lib/pages/goods_deto_page/widget/goods_info_card.dart @@ -1,10 +1,10 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/manager/goods_out_model.dart'; import 'package:aku_new_community/utils/bee_map.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/views/horizontal_image_view.dart'; -import 'package:flutter/material.dart'; - import 'goods_info_card_button.dart'; class GoodsInfoCard extends StatelessWidget { diff --git a/lib/pages/goods_deto_page/widget/goods_info_card_button.dart b/lib/pages/goods_deto_page/widget/goods_info_card_button.dart index 28ecd3c8..cb5f164b 100644 --- a/lib/pages/goods_deto_page/widget/goods_info_card_button.dart +++ b/lib/pages/goods_deto_page/widget/goods_info_card_button.dart @@ -1,14 +1,16 @@ -import 'package:aku_new_community/model/manager/article_QR_code_model.dart'; -import 'package:aku_new_community/pages/goods_deto_page/deto_code_page/deto_code_page.dart'; -import 'package:aku_new_community/pages/manager_func.dart'; -import 'package:aku_new_community/utils/headers.dart'; -import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:get/get.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:aku_new_community/model/manager/article_QR_code_model.dart'; +import 'package:aku_new_community/pages/goods_deto_page/deto_code_page/deto_code_page.dart'; +import 'package:aku_new_community/pages/manager_func.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class GoodsInfoCardButton extends StatelessWidget { final String? tel; final int? id; diff --git a/lib/pages/goods_manage_page/borrow/borrow_examine_page.dart b/lib/pages/goods_manage_page/borrow/borrow_examine_page.dart index 494eb4be..613339e2 100644 --- a/lib/pages/goods_manage_page/borrow/borrow_examine_page.dart +++ b/lib/pages/goods_manage_page/borrow/borrow_examine_page.dart @@ -1,11 +1,13 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class BorrowExaminePage extends StatefulWidget { BorrowExaminePage({Key? key}) : super(key: key); diff --git a/lib/pages/goods_manage_page/borrow/borrow_finsh_page.dart b/lib/pages/goods_manage_page/borrow/borrow_finsh_page.dart index faf36694..7e1ec091 100644 --- a/lib/pages/goods_manage_page/borrow/borrow_finsh_page.dart +++ b/lib/pages/goods_manage_page/borrow/borrow_finsh_page.dart @@ -1,12 +1,14 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/pages/tab_navigator.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/pages/tab_navigator.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class BorrowFinshPage extends StatefulWidget { final bool? isSuccess; final String? failText; diff --git a/lib/pages/goods_manage_page/borrow/borrow_goods_detail_page.dart b/lib/pages/goods_manage_page/borrow/borrow_goods_detail_page.dart index f1d30c75..91e3efe1 100644 --- a/lib/pages/goods_manage_page/borrow/borrow_goods_detail_page.dart +++ b/lib/pages/goods_manage_page/borrow/borrow_goods_detail_page.dart @@ -1,6 +1,7 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/manager/article_borrow_detail_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; @@ -196,7 +197,7 @@ class _BorrowGoodsDetailPageState extends State { child: ClipRRect( child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgList)), + image: SARSAPI.image(ImgModel.first(model.imgList)), imageErrorBuilder: (context, error, stackTrace) { return Image.asset( R.ASSETS_IMAGES_PLACEHOLDER_WEBP, diff --git a/lib/pages/goods_manage_page/borrow/borrow_goods_page.dart b/lib/pages/goods_manage_page/borrow/borrow_goods_page.dart index 7aaf740b..91ed8116 100644 --- a/lib/pages/goods_manage_page/borrow/borrow_goods_page.dart +++ b/lib/pages/goods_manage_page/borrow/borrow_goods_page.dart @@ -1,6 +1,16 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/manager/article_borrow_model.dart'; import 'package:aku_new_community/pages/goods_manage_page/borrow/borrow_goods_detail_page.dart'; @@ -8,14 +18,6 @@ import 'package:aku_new_community/utils/network/base_list_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; -import 'package:velocity_x/velocity_x.dart'; - import 'borrow_examine_page.dart'; class BorrowGoodsSubmitModel { @@ -85,10 +87,9 @@ class _BorrowGoodsPageState extends State { BaseListModel _listModel = await NetUtil().getList( API.manager.articleBorrow, params: {'pageNum': _page, 'size': _size}); - _borrowModels = _listModel.tableList - ?.map((e) => ArticleBorrowModel.fromJson(e)) - .toList() ?? - []; + _borrowModels = _listModel.rows + .map((e) => ArticleBorrowModel.fromJson(e)) + .toList(); _receiveIds = _borrowModels.map((e) => BorrowGoodsSubmitModel.init()).toList(); setState(() {}); @@ -98,14 +99,12 @@ class _BorrowGoodsPageState extends State { BaseListModel _listModel = await NetUtil().getList( API.manager.articleBorrow, params: {'pageNum': _page, 'size': _size}); - _borrowModels.addAll(_listModel.tableList - ?.map((e) => ArticleBorrowModel.fromJson(e)) - .toList() ?? - []); - _receiveIds.addAll(_listModel.tableList - ?.map((e) => BorrowGoodsSubmitModel.init()) - .toList() ?? - []); + _borrowModels.addAll(_listModel.rows + .map((e) => ArticleBorrowModel.fromJson(e)) + .toList()); + _receiveIds.addAll(_listModel.rows + .map((e) => BorrowGoodsSubmitModel.init()) + .toList()); setState(() {}); }, child: _borrowModels.isEmpty @@ -173,7 +172,7 @@ class _BorrowGoodsPageState extends State { child: ClipRRect( child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: SARSAPI.image(ImgModel.first(model.imgUrls)), imageErrorBuilder: (context, error, stackTrace) { return Image.asset( R.ASSETS_IMAGES_PLACEHOLDER_WEBP, diff --git a/lib/pages/goods_manage_page/goods_manage_page.dart b/lib/pages/goods_manage_page/goods_manage_page.dart index fb4f90e5..0b1c63b7 100644 --- a/lib/pages/goods_manage_page/goods_manage_page.dart +++ b/lib/pages/goods_manage_page/goods_manage_page.dart @@ -1,4 +1,5 @@ import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/manager/article_borrow_model.dart'; import 'package:aku_new_community/pages/goods_manage_page/borrow/borrow_goods_page.dart'; @@ -52,7 +53,7 @@ class _GoodsManagePageState extends State { child: ClipRRect( child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: SARSAPI.image(ImgModel.first(model.imgUrls)), imageErrorBuilder: (context, error, stackTrace) { return Image.asset( R.ASSETS_IMAGES_PLACEHOLDER_WEBP, @@ -106,7 +107,7 @@ class _GoodsManagePageState extends State { path: API.manager.articleBorrow, controller: _easyRefreshController, convert: (models) { - return models.tableList! + return models.rows .map((e) => ArticleBorrowModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart index 00ab0cf3..d912cad0 100644 --- a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart +++ b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart @@ -261,9 +261,7 @@ class _MineGoodsPageState extends State { path: API.manager.articleBorrowMylist, controller: _controller, convert: (model) { - return model.tableList! - .map((e) => MineGoodsModel.fromJson(e)) - .toList(); + return model.rows.map((e) => MineGoodsModel.fromJson(e)).toList(); }, builder: (items) { return ListView.builder( diff --git a/lib/pages/goods_manage_page/retrun/return_goods_detail_page.dart b/lib/pages/goods_manage_page/retrun/return_goods_detail_page.dart index cf6e3366..21b4c2e6 100644 --- a/lib/pages/goods_manage_page/retrun/return_goods_detail_page.dart +++ b/lib/pages/goods_manage_page/retrun/return_goods_detail_page.dart @@ -1,6 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/manager/article_return_list_model.dart'; import 'package:aku_new_community/pages/goods_manage_page/borrow/borrow_examine_page.dart'; @@ -8,12 +17,6 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/radio_button.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class ReturnGoodsDetailPage extends StatefulWidget { ReturnGoodsDetailPage({Key? key}) : super(key: key); @@ -202,7 +205,7 @@ class _ReturnGoodsDetailPageState extends State { child: ClipRRect( child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgList)), + image: SARSAPI.image(ImgModel.first(model.imgList)), imageErrorBuilder: (context, error, stackTrace) { return Image.asset( R.ASSETS_IMAGES_PLACEHOLDER_WEBP, diff --git a/lib/pages/goods_manage_page/select_borrow_return_page.dart b/lib/pages/goods_manage_page/select_borrow_return_page.dart index faf89f1b..179494df 100644 --- a/lib/pages/goods_manage_page/select_borrow_return_page.dart +++ b/lib/pages/goods_manage_page/select_borrow_return_page.dart @@ -1,13 +1,15 @@ -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/extensions/widget_list_ext.dart'; -import 'package:aku_new_community/pages/goods_manage_page/goods_manage_page.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; +import 'package:aku_new_community/pages/goods_manage_page/goods_manage_page.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class SelectBorrowReturnPage extends StatefulWidget { SelectBorrowReturnPage({Key? key}) : super(key: key); diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 34ac4752..966ad00e 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -1,7 +1,21 @@ // Dart imports: -import 'package:aku_new_community/constants/api.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import 'package:badges/badges.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:card_swiper/card_swiper.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:jpush_flutter/jpush_flutter.dart'; +import 'package:palette_generator/palette_generator.dart'; +import 'package:power_logger/power_logger.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/constants/application_objects.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/extensions/color_ext.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/community/activity_item_model.dart'; @@ -24,18 +38,6 @@ import 'package:aku_new_community/utils/login_util.dart'; import 'package:aku_new_community/widget/animated/OverlayWidget.dart'; import 'package:aku_new_community/widget/others/rectIndicator.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:badges/badges.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:card_swiper/card_swiper.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:jpush_flutter/jpush_flutter.dart'; -import 'package:palette_generator/palette_generator.dart'; -import 'package:power_logger/power_logger.dart'; -import 'package:provider/provider.dart'; class HomePage extends StatefulWidget { HomePage({Key? key}) : super(key: key); @@ -524,7 +526,7 @@ class _HomePageState extends State if (_swiperModels.isNotEmpty) { var color = await PaletteGenerator.fromImageProvider(CachedNetworkImageProvider( - API.image(ImgModel.first(_swiperModels[index].voResourcesImgList)), + SARSAPI.image(ImgModel.first(_swiperModels[index].voResourcesImgList)), )); _barColor.value = color.dominantColor?.color ?? Colors.transparent; } else { @@ -536,7 +538,7 @@ class _HomePageState extends State return Container( child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(swiperModel.voResourcesImgList)), + image: SARSAPI.image(ImgModel.first(swiperModel.voResourcesImgList)), fit: BoxFit.fill, imageErrorBuilder: (context, error, stackTrace) { return Image.asset( diff --git a/lib/pages/home/widget/animate_app_bar.dart b/lib/pages/home/widget/animate_app_bar.dart index 1b4e6f1c..cb52f6f5 100644 --- a/lib/pages/home/widget/animate_app_bar.dart +++ b/lib/pages/home/widget/animate_app_bar.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/provider/app_provider.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + import 'package:provider/provider.dart'; +import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class AnimateAppBar extends StatefulWidget with PreferredSizeWidget { final ScrollController? scrollController; final List? actions; diff --git a/lib/pages/house_introduce/house_introduce.dart b/lib/pages/house_introduce/house_introduce.dart index 897df747..a9abc6a3 100644 --- a/lib/pages/house_introduce/house_introduce.dart +++ b/lib/pages/house_introduce/house_introduce.dart @@ -1,15 +1,17 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/house_introduce/house_introduce_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; - import 'house_detail_page.dart'; class HouseIntroducePage extends StatefulWidget { @@ -54,7 +56,7 @@ class _HouseIntroducePageState extends State { borderRadius: BorderRadius.circular(4.w), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: SARSAPI.image(ImgModel.first(model.imgUrls)), height: 200.w, width: 240.w, fit: BoxFit.fill, @@ -98,7 +100,7 @@ class _HouseIntroducePageState extends State { body: BeeListView( path: API.manager.houseType, convert: (model) { - return model.tableList! + return model.rows .map((e) => HouseIntroduceModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart b/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart index 88fa5400..06f25d7b 100644 --- a/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart +++ b/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; class CommitteeMailboxPage extends StatefulWidget { CommitteeMailboxPage({Key? key}) : super(key: key); diff --git a/lib/pages/industry_committee/industry_committee_page.dart b/lib/pages/industry_committee/industry_committee_page.dart index e050f3fa..97027d8f 100644 --- a/lib/pages/industry_committee/industry_committee_page.dart +++ b/lib/pages/industry_committee/industry_committee_page.dart @@ -1,6 +1,14 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:url_launcher/url_launcher.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/user/committee_item_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; @@ -8,11 +16,6 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/utils/websocket/tips_dialog.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:url_launcher/url_launcher.dart'; class IndustryCommitteePage extends StatefulWidget { IndustryCommitteePage({Key? key}) : super(key: key); @@ -94,7 +97,7 @@ class _IndustryCommitteePageState extends State { borderRadius: BorderRadius.circular(4.w), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: SARSAPI.image(ImgModel.first(model.imgUrls)), height: 150.w, width: 150.w, fit: BoxFit.cover, @@ -150,9 +153,7 @@ class _IndustryCommitteePageState extends State { body: BeeListView( path: API.manager.commiteeStaff, convert: (model) { - return model.tableList! - .map((e) => CommitteeItemModel.fromJson(e)) - .toList(); + return model.rows.map((e) => CommitteeItemModel.fromJson(e)).toList(); }, controller: _refreshController, builder: (items) { diff --git a/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart b/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart index ff70d4e4..1227c8b9 100644 --- a/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart +++ b/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart @@ -1,7 +1,7 @@ -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'widget/bill_card.dart'; class LifePayBillPage extends StatefulWidget { diff --git a/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart b/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart index 3e2e7d06..ac1b6540 100644 --- a/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart +++ b/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; class BillCard extends StatelessWidget { BillCard({Key? key}) : super(key: key); diff --git a/lib/pages/life_pay/life_pay_choose_page.dart b/lib/pages/life_pay/life_pay_choose_page.dart index 6613226e..60628726 100644 --- a/lib/pages/life_pay/life_pay_choose_page.dart +++ b/lib/pages/life_pay/life_pay_choose_page.dart @@ -1,14 +1,16 @@ -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/extensions/widget_list_ext.dart'; -import 'package:aku_new_community/pages/life_pay/life_pay_page.dart'; -import 'package:aku_new_community/pages/share_pay_page/share_pay_page.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; +import 'package:aku_new_community/pages/life_pay/life_pay_page.dart'; +import 'package:aku_new_community/pages/share_pay_page/share_pay_page.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class LifePayChoosePage extends StatefulWidget { const LifePayChoosePage({Key? key}) : super(key: key); diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index e7aab54e..f81a99fe 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -299,7 +299,7 @@ class _LifePayPageState extends State { "size": _size, 'estateId': appProvider.selectedHouse!.estateId }); - _models = baseListModel.tableList! + _models = baseListModel.rows .map((e) => LifePayListModel.fromJson(e)) .toList(); // _selectPay.clear(); diff --git a/lib/pages/life_pay/life_pay_record_page.dart b/lib/pages/life_pay/life_pay_record_page.dart index c493c99a..539160d8 100644 --- a/lib/pages/life_pay/life_pay_record_page.dart +++ b/lib/pages/life_pay/life_pay_record_page.dart @@ -49,7 +49,7 @@ class _LifePayRecordPageState extends State { }, controller: _refreshController, convert: (models) { - return models.tableList! + return models.rows .map((e) => LifePayRecordModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/life_pay/pay_finish_page.dart b/lib/pages/life_pay/pay_finish_page.dart index 849b956b..7382cd14 100644 --- a/lib/pages/life_pay/pay_finish_page.dart +++ b/lib/pages/life_pay/pay_finish_page.dart @@ -1,8 +1,9 @@ -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/bee_back_button.dart'; + class PayFinishPage extends StatelessWidget { const PayFinishPage({Key? key}) : super(key: key); diff --git a/lib/pages/life_pay/pay_util.dart b/lib/pages/life_pay/pay_util.dart index 6622a775..cea1daac 100644 --- a/lib/pages/life_pay/pay_util.dart +++ b/lib/pages/life_pay/pay_util.dart @@ -1,12 +1,13 @@ import 'dart:convert'; -import 'package:aku_new_community/models/pay/pay_model.dart'; -import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:dio/dio.dart'; import 'package:power_logger/power_logger.dart'; import 'package:tobias/tobias.dart'; +import 'package:aku_new_community/models/pay/pay_model.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; + enum PAYTYPE { ///支付宝 ALI, diff --git a/lib/pages/life_pay/widget/life_pay_detail_page.dart b/lib/pages/life_pay/widget/life_pay_detail_page.dart index 6a653930..4c0d8bfb 100644 --- a/lib/pages/life_pay/widget/life_pay_detail_page.dart +++ b/lib/pages/life_pay/widget/life_pay_detail_page.dart @@ -1,3 +1,10 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:expandable/expandable.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/life_pay/life_pay_list_model.dart'; import 'package:aku_new_community/pages/life_pay/life_pay_page.dart'; @@ -6,11 +13,6 @@ import 'package:aku_new_community/utils/bee_parse.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bee_check_radio.dart'; -import 'package:expandable/expandable.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; class LifePayDetailPage extends StatefulWidget { final LifePayListModel model; diff --git a/lib/pages/life_pay/widget/submit_bar.dart b/lib/pages/life_pay/widget/submit_bar.dart index 8d708051..af8daa66 100644 --- a/lib/pages/life_pay/widget/submit_bar.dart +++ b/lib/pages/life_pay/widget/submit_bar.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; class SubmitBar extends StatefulWidget { final String? title; diff --git a/lib/pages/manager_func.dart b/lib/pages/manager_func.dart index 2048dbf2..cfdc7612 100644 --- a/lib/pages/manager_func.dart +++ b/lib/pages/manager_func.dart @@ -8,8 +8,8 @@ import 'package:aku_new_community/models/manage/fix_report/fix_detail_model.dart import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:dio/dio.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:dio/dio.dart'; class ManagerFunc { @Deprecated('') diff --git a/lib/pages/message_center_page/announce/announce_card.dart b/lib/pages/message_center_page/announce/announce_card.dart index 9f4e6561..c3d0b877 100644 --- a/lib/pages/message_center_page/announce/announce_card.dart +++ b/lib/pages/message_center_page/announce/announce_card.dart @@ -1,13 +1,15 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/extensions/widget_list_ext.dart'; -import 'package:aku_new_community/models/message/announce_list_model.dart'; -import 'package:aku_new_community/pages/message_center_page/announce/announce_view.dart'; -import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; +import 'package:aku_new_community/models/message/announce_list_model.dart'; +import 'package:aku_new_community/pages/message_center_page/announce/announce_view.dart'; + class AnnounceCard extends StatelessWidget { final ListDateModel modelList; final int index; diff --git a/lib/pages/message_center_page/announce/announce_view.dart b/lib/pages/message_center_page/announce/announce_view.dart index 26afed1d..70508b62 100644 --- a/lib/pages/message_center_page/announce/announce_view.dart +++ b/lib/pages/message_center_page/announce/announce_view.dart @@ -1,11 +1,13 @@ -import 'package:aku_new_community/models/message/announce_list_model.dart'; -import 'package:aku_new_community/pages/message_center_page/announce/announce_card.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:scroll_to_index/scroll_to_index.dart'; +import 'package:aku_new_community/models/message/announce_list_model.dart'; +import 'package:aku_new_community/pages/message_center_page/announce/announce_card.dart'; + class ListDateModel { final String month; final int index; diff --git a/lib/pages/message_center_page/comment_message/comment_message_page.dart b/lib/pages/message_center_page/comment_message/comment_message_page.dart index 9b18507c..1d5a6fa2 100644 --- a/lib/pages/message_center_page/comment_message/comment_message_page.dart +++ b/lib/pages/message_center_page/comment_message/comment_message_page.dart @@ -1,4 +1,10 @@ +import 'package:flutter/cupertino.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/message/comment_message_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; @@ -6,9 +12,6 @@ import 'package:aku_new_community/utils/bee_date_util.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; class CommentMessagePage extends StatefulWidget { CommentMessagePage({Key? key}) : super(key: key); @@ -72,7 +75,7 @@ class _CommentMessagePageState extends State { clipBehavior: Clip.antiAlias, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.headSculpture)), + image: SARSAPI.image(ImgModel.first(model.headSculpture)), fit: BoxFit.cover, ), ), @@ -96,7 +99,7 @@ class _CommentMessagePageState extends State { height: 160.w, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: SARSAPI.image(ImgModel.first(model.imgUrls)), fit: BoxFit.cover, ), ), @@ -113,7 +116,7 @@ class _CommentMessagePageState extends State { path: API.message.commentMessageList, controller: _easyRefreshController, convert: (models) { - return models.tableList! + return models.rows .map((e) => CommentMessageModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/message_center_page/refund_details.dart b/lib/pages/message_center_page/refund_details.dart index c1c4d604..94f76111 100644 --- a/lib/pages/message_center_page/refund_details.dart +++ b/lib/pages/message_center_page/refund_details.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; class RefundDetails extends StatelessWidget { final double? statusHeight; diff --git a/lib/pages/message_center_page/reply/replay_view.dart b/lib/pages/message_center_page/reply/replay_view.dart index 3fd66e94..216b451a 100644 --- a/lib/pages/message_center_page/reply/replay_view.dart +++ b/lib/pages/message_center_page/reply/replay_view.dart @@ -32,7 +32,7 @@ class _ReplayViewState extends State { path: SARSAPI.message.allComment, controller: widget.controller, convert: (models) => - models.tableList!.map((e) => ReplyListModel.fromJson(e)).toList(), + models.rows.map((e) => ReplyListModel.fromJson(e)).toList(), builder: (items) { return ListView.separated( itemBuilder: (context, index) { diff --git a/lib/pages/message_center_page/reply/reply_card.dart b/lib/pages/message_center_page/reply/reply_card.dart index dbeab8e6..b6c3ed64 100644 --- a/lib/pages/message_center_page/reply/reply_card.dart +++ b/lib/pages/message_center_page/reply/reply_card.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/message/reply_list_model.dart'; import 'package:aku_new_community/pages/message_center_page/message_func.dart'; import 'package:flutter/material.dart'; @@ -23,7 +23,7 @@ class ReplyCard extends StatelessWidget { children: [ ClipOval( child: Image.network( - API.image(model.avatar), + SARSAPI.image(model.avatar), width: 100.w, height: 100.w, ), @@ -47,7 +47,7 @@ class ReplyCard extends StatelessWidget { ClipRRect( borderRadius: BorderRadius.circular(9.w), child: Image.network( - API.image(model.pic), + SARSAPI.image(model.pic), width: 128.w, height: 128.w, ), diff --git a/lib/pages/message_center_page/system_message/system_message_detail_page.dart b/lib/pages/message_center_page/system_message/system_message_detail_page.dart index 4eed161b..5f493d3c 100644 --- a/lib/pages/message_center_page/system_message/system_message_detail_page.dart +++ b/lib/pages/message_center_page/system_message/system_message_detail_page.dart @@ -1,9 +1,11 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/model/message/system_message_detail_model.dart'; import 'package:aku_new_community/pages/message_center_page/message_func.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; class SystemMessageDetailPage extends StatefulWidget { final int? id; diff --git a/lib/pages/message_center_page/system_message/system_message_page.dart b/lib/pages/message_center_page/system_message/system_message_page.dart index 799c058b..a2e2f9a7 100644 --- a/lib/pages/message_center_page/system_message/system_message_page.dart +++ b/lib/pages/message_center_page/system_message/system_message_page.dart @@ -106,7 +106,7 @@ class _SystemMessagePageState extends State { path: API.message.sysMessageList, controller: _refreshController, convert: (models) { - return models.tableList! + return models.rows .map((e) => SystemMessageModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/message_center_page/thumbs_up/thumbs_up_card.dart b/lib/pages/message_center_page/thumbs_up/thumbs_up_card.dart index 8b4d54da..0a6349e1 100644 --- a/lib/pages/message_center_page/thumbs_up/thumbs_up_card.dart +++ b/lib/pages/message_center_page/thumbs_up/thumbs_up_card.dart @@ -1,5 +1,5 @@ import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/models/message/reply_list_model.dart'; import 'package:aku_new_community/pages/message_center_page/message_func.dart'; @@ -24,7 +24,7 @@ class ThumbsUpCard extends StatelessWidget { children: [ ClipOval( child: Image.network( - API.image(model.avatar), + SARSAPI.image(model.avatar), width: 100.w, height: 100.w, ), @@ -44,7 +44,7 @@ class ThumbsUpCard extends StatelessWidget { ClipRRect( borderRadius: BorderRadius.circular(9.w), child: Image.network( - API.image(model.pic), + SARSAPI.image(model.pic), width: 128.w, height: 128.w, ), diff --git a/lib/pages/message_center_page/thumbs_up/thumbs_up_view.dart b/lib/pages/message_center_page/thumbs_up/thumbs_up_view.dart index 7b9780fb..f0ee82f4 100644 --- a/lib/pages/message_center_page/thumbs_up/thumbs_up_view.dart +++ b/lib/pages/message_center_page/thumbs_up/thumbs_up_view.dart @@ -27,7 +27,7 @@ class _ThumbsUpViewState extends State { path: SARSAPI.message.allLikes, controller: widget.controller, convert: (models) => - models.tableList!.map((e) => ReplyListModel.fromJson(e)).toList(), + models.rows.map((e) => ReplyListModel.fromJson(e)).toList(), builder: (items) { return ListView.separated( itemBuilder: (context, index) { diff --git a/lib/pages/one_alarm/alarm_detail_page.dart b/lib/pages/one_alarm/alarm_detail_page.dart index 27ed5a12..c8fb17fa 100644 --- a/lib/pages/one_alarm/alarm_detail_page.dart +++ b/lib/pages/one_alarm/alarm_detail_page.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; class AlarmDetailPage extends StatelessWidget { const AlarmDetailPage({Key? key}) : super(key: key); diff --git a/lib/pages/personal/address/address_list_page.dart b/lib/pages/personal/address/address_list_page.dart index 1b823db9..4f9300ea 100644 --- a/lib/pages/personal/address/address_list_page.dart +++ b/lib/pages/personal/address/address_list_page.dart @@ -1,11 +1,12 @@ -import 'package:aku_new_community/model/user/adress_model.dart'; -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; +import 'package:aku_new_community/model/user/adress_model.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; import '../item_my_address.dart'; import '../user_func.dart'; import 'new_address_page.dart'; diff --git a/lib/pages/personal/address/address_selector.dart b/lib/pages/personal/address/address_selector.dart index fe2f6452..37b2a970 100644 --- a/lib/pages/personal/address/address_selector.dart +++ b/lib/pages/personal/address/address_selector.dart @@ -6,6 +6,7 @@ * remark : * ==================================================== */ + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/user/province_model.dart'; import 'package:aku_new_community/utils/headers.dart'; @@ -27,9 +28,7 @@ class AddressSelector extends StatefulWidget { this.province = "", this.city = "", this.district = "", - required this.callback}) - : assert(model != null), - assert(callback != null); + required this.callback}); @override _AddressSelectorState createState() => _AddressSelectorState(); diff --git a/lib/pages/personal/address/editView.dart b/lib/pages/personal/address/editView.dart index 5ea0d257..ba869e48 100644 --- a/lib/pages/personal/address/editView.dart +++ b/lib/pages/personal/address/editView.dart @@ -7,9 +7,9 @@ * ==================================================== */ -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/utils/headers.dart'; import 'input_view.dart'; typedef StringCallback = Function(String text); diff --git a/lib/pages/personal/address/new_address_page.dart b/lib/pages/personal/address/new_address_page.dart index ed06bc17..b39c9128 100644 --- a/lib/pages/personal/address/new_address_page.dart +++ b/lib/pages/personal/address/new_address_page.dart @@ -1,3 +1,10 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/user/adress_model.dart'; import 'package:aku_new_community/model/user/province_model.dart'; @@ -6,12 +13,6 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/utils/text_utils.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; - import 'address_selector.dart'; import 'editView.dart'; diff --git a/lib/pages/personal/change_nick_name_page.dart b/lib/pages/personal/change_nick_name_page.dart index b3dca890..f1fd189f 100644 --- a/lib/pages/personal/change_nick_name_page.dart +++ b/lib/pages/personal/change_nick_name_page.dart @@ -1,11 +1,13 @@ -import 'package:aku_new_community/provider/user_provider.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/provider/user_provider.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class ChangeNickName extends StatefulWidget { ChangeNickName({Key? key}) : super(key: key); diff --git a/lib/pages/personal/clock_in/clock_in_page.dart b/lib/pages/personal/clock_in/clock_in_page.dart index 9ebab979..e79e76e0 100644 --- a/lib/pages/personal/clock_in/clock_in_page.dart +++ b/lib/pages/personal/clock_in/clock_in_page.dart @@ -1,4 +1,13 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/extensions/num_ext.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; @@ -10,12 +19,6 @@ import 'package:aku_new_community/pages/personal/clock_in/clock_success_dialog.d import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class ClockInPage extends StatefulWidget { const ClockInPage({Key? key}) : super(key: key); @@ -77,7 +80,7 @@ class _ClockInPageState extends State { child: ClipOval( // child: FadeInImage.assetNetwork( // placeholder: Assets.images.placeholder.path, - // image: API.image( + // image: SARSAPI.image( // (UserTool.userProvider.userInfoModel?.imgUrls ?? []) // .isNotEmpty // ? UserTool diff --git a/lib/pages/personal/clock_in/clock_success_dialog.dart b/lib/pages/personal/clock_in/clock_success_dialog.dart index cca5713c..39327ab2 100644 --- a/lib/pages/personal/clock_in/clock_success_dialog.dart +++ b/lib/pages/personal/clock_in/clock_success_dialog.dart @@ -1,12 +1,14 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/extensions/num_ext.dart'; -import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; + class ClockSuccessDialog extends StatelessWidget { final int todayIntegral; final int tomorrowIntegral; diff --git a/lib/pages/personal/intergral/integral_center_page.dart b/lib/pages/personal/intergral/integral_center_page.dart index 96308faa..c2011265 100644 --- a/lib/pages/personal/intergral/integral_center_page.dart +++ b/lib/pages/personal/intergral/integral_center_page.dart @@ -1,13 +1,15 @@ -import 'package:aku_new_community/gen/assets.gen.dart'; -import 'package:aku_new_community/pages/personal/intergral/progress_paint.dart'; -import 'package:aku_new_community/pages/personal/intergral/rule_explain_page.dart'; -import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/pages/personal/intergral/progress_paint.dart'; +import 'package:aku_new_community/pages/personal/intergral/rule_explain_page.dart'; +import 'package:aku_new_community/widget/bee_back_button.dart'; + class integralCenterPage extends StatefulWidget { const integralCenterPage({Key? key}) : super(key: key); diff --git a/lib/pages/personal/intergral/progress_paint.dart b/lib/pages/personal/intergral/progress_paint.dart index 327e4b55..19f780bb 100644 --- a/lib/pages/personal/intergral/progress_paint.dart +++ b/lib/pages/personal/intergral/progress_paint.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/painters/progress_bar_painter.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/painters/progress_bar_painter.dart'; + class ProgressPaint extends StatelessWidget { final double proportion; final int activity; diff --git a/lib/pages/personal/intergral/rule_explain_page.dart b/lib/pages/personal/intergral/rule_explain_page.dart index 70d07e77..2a6f648c 100644 --- a/lib/pages/personal/intergral/rule_explain_page.dart +++ b/lib/pages/personal/intergral/rule_explain_page.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/gen/assets.gen.dart'; -import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/widget/bee_back_button.dart'; + class RuleExplainPage extends StatefulWidget { const RuleExplainPage({Key? key}) : super(key: key); diff --git a/lib/pages/personal/item_my_address.dart b/lib/pages/personal/item_my_address.dart index 37559c06..b7922763 100644 --- a/lib/pages/personal/item_my_address.dart +++ b/lib/pages/personal/item_my_address.dart @@ -7,17 +7,18 @@ * ==================================================== */ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/model/user/adress_model.dart'; -import 'package:aku_new_community/pages/personal/user_func.dart'; -import 'package:aku_new_community/provider/app_provider.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/model/user/adress_model.dart'; +import 'package:aku_new_community/pages/personal/user_func.dart'; +import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/utils/headers.dart'; import 'address/new_address_page.dart'; // ignore: must_be_immutable diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index c6cca8e5..cd8611b6 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -1,3 +1,12 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/pages/personal/clock_in/clock_in_page.dart'; @@ -14,13 +23,6 @@ import 'package:aku_new_community/ui/profile/new_house/my_house_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; - import 'address/address_list_page.dart'; import 'clock_in/clock_success_dialog.dart'; import 'intergral/integral_center_page.dart'; @@ -80,7 +82,7 @@ class _PersonalIndexState extends State child: ClipOval( // child: FadeInImage.assetNetwork( // placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - // image: API.image(userProvider + // image: SARSAPI.image(userProvider // .userInfoModel!.imgUrls.isNotEmpty // ? userProvider // .userInfoModel!.imgUrls.first.url @@ -277,7 +279,7 @@ class _PersonalIndexState extends State child: ClipOval( // child: FadeInImage.assetNetwork( // placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - // image: API.image((userProvider + // image: SARSAPI.image((userProvider // .userInfoModel?.imgUrls ?? // []) // .isNotEmpty diff --git a/lib/pages/personal/update_tel_page.dart b/lib/pages/personal/update_tel_page.dart index 8835cde8..ba88a30c 100644 --- a/lib/pages/personal/update_tel_page.dart +++ b/lib/pages/personal/update_tel_page.dart @@ -1,18 +1,20 @@ import 'dart:async'; -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/pages/sign/sign_func.dart'; -import 'package:aku_new_community/provider/user_provider.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/pages/sign/sign_func.dart'; +import 'package:aku_new_community/provider/user_provider.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class UpdateTelPage extends StatefulWidget { UpdateTelPage({Key? key}) : super(key: key); diff --git a/lib/pages/personal/user_func.dart b/lib/pages/personal/user_func.dart index dd14f4d3..2db03836 100644 --- a/lib/pages/personal/user_func.dart +++ b/lib/pages/personal/user_func.dart @@ -101,8 +101,8 @@ class Userfunc { API.community.boardList, params: {'pageNum': 1, 'size': 5}, ); - if (model.tableList!.length == 0) return []; - return model.tableList!.map((e) => BoardItemModel.fromJson(e)).toList(); + if (model.rows.length == 0) return []; + return model.rows.map((e) => BoardItemModel.fromJson(e)).toList(); } static Future> swiper() async { diff --git a/lib/pages/personal/user_profile_page.dart b/lib/pages/personal/user_profile_page.dart index 19400352..51eaf351 100644 --- a/lib/pages/personal/user_profile_page.dart +++ b/lib/pages/personal/user_profile_page.dart @@ -6,7 +6,7 @@ import 'package:aku_new_community/pages/personal/change_nick_name_page.dart'; import 'package:aku_new_community/pages/personal/update_tel_page.dart'; import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/utils/network/base_file_model.dart'; +import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/picker/bee_custom_picker.dart'; @@ -68,12 +68,12 @@ class _UserProfilePageState extends State { else { //Upload Avatar Function cancel = BotToast.showLoading(); - BaseFileModel model = + BaseModel model = await NetUtil().upload(SARSAPI.uploadFile.uploadImg, file); - if (model.status ?? false) - userProvider.updateAvatar(model.url); + if (model.success) + userProvider.updateAvatar(model.data as String); else - BotToast.showText(text: model.message!); + BotToast.showText(text: model.msg); cancel(); } } @@ -92,7 +92,7 @@ class _UserProfilePageState extends State { child: ClipOval( // child: // CachedNetworkImage( - // imageUrl: API.image( + // imageUrl: SARSAPI.image( // userProvider.userInfoModel!.imgUrls.isNotEmpty // ? userProvider.userInfoModel?.imgUrls.first.url // : ''), @@ -106,7 +106,7 @@ class _UserProfilePageState extends State { // ), // FadeInImage.assetNetwork( // placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - // image: API.image( + // image: SARSAPI.image( // (userProvider.userInfoModel?.imgUrls ?? []).isNotEmpty // ? userProvider.userInfoModel?.imgUrls.first.url // : ''), diff --git a/lib/pages/personal/widget/refund_shop_card.dart b/lib/pages/personal/widget/refund_shop_card.dart index c2b058eb..2bdb355b 100644 --- a/lib/pages/personal/widget/refund_shop_card.dart +++ b/lib/pages/personal/widget/refund_shop_card.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; class RefundShopCard extends StatelessWidget { final String? imagePath, content, specs; diff --git a/lib/pages/personal/widget/refund_tile_card.dart b/lib/pages/personal/widget/refund_tile_card.dart index 880ed975..79007591 100644 --- a/lib/pages/personal/widget/refund_tile_card.dart +++ b/lib/pages/personal/widget/refund_tile_card.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_icons/flutter_icons.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class RefundTileCard extends StatefulWidget { final List>? listTile; diff --git a/lib/pages/property/property_index.dart b/lib/pages/property/property_index.dart index 7fa45d51..7e91cb1c 100644 --- a/lib/pages/property/property_index.dart +++ b/lib/pages/property/property_index.dart @@ -43,8 +43,8 @@ class _PropertyIndexState extends State 'size': 10, }, ); - _pageCount = model.pageCount; - return model.tableList!.map((e) => BoardItemModel.fromJson(e)).toList(); + _pageCount = model.total; + return model.rows.map((e) => BoardItemModel.fromJson(e)).toList(); } @override diff --git a/lib/pages/property/property_page.dart b/lib/pages/property/property_page.dart index 7ac1dffd..2be6d909 100644 --- a/lib/pages/property/property_page.dart +++ b/lib/pages/property/property_page.dart @@ -1,3 +1,11 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/application_objects.dart'; import 'package:aku_new_community/pages/life_pay/life_pay_choose_page.dart'; @@ -8,12 +16,6 @@ import 'package:aku_new_community/ui/profile/house/add_house_page.dart'; import 'package:aku_new_community/ui/profile/house/house_owners_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/views/application_view.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; class PropertyPage extends StatefulWidget { final bool? isSign; diff --git a/lib/pages/property/widget/property_card.dart b/lib/pages/property/widget/property_card.dart index bab4780f..b6086933 100644 --- a/lib/pages/property/widget/property_card.dart +++ b/lib/pages/property/widget/property_card.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:get/get.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class PropertyCard extends StatelessWidget { PropertyCard({Key? key}) : super(key: key); diff --git a/lib/pages/renovation_manage/new_renovation/new_renovation_detail_page.dart b/lib/pages/renovation_manage/new_renovation/new_renovation_detail_page.dart index 3151d4d6..a44c1885 100644 --- a/lib/pages/renovation_manage/new_renovation/new_renovation_detail_page.dart +++ b/lib/pages/renovation_manage/new_renovation/new_renovation_detail_page.dart @@ -1,9 +1,10 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/new_renovation/new_renovation_list_model.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; class NewRenovationDetailPage extends StatefulWidget { final NewRenovationListModel model; diff --git a/lib/pages/renovation_manage/new_renovation/new_renovation_page.dart b/lib/pages/renovation_manage/new_renovation/new_renovation_page.dart index 58bd555e..0f48551d 100644 --- a/lib/pages/renovation_manage/new_renovation/new_renovation_page.dart +++ b/lib/pages/renovation_manage/new_renovation/new_renovation_page.dart @@ -1,11 +1,13 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:get/get.dart'; + import 'package:aku_new_community/pages/renovation_manage/new_renovation/new_renovation_add_page.dart'; import 'package:aku_new_community/pages/renovation_manage/new_renovation/new_renovation_view.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class NewRenovationPage extends StatefulWidget { NewRenovationPage({Key? key}) : super(key: key); diff --git a/lib/pages/renovation_manage/new_renovation/new_renovation_view.dart b/lib/pages/renovation_manage/new_renovation/new_renovation_view.dart index ddf79a70..44e0d888 100644 --- a/lib/pages/renovation_manage/new_renovation/new_renovation_view.dart +++ b/lib/pages/renovation_manage/new_renovation/new_renovation_view.dart @@ -41,7 +41,7 @@ class _NewRenovationViewState extends State }, controller: _refreshController, convert: (models) { - return models.tableList! + return models.rows .map((e) => NewRenovationListModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/renovation_manage/renovation_manage_card.dart b/lib/pages/renovation_manage/renovation_manage_card.dart index e35ea92e..9e79c78a 100644 --- a/lib/pages/renovation_manage/renovation_manage_card.dart +++ b/lib/pages/renovation_manage/renovation_manage_card.dart @@ -1,13 +1,15 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/pages/renovation_manage/renovation_manage_detail_page.dart'; -import 'package:aku_new_community/pages/renovation_manage/renovation_map.dart'; -import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/pages/renovation_manage/renovation_manage_detail_page.dart'; +import 'package:aku_new_community/pages/renovation_manage/renovation_map.dart'; + class RenovationManageCard extends StatefulWidget { final int index; diff --git a/lib/pages/renovation_manage/renovation_manage_detail_page.dart b/lib/pages/renovation_manage/renovation_manage_detail_page.dart index 36f18770..f34a0208 100644 --- a/lib/pages/renovation_manage/renovation_manage_detail_page.dart +++ b/lib/pages/renovation_manage/renovation_manage_detail_page.dart @@ -1,13 +1,15 @@ import 'dart:math'; +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/pages/renovation_manage/renovation_map.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class RenovationManageDetailPage extends StatefulWidget { RenovationManageDetailPage({Key? key}) : super(key: key); diff --git a/lib/pages/renovation_manage/renovation_manage_page.dart b/lib/pages/renovation_manage/renovation_manage_page.dart index 3d887d54..4191c46d 100644 --- a/lib/pages/renovation_manage/renovation_manage_page.dart +++ b/lib/pages/renovation_manage/renovation_manage_page.dart @@ -1,7 +1,8 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/pages/renovation_manage/renovation_manage_view.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; -import 'package:flutter/material.dart'; class RenovationManagePage extends StatefulWidget { RenovationManagePage({Key? key}) : super(key: key); diff --git a/lib/pages/renovation_manage/renovation_manage_view.dart b/lib/pages/renovation_manage/renovation_manage_view.dart index a5503e45..a0ac154e 100644 --- a/lib/pages/renovation_manage/renovation_manage_view.dart +++ b/lib/pages/renovation_manage/renovation_manage_view.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/pages/renovation_manage/renovation_manage_card.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/pages/renovation_manage/renovation_manage_card.dart'; + class RenovationManageView extends StatefulWidget { final int index; diff --git a/lib/pages/service_browse/service_browse_detail_page.dart b/lib/pages/service_browse/service_browse_detail_page.dart index c6e4c9df..67e730f0 100644 --- a/lib/pages/service_browse/service_browse_detail_page.dart +++ b/lib/pages/service_browse/service_browse_detail_page.dart @@ -1,14 +1,16 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/models/service_browse/service_browse_list_mode.dart'; -import 'package:aku_new_community/utils/link_text_parase.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:common_utils/common_utils.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/models/service_browse/service_browse_list_mode.dart'; +import 'package:aku_new_community/utils/link_text_parase.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class ServiceBrowseDetailPage extends StatefulWidget { final ServiceBrowseListModel model; diff --git a/lib/pages/service_browse/service_browse_page.dart b/lib/pages/service_browse/service_browse_page.dart index 646e173e..92e347b9 100644 --- a/lib/pages/service_browse/service_browse_page.dart +++ b/lib/pages/service_browse/service_browse_page.dart @@ -40,7 +40,7 @@ class _ServiceBrowsePageState extends State { path: API.manager.serviceBrowseList, controller: _easyRefreshController, convert: (models) { - return models.tableList! + return models.rows .map((e) => ServiceBrowseListModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/services/old_age/add_equipment_page.dart b/lib/pages/services/old_age/add_equipment_page.dart index 2654d42b..988917ed 100644 --- a/lib/pages/services/old_age/add_equipment_page.dart +++ b/lib/pages/services/old_age/add_equipment_page.dart @@ -1,11 +1,13 @@ -import 'package:aku_new_community/gen/assets.gen.dart'; -import 'package:aku_new_community/pages/services/old_age/submit_equipment_code_page.dart'; -import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/pages/services/old_age/submit_equipment_code_page.dart'; +import 'package:aku_new_community/widget/bee_back_button.dart'; + class AddEquipmentPage extends StatefulWidget { const AddEquipmentPage({Key? key}) : super(key: key); diff --git a/lib/pages/services/old_age/equipment_list_page.dart b/lib/pages/services/old_age/equipment_list_page.dart index 25f1cd4e..925dfe83 100644 --- a/lib/pages/services/old_age/equipment_list_page.dart +++ b/lib/pages/services/old_age/equipment_list_page.dart @@ -1,14 +1,16 @@ -import 'package:aku_new_community/extensions/widget_list_ext.dart'; -import 'package:aku_new_community/gen/assets.gen.dart'; -import 'package:aku_new_community/pages/services/old_age/add_equipment_page.dart'; -import 'package:aku_new_community/widget/bee_divider.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/pages/services/old_age/add_equipment_page.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class bracelet { String title; String describe; diff --git a/lib/pages/services/old_age/old_age_support_page.dart b/lib/pages/services/old_age/old_age_support_page.dart index e21c060a..3584d86f 100644 --- a/lib/pages/services/old_age/old_age_support_page.dart +++ b/lib/pages/services/old_age/old_age_support_page.dart @@ -1,10 +1,12 @@ -import 'package:aku_new_community/gen/assets.gen.dart'; -import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/widget/bee_back_button.dart'; + @Deprecated('第一版带图表,暂时不做') class OldAgeSupportPage extends StatefulWidget { const OldAgeSupportPage({Key? key}) : super(key: key); diff --git a/lib/pages/services/old_age/old_age_support_page_simple.dart b/lib/pages/services/old_age/old_age_support_page_simple.dart index e01938d7..7cf91b21 100644 --- a/lib/pages/services/old_age/old_age_support_page_simple.dart +++ b/lib/pages/services/old_age/old_age_support_page_simple.dart @@ -7,8 +7,8 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; -import 'package:dio/dio.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/pages/services/old_age/submit_equipment_code_page.dart b/lib/pages/services/old_age/submit_equipment_code_page.dart index 4b6ff1a9..e0a74f23 100644 --- a/lib/pages/services/old_age/submit_equipment_code_page.dart +++ b/lib/pages/services/old_age/submit_equipment_code_page.dart @@ -1,10 +1,12 @@ -import 'package:aku_new_community/gen/assets.gen.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class SubmitEquipmentCodePage extends StatefulWidget { const SubmitEquipmentCodePage({Key? key}) : super(key: key); diff --git a/lib/pages/setting_page/about_page/about_page.dart b/lib/pages/setting_page/about_page/about_page.dart index f7c5e0b2..21bc6c16 100644 --- a/lib/pages/setting_page/about_page/about_page.dart +++ b/lib/pages/setting_page/about_page/about_page.dart @@ -1,8 +1,9 @@ -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class AboutPage extends StatelessWidget { const AboutPage({Key? key}) : super(key: key); diff --git a/lib/pages/setting_page/account_manager_page.dart b/lib/pages/setting_page/account_manager_page.dart index a1a8a5f3..b39ac802 100644 --- a/lib/pages/setting_page/account_manager_page.dart +++ b/lib/pages/setting_page/account_manager_page.dart @@ -1,10 +1,12 @@ -import 'package:aku_new_community/pages/sign/login/login_page.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/pages/sign/login/login_page.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class AccountManagerPage extends StatefulWidget { AccountManagerPage({Key? key}) : super(key: key); diff --git a/lib/pages/setting_page/agreement_page/agreement_page.dart b/lib/pages/setting_page/agreement_page/agreement_page.dart index 75a23bb7..3336c72a 100644 --- a/lib/pages/setting_page/agreement_page/agreement_page.dart +++ b/lib/pages/setting_page/agreement_page/agreement_page.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; class AgreementPage extends StatefulWidget { @override diff --git a/lib/pages/setting_page/agreement_page/privacy_page.dart b/lib/pages/setting_page/agreement_page/privacy_page.dart index 3ab3b70e..51e6cbcc 100644 --- a/lib/pages/setting_page/agreement_page/privacy_page.dart +++ b/lib/pages/setting_page/agreement_page/privacy_page.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; class PrivacyPage extends StatefulWidget { PrivacyPage({Key? key}) : super(key: key); diff --git a/lib/pages/setting_page/invite_page/invite_page.dart b/lib/pages/setting_page/invite_page/invite_page.dart index 9fcbc080..ca4a6072 100644 --- a/lib/pages/setting_page/invite_page/invite_page.dart +++ b/lib/pages/setting_page/invite_page/invite_page.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; + import 'package:qr_flutter/qr_flutter.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class InvitePage extends StatelessWidget { const InvitePage({Key? key}) : super(key: key); diff --git a/lib/pages/setting_page/settings_page.dart b/lib/pages/setting_page/settings_page.dart index 924a4834..0b8ed1f5 100644 --- a/lib/pages/setting_page/settings_page.dart +++ b/lib/pages/setting_page/settings_page.dart @@ -1,3 +1,11 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/extensions/num_ext.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; @@ -12,12 +20,6 @@ import 'package:aku_new_community/utils/developer_util.dart'; import 'package:aku_new_community/utils/websocket/web_socket_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; class SettingsPage extends StatefulWidget { SettingsPage({Key? key}) : super(key: key); diff --git a/lib/pages/share_pay_page/share_pay_detail_page.dart b/lib/pages/share_pay_page/share_pay_detail_page.dart index 2e4c5ccf..3e1b27cc 100644 --- a/lib/pages/share_pay_page/share_pay_detail_page.dart +++ b/lib/pages/share_pay_page/share_pay_detail_page.dart @@ -1,5 +1,11 @@ import 'dart:convert'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/life_pay/share_pay_list_model.dart'; import 'package:aku_new_community/pages/life_pay/life_pay_page.dart'; @@ -7,10 +13,6 @@ import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bee_check_radio.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; class SharePayDetailPage extends StatefulWidget { final SharePayListModel model; diff --git a/lib/pages/share_pay_page/share_record_page.dart b/lib/pages/share_pay_page/share_record_page.dart index cdb2ef63..b6fe37d4 100644 --- a/lib/pages/share_pay_page/share_record_page.dart +++ b/lib/pages/share_pay_page/share_record_page.dart @@ -1,13 +1,16 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/life_pay/share_pay_record_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; class ShareRecordPage extends StatefulWidget { const ShareRecordPage({Key? key}) : super(key: key); @@ -47,7 +50,7 @@ class _ShareRecordPageState extends State { extraParams: {"tel": UserTool.userProvider.userInfoModel!.tel}, controller: _refreshController, convert: (models) { - return models.tableList! + return models.rows .map((e) => SharePayRecordModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/sign/login/code_message_page.dart b/lib/pages/sign/login/code_message_page.dart index 09355843..f27a2c6b 100644 --- a/lib/pages/sign/login/code_message_page.dart +++ b/lib/pages/sign/login/code_message_page.dart @@ -1,14 +1,15 @@ -import 'package:aku_new_community/pages/sign/sign_func.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + +import 'package:bot_toast/bot_toast.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:sms_autofill/sms_autofill.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/pages/sign/sign_func.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; import '../../tab_navigator.dart'; class CodeMessagePage extends StatefulWidget { diff --git a/lib/pages/sign/login/forgot_psd_page.dart b/lib/pages/sign/login/forgot_psd_page.dart index 66926139..6f0f1f66 100644 --- a/lib/pages/sign/login/forgot_psd_page.dart +++ b/lib/pages/sign/login/forgot_psd_page.dart @@ -1,15 +1,16 @@ -import 'package:aku_new_community/pages/sign/login/forgot_set_psd_page.dart'; -import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; -import 'package:aku_new_community/pages/sign/widget/tel_text_field.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/others/user_tool.dart'; +import 'package:flutter/material.dart'; + import 'package:bot_toast/bot_toast.dart'; import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/pages/sign/login/forgot_set_psd_page.dart'; +import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; +import 'package:aku_new_community/pages/sign/widget/tel_text_field.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; import '../sign_func.dart'; class ForgotPsdPage extends StatefulWidget { diff --git a/lib/pages/sign/login/forgot_set_psd_page.dart b/lib/pages/sign/login/forgot_set_psd_page.dart index 9420d653..6407529b 100644 --- a/lib/pages/sign/login/forgot_set_psd_page.dart +++ b/lib/pages/sign/login/forgot_set_psd_page.dart @@ -1,16 +1,17 @@ -import 'package:aku_new_community/pages/sign/login/psd_verify.dart'; -import 'package:aku_new_community/pages/sign/sign_func.dart'; -import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; -import 'package:aku_new_community/pages/sign/widget/psd_text_field.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + +import 'package:bot_toast/bot_toast.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/pages/sign/login/psd_verify.dart'; +import 'package:aku_new_community/pages/sign/sign_func.dart'; +import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; +import 'package:aku_new_community/pages/sign/widget/psd_text_field.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; import 'login_page.dart'; class ForgotSetPsdPage extends StatefulWidget { diff --git a/lib/pages/sign/login/login_page.dart b/lib/pages/sign/login/login_page.dart index fe8ed0b0..66d52798 100644 --- a/lib/pages/sign/login/login_page.dart +++ b/lib/pages/sign/login/login_page.dart @@ -1,14 +1,16 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/pages/sign/login/other_login_page.dart'; -import 'package:aku_new_community/pages/sign/login/select_community_page.dart'; -import 'package:aku_new_community/provider/app_provider.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/pages/sign/login/other_login_page.dart'; +import 'package:aku_new_community/pages/sign/login/select_community_page.dart'; +import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class LoginPage extends StatefulWidget { const LoginPage({Key? key}) : super(key: key); diff --git a/lib/pages/sign/login/other_login_page.dart b/lib/pages/sign/login/other_login_page.dart index 755e17b0..38c523bc 100644 --- a/lib/pages/sign/login/other_login_page.dart +++ b/lib/pages/sign/login/other_login_page.dart @@ -1,3 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/pages/sign/login/code_message_page.dart'; import 'package:aku_new_community/pages/sign/login/forgot_psd_page.dart'; import 'package:aku_new_community/pages/sign/login/login_page.dart'; @@ -8,14 +17,6 @@ import 'package:aku_new_community/pages/sign/widget/tel_text_field.dart'; import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; - import '../../tab_navigator.dart'; class OtherLoginPage extends StatefulWidget { diff --git a/lib/pages/sign/login/select_community_page.dart b/lib/pages/sign/login/select_community_page.dart index 71a384ff..988281ed 100644 --- a/lib/pages/sign/login/select_community_page.dart +++ b/lib/pages/sign/login/select_community_page.dart @@ -1,3 +1,11 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/login/community_model.dart'; import 'package:aku_new_community/models/login/history_login_model.dart'; @@ -6,11 +14,6 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/bee_city_picker.dart'; import 'package:aku_new_community/widget/picker/bee_community_picker.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class SelectCommunity extends StatefulWidget { const SelectCommunity({ diff --git a/lib/pages/sign/login/set_nick_name_page.dart b/lib/pages/sign/login/set_nick_name_page.dart index 0997e20b..ecde39cd 100644 --- a/lib/pages/sign/login/set_nick_name_page.dart +++ b/lib/pages/sign/login/set_nick_name_page.dart @@ -1,10 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/pages/sign/sign_func.dart'; import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class SetNickNamePage extends StatefulWidget { const SetNickNamePage({Key? key}) : super(key: key); diff --git a/lib/pages/sign/login/set_psd_page.dart b/lib/pages/sign/login/set_psd_page.dart index cd7ef7e6..be3f0718 100644 --- a/lib/pages/sign/login/set_psd_page.dart +++ b/lib/pages/sign/login/set_psd_page.dart @@ -1,12 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/pages/sign/login/psd_verify.dart'; import 'package:aku_new_community/pages/sign/sign_func.dart'; import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; import 'package:aku_new_community/pages/sign/widget/psd_text_field.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class SetPsdPage extends StatefulWidget { const SetPsdPage({Key? key}) : super(key: key); diff --git a/lib/pages/sign/sign_func.dart b/lib/pages/sign/sign_func.dart index 34a54871..d7636f23 100644 --- a/lib/pages/sign/sign_func.dart +++ b/lib/pages/sign/sign_func.dart @@ -1,5 +1,12 @@ +import 'package:bot_toast/bot_toast.dart'; +import 'package:dio/dio.dart'; +import 'package:get/get.dart' hide Response; +import 'package:provider/provider.dart'; + +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/user/pick_building_model.dart'; import 'package:aku_new_community/models/user/my_house_model.dart'; import 'package:aku_new_community/models/user/user_info_model.dart'; @@ -10,10 +17,6 @@ import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:dio/dio.dart'; -import 'package:get/get.dart' hide Response; -import 'package:provider/provider.dart'; class SignFunc { //发送手机号验证码 diff --git a/lib/pages/sign/sign_in_page.dart b/lib/pages/sign/sign_in_page.dart index 16b9a661..d8efc681 100644 --- a/lib/pages/sign/sign_in_page.dart +++ b/lib/pages/sign/sign_in_page.dart @@ -1,17 +1,19 @@ import 'dart:async'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:get/get.dart' hide Response; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/provider/sign_up_provider.dart'; import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:get/get.dart' hide Response; -import 'package:provider/provider.dart'; class SignInPage extends StatefulWidget { SignInPage({Key? key}) : super(key: key); diff --git a/lib/pages/sign/widget/login_button_widget.dart b/lib/pages/sign/widget/login_button_widget.dart index 27a471e7..7b92cc82 100644 --- a/lib/pages/sign/widget/login_button_widget.dart +++ b/lib/pages/sign/widget/login_button_widget.dart @@ -1,7 +1,9 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/base/base_style.dart'; + class LoginButtonWidget extends StatelessWidget { final VoidCallback? onTap; final String text; diff --git a/lib/pages/sign/widget/psd_text_field.dart b/lib/pages/sign/widget/psd_text_field.dart index 75bc50f8..2fe2d19f 100644 --- a/lib/pages/sign/widget/psd_text_field.dart +++ b/lib/pages/sign/widget/psd_text_field.dart @@ -1,5 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class PsdTextField extends StatefulWidget { diff --git a/lib/pages/sign/widget/tel_text_field.dart b/lib/pages/sign/widget/tel_text_field.dart index 9f1bb897..b02af4e6 100644 --- a/lib/pages/sign/widget/tel_text_field.dart +++ b/lib/pages/sign/widget/tel_text_field.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; diff --git a/lib/pages/splash/splash_page.dart b/lib/pages/splash/splash_page.dart index 5fc7e550..69c62db0 100644 --- a/lib/pages/splash/splash_page.dart +++ b/lib/pages/splash/splash_page.dart @@ -1,25 +1,26 @@ import 'dart:io'; -import 'package:aku_new_community/main_initialize.dart'; -import 'package:aku_new_community/pages/setting_page/agreement_page/agreement_page.dart'; -import 'package:aku_new_community/pages/setting_page/agreement_page/privacy_page.dart'; -import 'package:aku_new_community/provider/app_provider.dart'; -import 'package:aku_new_community/provider/user_provider.dart'; -import 'package:aku_new_community/utils/developer_util.dart'; -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/utils/hive_store.dart'; -import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:amap_flutter_location/amap_flutter_location.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + +import 'package:amap_flutter_location/amap_flutter_location.dart'; import 'package:get/get.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:power_logger/power_logger.dart'; import 'package:provider/provider.dart'; +import 'package:aku_new_community/main_initialize.dart'; +import 'package:aku_new_community/pages/setting_page/agreement_page/agreement_page.dart'; +import 'package:aku_new_community/pages/setting_page/agreement_page/privacy_page.dart'; +import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/provider/user_provider.dart'; +import 'package:aku_new_community/utils/developer_util.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/utils/hive_store.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; import '../tab_navigator.dart'; class SplashPage extends StatefulWidget { diff --git a/lib/pages/surrounding_enterprises/surrounding_enterprises_detail_page.dart b/lib/pages/surrounding_enterprises/surrounding_enterprises_detail_page.dart index 925fb8b2..e193382a 100644 --- a/lib/pages/surrounding_enterprises/surrounding_enterprises_detail_page.dart +++ b/lib/pages/surrounding_enterprises/surrounding_enterprises_detail_page.dart @@ -1,11 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/surrounding_enterprises/surrounding_enterprises_model.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; class SurroundingEnterprisesDetailPage extends StatefulWidget { final SurroundingEnterprisesModel surroundingEnterprisesModel; @@ -32,7 +35,7 @@ class _SurroundingEnterprisesDetailPageState child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, fit: BoxFit.cover, - image: API.image(ImgModel.first( + image: SARSAPI.image(ImgModel.first( widget.surroundingEnterprisesModel.imgList))), width: double.infinity, height: 424.w, diff --git a/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart b/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart index 5e1b39d8..d9f30a6b 100644 --- a/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart +++ b/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart @@ -1,15 +1,18 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/surrounding_enterprises/surrounding_enterprises_model.dart'; import 'package:aku_new_community/pages/surrounding_enterprises/surrounding_enterprises_detail_page.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; class SurroundingEnterprisesPage extends StatefulWidget { SurroundingEnterprisesPage({Key? key}) : super(key: key); @@ -56,7 +59,7 @@ class _SurroundingEnterprisesPageState borderRadius: BorderRadius.circular(4.w), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgList)), + image: SARSAPI.image(ImgModel.first(model.imgList)), height: 200.w, width: 240.w, fit: BoxFit.fill, @@ -117,7 +120,7 @@ class _SurroundingEnterprisesPageState path: API.manager.surroundingEnterprises, extraParams: {'pageNum': _page, 'size': _size}, convert: (model) { - return model.tableList! + return model.rows .map((e) => SurroundingEnterprisesModel.fromJson(e)) .toList(); }, diff --git a/lib/pages/tab_navigator.dart b/lib/pages/tab_navigator.dart index d5566434..98f2b6d5 100644 --- a/lib/pages/tab_navigator.dart +++ b/lib/pages/tab_navigator.dart @@ -1,5 +1,13 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/user/province_model.dart'; import 'package:aku_new_community/pages/property/property_page.dart'; import 'package:aku_new_community/pages/sign/login/login_page.dart'; @@ -12,12 +20,6 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/utils/websocket/web_socket_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; - import 'home/home_page.dart'; import 'personal/personal_page.dart'; diff --git a/lib/pages/things_page/fixed_submit_page.dart b/lib/pages/things_page/fixed_submit_page.dart index d1328df1..931b0817 100644 --- a/lib/pages/things_page/fixed_submit_page.dart +++ b/lib/pages/things_page/fixed_submit_page.dart @@ -1,6 +1,15 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/extensions/num_ext.dart'; import 'package:aku_new_community/model/user/fixed_submit_model.dart'; import 'package:aku_new_community/pages/manager_func.dart'; @@ -12,12 +21,6 @@ import 'package:aku_new_community/utils/bee_map.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/views/horizontal_image_view.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class FixedSubmitPage extends StatefulWidget { FixedSubmitPage({Key? key}) : super(key: key); @@ -227,9 +230,7 @@ class _FixedSubmitPageState extends State { controller: _easyRefreshController, path: API.manager.fixedSubmit, convert: (model) { - return model.tableList! - .map((e) => FixedSubmitModel.fromJson(e)) - .toList(); + return model.rows.map((e) => FixedSubmitModel.fromJson(e)).toList(); }, builder: (items) { return ListView.separated( diff --git a/lib/pages/things_page/widget/add_fixed_submit_page.dart b/lib/pages/things_page/widget/add_fixed_submit_page.dart index 39acd874..717bfa62 100644 --- a/lib/pages/things_page/widget/add_fixed_submit_page.dart +++ b/lib/pages/things_page/widget/add_fixed_submit_page.dart @@ -1,8 +1,15 @@ import 'dart:io'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/pages/manager_func.dart'; import 'package:aku_new_community/pages/things_page/widget/finish_fixed_submit_page.dart'; import 'package:aku_new_community/provider/app_provider.dart'; @@ -14,10 +21,6 @@ import 'package:aku_new_community/widget/buttons/bee_check_button.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/house_head_card.dart'; import 'package:aku_new_community/widget/picker/grid_image_picker.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; class AddFixedSubmitPage extends StatefulWidget { AddFixedSubmitPage({Key? key}) : super(key: key); diff --git a/lib/pages/things_page/widget/bee_list_view.dart b/lib/pages/things_page/widget/bee_list_view.dart index 959d03ab..1758e17c 100644 --- a/lib/pages/things_page/widget/bee_list_view.dart +++ b/lib/pages/things_page/widget/bee_list_view.dart @@ -1,14 +1,16 @@ -import 'package:aku_new_community/utils/network/base_list_model.dart'; -import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:aku_new_community/utils/network/base_list_model.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; + /// ## BeeListView ///```dart ///BeeListView( /// path: API.someAPI, /// convert: (model) { -/// return model.tableList +/// return model.rows /// .map((e) => SomeModel.fromJson(e)) /// .toList(); /// }, @@ -34,12 +36,12 @@ class BeeListView extends StatefulWidget { /// ///BaseListModel to T /// - ///T is a tableList item. + ///T is a rows item. /// ///```dart ///... ///convert: (model) { - /// return model.tableList + /// return model.rows /// .map((e) => SomeModel.fromJson(e)) /// .toList(); ///}, @@ -113,7 +115,7 @@ class _BeeListViewState extends State { params: _params, ); _models.addAll(widget.convert(_model) as List); - if (_pageNum >= _model.pageCount!) + if (_models.length >= _model.total) widget.controller!.finishLoad(noMore: true); setState(() {}); }, diff --git a/lib/pages/things_page/widget/finish_fixed_submit_page.dart b/lib/pages/things_page/widget/finish_fixed_submit_page.dart index dc0d16fa..85ab8fa1 100644 --- a/lib/pages/things_page/widget/finish_fixed_submit_page.dart +++ b/lib/pages/things_page/widget/finish_fixed_submit_page.dart @@ -1,11 +1,13 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/others/finish_result_image.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/finish_result_image.dart'; + class FinishFixedSubmitPage extends StatelessWidget { const FinishFixedSubmitPage({Key? key}) : super(key: key); diff --git a/lib/pages/things_page/widget/fixed_check_box.dart b/lib/pages/things_page/widget/fixed_check_box.dart index ce98bd43..f2a9c621 100644 --- a/lib/pages/things_page/widget/fixed_check_box.dart +++ b/lib/pages/things_page/widget/fixed_check_box.dart @@ -1,7 +1,9 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/base/base_style.dart'; + class FixedCheckBox extends StatefulWidget { final Function(bool isSelect)? onChanged; diff --git a/lib/pages/things_page/widget/fixed_detail_page.dart b/lib/pages/things_page/widget/fixed_detail_page.dart index 7c24b4b4..a6db41cd 100644 --- a/lib/pages/things_page/widget/fixed_detail_page.dart +++ b/lib/pages/things_page/widget/fixed_detail_page.dart @@ -1,5 +1,14 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:url_launcher/url_launcher.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/manage/fix_report/fix_detail_model.dart'; import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart'; import 'package:aku_new_community/pages/life_pay/pay_util.dart'; @@ -11,12 +20,6 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/views/horizontal_image_view.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:url_launcher/url_launcher.dart'; class FixedDetailPage extends StatefulWidget { final int id; diff --git a/lib/pages/things_page/widget/fixed_evaluate_page.dart b/lib/pages/things_page/widget/fixed_evaluate_page.dart index ce6fe012..8a2cb421 100644 --- a/lib/pages/things_page/widget/fixed_evaluate_page.dart +++ b/lib/pages/things_page/widget/fixed_evaluate_page.dart @@ -1,15 +1,17 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_rating_bar/flutter_rating_bar.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/manage/fix_report/fix_detail_model.dart'; import 'package:aku_new_community/pages/manager_func.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_rating_bar/flutter_rating_bar.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class FixedEvaluatePage extends StatefulWidget { final FixDetailModel model; diff --git a/lib/pages/visitor_access_page/visitor_access_page.dart b/lib/pages/visitor_access_page/visitor_access_page.dart index 6f796b50..28a17eda 100644 --- a/lib/pages/visitor_access_page/visitor_access_page.dart +++ b/lib/pages/visitor_access_page/visitor_access_page.dart @@ -1,4 +1,15 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_icons/flutter_icons.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; +import 'package:share/share.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/pages/manager_func.dart'; import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/provider/user_provider.dart'; @@ -9,14 +20,6 @@ import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/common_input.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_icons/flutter_icons.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; -import 'package:share/share.dart'; -import 'package:velocity_x/velocity_x.dart'; class VisitorAccessPage extends StatefulWidget { VisitorAccessPage({Key? key}) : super(key: key); diff --git a/lib/painters/as_numberic_painter.dart b/lib/painters/as_numberic_painter.dart index 62d72b65..0edfa95b 100644 --- a/lib/painters/as_numberic_painter.dart +++ b/lib/painters/as_numberic_painter.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class ASNUmericPainter extends CustomPainter { diff --git a/lib/painters/contact_manager_painter.dart b/lib/painters/contact_manager_painter.dart index c3b0b862..6f4187f1 100644 --- a/lib/painters/contact_manager_painter.dart +++ b/lib/painters/contact_manager_painter.dart @@ -1,6 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class ContactManagerPainter extends CustomPainter { diff --git a/lib/painters/plus_painter.dart b/lib/painters/plus_painter.dart index c7cd7de3..0ae382a6 100644 --- a/lib/painters/plus_painter.dart +++ b/lib/painters/plus_painter.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class PlusPainter extends CustomPainter { diff --git a/lib/painters/progress_bar_painter.dart b/lib/painters/progress_bar_painter.dart index 3841edfe..b953098d 100644 --- a/lib/painters/progress_bar_painter.dart +++ b/lib/painters/progress_bar_painter.dart @@ -1,6 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class ProgressBarPainter extends CustomPainter { diff --git a/lib/painters/upload_painter.dart b/lib/painters/upload_painter.dart index 5aa91341..09c231dd 100644 --- a/lib/painters/upload_painter.dart +++ b/lib/painters/upload_painter.dart @@ -1,6 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class UploadPainter extends CustomPainter { diff --git a/lib/painters/user_bottom_bar_painter.dart b/lib/painters/user_bottom_bar_painter.dart index fe8ed6ae..97366dfc 100644 --- a/lib/painters/user_bottom_bar_painter.dart +++ b/lib/painters/user_bottom_bar_painter.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class UserBottomBarPainter extends CustomPainter { diff --git a/lib/provider/app_provider.dart b/lib/provider/app_provider.dart index 8159729e..fbff480e 100644 --- a/lib/provider/app_provider.dart +++ b/lib/provider/app_provider.dart @@ -6,7 +6,6 @@ import 'package:aku_new_community/constants/application_objects.dart'; import 'package:aku_new_community/constants/config.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/real_time_weather_model.dart'; -import 'package:aku_new_community/model/community/hot_topic_model.dart'; import 'package:aku_new_community/model/message/message_center_model.dart'; import 'package:aku_new_community/model/user/adress_model.dart'; import 'package:aku_new_community/model/user/car_parking_model.dart'; @@ -80,17 +79,17 @@ class AppProvider extends ChangeNotifier { notifyListeners(); } } - - List _hotTopicModels = []; - - List get hotTopicModels => _hotTopicModels; - - updateHotTopicModel() async { - BaseModel model = await NetUtil().get(API.community.hotTopic); - _hotTopicModels = - (model.data as List).map((e) => HotTopicModel.fromJson(e)).toList(); - notifyListeners(); - } + // + // List _hotTopicModels = []; + // + // List get hotTopicModels => _hotTopicModels; + // + // updateHotTopicModel() async { + // BaseModel model = await NetUtil().get(API.community.hotTopic); + // _hotTopicModels = + // (model.data as List).map((e) => HotTopicModel.fromJson(e)).toList(); + // notifyListeners(); + // } RealTimeWeatherModel? _weatherModel; diff --git a/lib/provider/data_provider.dart b/lib/provider/data_provider.dart index 5305b129..aa97ca98 100644 --- a/lib/provider/data_provider.dart +++ b/lib/provider/data_provider.dart @@ -1,10 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/login/china_region_model.dart'; import 'package:aku_new_community/models/login/history_login_model.dart'; import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:flutter/material.dart'; class DataProvider extends ChangeNotifier { Future init() async { diff --git a/lib/ui/common/qr_scan.dart b/lib/ui/common/qr_scan.dart index 2ef5fdc1..71e3c7b2 100644 --- a/lib/ui/common/qr_scan.dart +++ b/lib/ui/common/qr_scan.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:get/get.dart'; import 'package:qr_code_scanner/qr_code_scanner.dart'; diff --git a/lib/ui/community/activity/activity_card.dart b/lib/ui/community/activity/activity_card.dart index 6ef6cdac..6b321eae 100644 --- a/lib/ui/community/activity/activity_card.dart +++ b/lib/ui/community/activity/activity_card.dart @@ -1,13 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/community/activity_item_model.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; - import 'activity_detail_page_old.dart'; class ActivityCard extends StatelessWidget { @@ -43,7 +45,7 @@ class ActivityCard extends StatelessWidget { color: Colors.grey, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model!.imgUrls)), + image: SARSAPI.image(ImgModel.first(model!.imgUrls)), height: 197.w, width: double.infinity, fit: BoxFit.cover, diff --git a/lib/ui/community/activity/activity_detail_page.dart b/lib/ui/community/activity/activity_detail_page.dart index ca95881b..8869e66f 100644 --- a/lib/ui/community/activity/activity_detail_page.dart +++ b/lib/ui/community/activity/activity_detail_page.dart @@ -1,15 +1,17 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/stack_avatar.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class ActivityDetailPage extends StatefulWidget { const ActivityDetailPage({Key? key}) : super(key: key); diff --git a/lib/ui/community/activity/activity_detail_page_old.dart b/lib/ui/community/activity/activity_detail_page_old.dart index 87ed370d..a58db53d 100644 --- a/lib/ui/community/activity/activity_detail_page_old.dart +++ b/lib/ui/community/activity/activity_detail_page_old.dart @@ -1,6 +1,16 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:shimmer/shimmer.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/community/activity_detail_model.dart'; import 'package:aku_new_community/ui/community/activity/activity_people_list_page.dart'; @@ -10,13 +20,6 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/stack_avatar.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:shimmer/shimmer.dart'; @Deprecated('旧页面 酌情删除') class ActivityDetailPage extends StatefulWidget { @@ -132,7 +135,7 @@ class _ActivityDetailPageState extends State { clipBehavior: Clip.antiAlias, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(e.url), + image: SARSAPI.image(e.url), fit: BoxFit.cover, ), ), diff --git a/lib/ui/community/activity/activity_list_page.dart b/lib/ui/community/activity/activity_list_page.dart index 74047bf7..f6ab6704 100644 --- a/lib/ui/community/activity/activity_list_page.dart +++ b/lib/ui/community/activity/activity_list_page.dart @@ -1,13 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/community/activity_item_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/community/activity/activity_card.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; - import 'activity_detail_page_old.dart'; class ActivityListPage extends StatefulWidget { @@ -41,7 +43,7 @@ class _ActivityListPageState extends State { controller: _refreshController, path: API.community.activityList, convert: (model) => - model.tableList!.map((e) => ActivityItemModel.fromJson(e)).toList(), + model.rows.map((e) => ActivityItemModel.fromJson(e)).toList(), builder: (items) { return ListView.separated( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w), diff --git a/lib/ui/community/activity/activity_people_list_page.dart b/lib/ui/community/activity/activity_people_list_page.dart index 775c8b4a..0588dce6 100644 --- a/lib/ui/community/activity/activity_people_list_page.dart +++ b/lib/ui/community/activity/activity_people_list_page.dart @@ -1,12 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/community/activity_people_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; class ActivityPeopleListPage extends StatefulWidget { final int? id; @@ -34,9 +37,8 @@ class _ActivityPeopleListPageState extends State { controller: _refreshController, path: API.community.activityPeopleList, extraParams: {'activityId': widget.id}, - convert: (model) => model.tableList! - .map((e) => ActivityPeopleModel.fromJson(e)) - .toList(), + convert: (model) => + model.rows.map((e) => ActivityPeopleModel.fromJson(e)).toList(), builder: (items) { return ListView.separated( padding: EdgeInsets.all(32.w), @@ -48,7 +50,7 @@ class _ActivityPeopleListPageState extends State { 20.wb, FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrl)), + image: SARSAPI.image(ImgModel.first(model.imgUrl)), height: 60.w, width: 60.w, ), diff --git a/lib/ui/community/community_func.dart b/lib/ui/community/community_func.dart index d86055ce..3a73f883 100644 --- a/lib/ui/community/community_func.dart +++ b/lib/ui/community/community_func.dart @@ -2,11 +2,11 @@ import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/community/activity_item_model.dart'; import 'package:aku_new_community/model/community/board_model.dart'; -import 'package:aku_new_community/model/community/community_topic_model.dart'; import 'package:aku_new_community/model/community/hot_news_model.dart'; import 'package:aku_new_community/model/community/my_event_item_model.dart'; import 'package:aku_new_community/model/community/swiper_model.dart'; import 'package:aku_new_community/model/good/market_swiper_model.dart'; +import 'package:aku_new_community/models/community/topic_model.dart'; import 'package:aku_new_community/models/market/goods_popular_model.dart'; import 'package:aku_new_community/models/market/market_all_category_model.dart'; import 'package:aku_new_community/models/market/market_category_model.dart'; @@ -18,15 +18,13 @@ import 'package:bot_toast/bot_toast.dart'; class CommunityFunc { ///查询热门话题 - static Future> getListGambit() async { - BaseListModel model = await NetUtil().getList( - API.community.listGambit, - params: {'pageNum': 1, 'size': 8}, + static Future> getListGambit() async { + var model = await NetUtil().get( + SARSAPI.community.topNewList, + params: {'hotShowNum': 3, 'showNum': 3}, ); - if (model.tableList!.length == 0) return []; - return model.tableList! - .map((e) => CommunityTopicModel.fromJson(e)) - .toList(); + if ((model.data as List).length == 0) return []; + return (model.data as List).map((e) => TopicModel.fromJson(e)).toList(); } ///我的动态 @@ -35,8 +33,8 @@ class CommunityFunc { API.community.myEvent, params: {'pageNum': 1, 'size': 8}, ); - if (model.tableList!.length == 0) return []; - return model.tableList!.map((e) => MyEventItemModel.fromJson(e)).toList(); + if (model.rows.length == 0) return []; + return model.rows.map((e) => MyEventItemModel.fromJson(e)).toList(); } ///查询热门资讯 @@ -45,8 +43,8 @@ class CommunityFunc { API.community.findHotNews, params: {'pageNum': 1, 'size': 4}, ); - if (model.tableList!.length == 0) return []; - return model.tableList!.map((e) => HotNewsModel.fromJson(e)).toList(); + if (model.rows.length == 0) return []; + return model.rows.map((e) => HotNewsModel.fromJson(e)).toList(); } ///给单个资讯增加浏览量 @@ -81,10 +79,8 @@ class CommunityFunc { SARSAPI.market.category.category, params: {'pageNum': 1, 'size': 9, 'parentId': parentId}, ); - if (model.tableList!.length == 0) return []; - return model.tableList! - .map((e) => MarketCategoryModel.fromJson(e)) - .toList(); + if (model.rows.length == 0) return []; + return model.rows.map((e) => MarketCategoryModel.fromJson(e)).toList(); } ///查询爆款推荐 @@ -129,8 +125,8 @@ class CommunityFunc { API.community.activityList, params: {'pageNum': 1, 'size': 5}, ); - if (model.tableList!.length == 0) return null; - return ActivityItemModel.fromJson(model.tableList!.first); + if (model.rows.length == 0) return null; + return ActivityItemModel.fromJson(model.rows.first); } static Future> activityList() async { @@ -138,8 +134,8 @@ class CommunityFunc { API.community.activityList, params: {'pageNum': 1, 'size': 5}, ); - if (model.tableList!.length == 0) return []; - return model.tableList!.map((e) => ActivityItemModel.fromJson(e)).toList(); + if (model.rows.length == 0) return []; + return model.rows.map((e) => ActivityItemModel.fromJson(e)).toList(); } static Future> board() async { @@ -147,8 +143,8 @@ class CommunityFunc { API.community.boardList, params: {'pageNum': 1, 'size': 5}, ); - if (model.tableList!.length == 0) return []; - return model.tableList!.map((e) => BoardItemModel.fromJson(e)).toList(); + if (model.rows.length == 0) return []; + return model.rows.map((e) => BoardItemModel.fromJson(e)).toList(); } static Future> swiper() async { diff --git a/lib/ui/community/community_views/add_new_event_page.dart b/lib/ui/community/community_views/add_new_event_page.dart index c02f3b61..7d3cd2ab 100644 --- a/lib/ui/community/community_views/add_new_event_page.dart +++ b/lib/ui/community/community_views/add_new_event_page.dart @@ -1,18 +1,19 @@ import 'dart:io'; import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/model/community/hot_topic_model.dart'; -import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/models/community/all_dynamic_list_model.dart'; +import 'package:aku_new_community/models/community/topic_list_model.dart'; +import 'package:aku_new_community/ui/community/community_views/topic/topic_search_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/picker/grid_image_picker.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; class AddNewEventPage extends StatefulWidget { @@ -36,34 +37,40 @@ class AddNewEventPage extends StatefulWidget { class _AddNewEventPageState extends State { bool _commentable = true; + bool _public = true; List _files = []; TextEditingController _textEditingController = TextEditingController(); - HotTopicModel? _hotTopicModel; + List _hotTopicModels = []; ///发表动态 _addEvent() async { + if (_textEditingController.text.isEmpty && _files.isEmpty) { + BotToast.showText(text: '请填写内容'); + return; + } VoidCallback cancel = BotToast.showLoading(); final String content = _textEditingController.text; List? imgs; + print(_files.length); if (_files.isNotEmpty) { - imgs = await NetUtil().uploadFiles(_files, API.upload.uploadEvent); + imgs = await NetUtil().uploadFiles(_files, SARSAPI.uploadFile.uploadImg); } Map params = { 'content': content, 'isComment': _commentable ? 1 : 0, - 'isPublic': 1, + 'isPublic': _public ? 1 : 0, 'imgUrls': imgs, }; if (widget.initTopic != null) { - params.putIfAbsent('gambitId', () => widget.initTopic); + params.putIfAbsent('topicIds', () => [widget.initTopic]); } else { params.putIfAbsent( - 'gambitId', () => _hotTopicModel == null ? -1 : _hotTopicModel!.id); + 'topicIds', () => _hotTopicModels.map((e) => e.id).toList()); } BaseModel baseModel = await NetUtil().post( - API.community.addEvent, + SARSAPI.community.dynamicInsert, params: params, showMessage: true, ); @@ -73,145 +80,178 @@ class _AddNewEventPageState extends State { } } - _buildSelectable() { - return MaterialButton( - onPressed: () { - setState(() { - _commentable = !_commentable; - }); - }, - height: 96.w, + _buildSelectable({ + required String text, + required bool value, + required Function(bool) onChange, + }) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), child: Row( children: [ - Icon( - CupertinoIcons.bubble_left, - size: 32.w, - ), - 8.wb, - '不可评论'.text.size(28.sp).make(), + text.text.size(28.sp).make(), Spacer(), - AnimatedOpacity( - opacity: _commentable ? 0 : 1, - duration: Duration(milliseconds: 300), - curve: Curves.easeInOutCubic, - child: Icon( - Icons.check_rounded, - color: Colors.black, - size: 40.w, - ), - ), + CupertinoSwitch(value: value, onChanged: onChange) ], ), ); } - _pickTopic() { - final appProvider = Provider.of(context); - return Wrap( - direction: Axis.horizontal, - spacing: 4.w, - runSpacing: 4.w, - children: [ - '选择话题:'.text.black.size(34.sp).make(), - ...appProvider.hotTopicModels - .map((e) => _renderTopic(e)) - .toList() - .sepWidget(separate: 20.wb), - ], - ); - } - - Widget _renderTopic(HotTopicModel model) { - bool sameModel = model.id == (_hotTopicModel?.id ?? -1); - return MaterialButton( - elevation: 0, - color: sameModel ? kPrimaryColor : Colors.white, - onPressed: () { - _hotTopicModel = model; - setState(() {}); - }, - child: model.name!.text.size(34.sp).black.make(), - shape: StadiumBorder( - side: BorderSide( - color: Color(0xFF999999), - width: 1.w, - ), - ), - ); - } - @override void initState() { super.initState(); - final appProvider = Provider.of(context, listen: false); - appProvider.updateHotTopicModel(); } @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - backgroundColor: Colors.white, - elevation: 0, - // leading: MaterialButton( - // padding: EdgeInsets.zero, - // onPressed: Get.back, - // child: '取消'.text.size(34.sp).make(), - // ), - leadingWidth: 108.w, - centerTitle: true, - title: '社区'.text.make(), - actions: [ - Hero( - tag: 'event_add', - child: MaterialButton( - elevation: 0, - minWidth: 116.w, - padding: EdgeInsets.zero, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(4.w), - ), - color: kPrimaryColor, - onPressed: _addEvent, - child: '发表'.text.size(34.sp).make(), - ).centered(), - ), - 32.wb, - ], - ), + return BeeScaffold( + title: '', + bodyColor: Color(0xFFF9F9F9), + actions: [ + Hero( + tag: 'event_add', + child: MaterialButton( + elevation: 0, + minWidth: 116.w, + padding: EdgeInsets.zero, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4.w), + ), + color: kPrimaryColor, + onPressed: _addEvent, + child: '发表'.text.size(34.sp).make(), + ).centered(), + ), + 32.wb, + ], body: ListView( - padding: EdgeInsets.symmetric(horizontal: 64.w, vertical: 32.w), + // padding: EdgeInsets.symmetric(horizontal: 64.w, vertical: 32.w), children: [ - TextField( - minLines: 3, - maxLines: 99, - controller: _textEditingController, - decoration: InputDecoration( - contentPadding: EdgeInsets.zero, - border: InputBorder.none, - hintText: '这一刻的想法', - hintStyle: TextStyle( - color: Color(0xFF999999), - fontSize: 34.sp, - ), + 16.w.heightBox, + Container( + padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w), + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextField( + minLines: 3, + maxLines: 99, + controller: _textEditingController, + decoration: InputDecoration( + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + hintText: '分享我的动态', + hintStyle: TextStyle( + color: Color(0xFF999999), + fontSize: 34.sp, + ), + ), + ), + GridImagePicker(onChange: (files) => _files = files), + 64.hb, + Row( + children: [ + GestureDetector( + onTap: () async { + var res = await Get.to(() => TopicSearchPage()); + _hotTopicModels.add(res as TopicListModel); + setState(() {}); + }, + child: Container( + padding: EdgeInsets.symmetric( + vertical: 8.w, horizontal: 24.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25.w), + border: Border.all( + width: 2.w, + color: Color(0xFF000000).withOpacity(0.25))), + child: '# ' + .richText + .withTextSpanChildren([ + '添加话题' + .textSpan + .size(24.sp) + .color(Colors.black.withOpacity(0.85)) + .make() + ]) + .size(24.sp) + .color(Color(0xFFFAC058)) + .make(), + ), + ), + Spacer(), + ], + ), + if (_hotTopicModels.isNotEmpty) 24.w.heightBox, + TopicWidgets(hotTopicModels: _hotTopicModels), + ], ), ), - GridImagePicker(onChange: (files) => _files = files), - 100.hb, - Divider(height: 1.w), - _buildSelectable(), - Divider(height: 1.w), - 28.hb, - if (widget.initTopic == null) _pickTopic(), - if (widget.initTopic != null) - Align( - alignment: Alignment.centerLeft, - child: _renderTopic( - HotTopicModel(name: widget.topicName, id: widget.initTopic), - ), + 16.w.heightBox, + Container( + color: Colors.white, + child: Column( + children: [ + _buildSelectable( + value: _commentable, + text: '其他人可评论', + onChange: (value) { + _commentable = value; + setState(() {}); + }), + Divider(height: 1.w), + _buildSelectable( + value: _public, + text: '是否公开', + onChange: (value) { + _public = value; + setState(() {}); + }), + ], ), + ), ], - ).material(color: Colors.white), + ), + ); + } +} + +class TopicWidgets extends StatelessWidget { + const TopicWidgets({ + Key? key, + this.hotTopicModels, + this.topicTags, + }) : assert(hotTopicModels != null || topicTags != null), + super(key: key); + + final List? hotTopicModels; + final List? topicTags; + List get models => + hotTopicModels == null ? topicTags! : hotTopicModels!; + @override + Widget build(BuildContext context) { + return Wrap( + alignment: WrapAlignment.start, + spacing: 24.w, + runSpacing: 12.w, + crossAxisAlignment: WrapCrossAlignment.start, + children: [ + ...models + .map((e) => Container( + padding: + EdgeInsets.symmetric(vertical: 8.w, horizontal: 16.w), + decoration: BoxDecoration( + color: Color(0xFFF4F7FC).withOpacity(0.8), + borderRadius: BorderRadius.circular(25.w)), + child: '# ${e.title}' + .text + .size(24.sp) + .color(Color(0xFF547FC0)) + .make(), + )) + .toList(), + ], ); } } diff --git a/lib/ui/community/community_views/community_page.dart b/lib/ui/community/community_views/community_page.dart index 66fa9f15..5a2adade 100644 --- a/lib/ui/community/community_views/community_page.dart +++ b/lib/ui/community/community_views/community_page.dart @@ -2,10 +2,11 @@ import 'dart:math'; import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:aku_new_community/model/community/community_topic_model.dart'; -import 'package:aku_new_community/model/community/event_item_model.dart'; import 'package:aku_new_community/model/community/hot_news_model.dart'; +import 'package:aku_new_community/models/community/all_dynamic_list_model.dart'; +import 'package:aku_new_community/models/community/topic_model.dart'; import 'package:aku_new_community/models/news/news_category_model.dart'; import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/provider/user_provider.dart'; @@ -14,7 +15,6 @@ import 'package:aku_new_community/ui/community/community_views/add_new_event_pag import 'package:aku_new_community/ui/community/community_views/my_community_view.dart'; import 'package:aku_new_community/ui/community/community_views/new_community_view.dart'; import 'package:aku_new_community/ui/community/community_views/topic/topic_community_view.dart'; -import 'package:aku_new_community/ui/community/community_views/topic/topic_detail_page.dart'; import 'package:aku_new_community/ui/community/community_views/widgets/chat_card.dart'; import 'package:aku_new_community/ui/home/public_infomation/public_infomation_page.dart'; import 'package:aku_new_community/ui/home/public_infomation/public_information_detail_page.dart'; @@ -23,6 +23,7 @@ import 'package:aku_new_community/utils/login_util.dart'; import 'package:aku_new_community/utils/network/base_list_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -47,13 +48,12 @@ class _CommunityPageState extends State GlobalKey myKey = GlobalKey(); GlobalKey newKey = GlobalKey(); - List _newItems = []; - List _gambitModels = []; + List _newItems = []; + List _gambitModels = []; List _hotNewsModels = []; int _pageNum = 1; int _size = 4; - int _pageCount = 0; bool _onload = true; @override @@ -108,17 +108,6 @@ class _CommunityPageState extends State isScrollable: true, ), )), - // Row(crossAxisAlignment: CrossAxisAlignment.center, children: [ - // Text( - // '附近社区', - // style: TextStyle( - // fontWeight: FontWeight.bold, - // fontSize: 32.sp, - // color: Color(0xff333333), - // ), - // textAlign: TextAlign.center, - // ), - // ]), backgroundColor: Colors.white, actions: [ Padding( @@ -144,133 +133,57 @@ class _CommunityPageState extends State ), ) ], - // bottom: _tabController!.index==0?PreferredSize( - // preferredSize: Size.fromHeight(90.w), child: _geSearch()): - // PreferredSize( - // preferredSize: Size.fromHeight(311.w), child: Container( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Image.asset(R.ASSETS_ICONS_ICON_LOGISTICS_PNG,width: 132.w,height: 132.w,), - // 32.hb, - // '吼姆拉'.text.size(32.sp).fontWeight(FontWeight.bold).color(Color(0xD9000000)).make(), - // 12.hb, - // '当一个新时代的天之圣杯'.text.size(24.sp).color(Color(0x73000000)).make(), - // - // ], - // ), - // )), ), - body: TabBarView( - children: userProvider.isLogin - ? [ - EasyRefresh( - firstRefresh: true, - header: MaterialHeader(), - controller: _easyRefreshController, - onRefresh: () async { - await (getNewInfo()); - _gambitModels = await CommunityFunc.getListGambit(); - _hotNewsModels = await CommunityFunc.getHotNews(); - _onload = false; - setState(() {}); - }, - child: _onload - ? SizedBox() - : ListView( - children: [ - _geSearch(), - 2.hb, - _hotNewsModels.isEmpty ? SizedBox() : _getInfo(), - 16.hb, - _gambitModels.isEmpty ? SizedBox() : _getNews(), - 16.hb, - ..._newItems - .map((e) => ChatCard( - model: e, - onDelete: () { - _easyRefreshController.callRefresh(); - setState(() {}); - })) - .toList() - ], - ), - ), - MyCommunityView(key: myKey), - ] - : [ - EasyRefresh( - firstRefresh: true, - header: MaterialHeader(), - controller: _easyRefreshController, - onRefresh: () async { - await (getNewInfo()); - _gambitModels = await CommunityFunc.getListGambit(); - _hotNewsModels = await CommunityFunc.getHotNews(); - _onload = false; - setState(() {}); - }, - child: _onload - ? SizedBox() - : ListView( - children: [ - _geSearch(), - 2.hb, - _hotNewsModels.isEmpty ? SizedBox() : _getInfo(), - 16.hb, - _gambitModels.isEmpty ? SizedBox() : _getNews(), - 16.hb, - ..._newItems - .map((e) => ChatCard( - model: e, - onDelete: () { - _easyRefreshController.callRefresh(); - setState(() {}); - })) - .toList() - ], - ), - ), - ], + children: [ + EasyRefresh( + firstRefresh: true, + header: MaterialHeader(), + controller: _easyRefreshController, + onRefresh: () async { + await (getNewInfo()); + _gambitModels = await CommunityFunc.getListGambit(); + _hotNewsModels = await CommunityFunc.getHotNews(); + _onload = false; + setState(() {}); + }, + child: _onload + ? SizedBox() + : ListView( + children: [ + _geSearch(), + 2.hb, + _hotNewsModels.isEmpty ? SizedBox() : _getInfo(), + 16.hb, + _gambitModels.isEmpty ? SizedBox() : _getNews(), + 16.hb, + ..._newItems + .map((e) => ChatCard( + model: e, + onDelete: () { + _easyRefreshController.callRefresh(); + setState(() {}); + })) + .toList() + ], + ), + ), + if (UserTool.userProvider.isLogin) MyCommunityView(key: myKey), + ], controller: _tabController, ), - - // ListView( - // children: [ - - // ], - // ) - - // TabBarView( - // children: userProvider.isLogin - // ? [ - // NewCommunityView(key: newKey), - // TopicCommunityView(key: topicKey), - // MyCommunityView(key: myKey), - // ] - // : [ - // NewCommunityView(key: newKey), - // TopicCommunityView(key: topicKey), - // ], - // controller: _tabController, - // ), - // bodyColor: Colors.white, ); } Future getNewInfo() async { - BaseListModel baseListModel = - await NetUtil().getList(API.community.newEventList, params: { - "pageNum": _pageNum, - "size": _size, - }); - if (baseListModel.tableList!.isNotEmpty) { - _newItems = (baseListModel.tableList as List) - .map((e) => EventItemModel.fromJson(e)) + BaseListModel baseListModel = await NetUtil().getList( + SARSAPI.community.dynamicList, + params: {"pageNum": _pageNum, "size": _size, 'type': 1}); + if (baseListModel.rows.isNotEmpty) { + _newItems = (baseListModel.rows) + .map((e) => AllDynamicListModel.fromJson(e)) .toList(); } - _pageCount = baseListModel.pageCount!; } Future loadNewInfo() async { @@ -279,14 +192,14 @@ class _CommunityPageState extends State "pageNum": _pageNum, "size": _size, }); - if (baseListModel.tableList!.isNotEmpty) { - _newItems.addAll((baseListModel.tableList as List) - .map((e) => EventItemModel.fromJson(e)) + if (baseListModel.rows.isNotEmpty) { + _newItems.addAll((baseListModel.rows) + .map((e) => AllDynamicListModel.fromJson(e)) .toList()); } - _pageCount = baseListModel.pageCount!; } + ///热门资讯 _getInfo() { return Container( color: Colors.white, @@ -375,7 +288,6 @@ class _CommunityPageState extends State onTap: () async { var result = await Get.to(() => PublicInformationDetailPage(id: item.id!)); - CommunityFunc.addViews(item.id!); if (result) { _easyRefreshController.callRefresh(); @@ -393,7 +305,7 @@ class _CommunityPageState extends State ), image: DecorationImage( image: NetworkImage( - API.image(ImgModel.first(item.imgList)), + SARSAPI.image(ImgModel.first(item.imgList)), ), fit: BoxFit.cover, ), @@ -519,16 +431,12 @@ class _CommunityPageState extends State _searchHistoryWidget() { return Container( - //margin: EdgeInsets.symmetric(horizontal: 32.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - //width: MediaQuery.of(context).size.width, - //padding: EdgeInsets.only(left: 10, right: 10), - child: Wrap(children: [ - ..._gambitModels.map((e) => _choiceChip(e, 0)).toList() - ] + child: Wrap( + children: [..._gambitModels.map((e) => _choiceChip(e)).toList()] // [_choiceChip('EDG夺冠',1),_choiceChip('双十一',2), // _choiceChip('11月吃土',2),_choiceChip('成都疫情',0),_choiceChip('万圣节',0)], ), @@ -539,7 +447,7 @@ class _CommunityPageState extends State ); } - _choiceChip(CommunityTopicModel item, int type) { + _choiceChip(TopicModel item) { return Padding( padding: EdgeInsets.only(right: 12.w, bottom: 24.w), child: ChoiceChip( @@ -550,20 +458,20 @@ class _CommunityPageState extends State labelPadding: EdgeInsets.only(right: 12.w, left: 12.w), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onSelected: (bool value) { - Get.to(() => TopicDetailPage(model: item)); + // Get.to(() => TopicDetailPage(model: item)); }, label: Row( mainAxisSize: MainAxisSize.min, children: [ Text( - '# ${item.summary ?? ''}', + '# ${item.title}', style: TextStyle( color: Colors.black.withOpacity(0.65), fontSize: 28.sp, fontWeight: FontWeight.w500), ), - type == 1 || type == 2 ? 8.wb : SizedBox(), - type == 1 || type == 2 ? _chipType(type) : SizedBox() + item.type != 1 ? 8.wb : SizedBox(), + item.type != 1 ? _chipType(item.type) : SizedBox() ], ), selected: false, diff --git a/lib/ui/community/community_views/event_detail_page.dart b/lib/ui/community/community_views/event_detail_page.dart index 80b6aca5..dba33411 100644 --- a/lib/ui/community/community_views/event_detail_page.dart +++ b/lib/ui/community/community_views/event_detail_page.dart @@ -1,32 +1,36 @@ import 'dart:math'; +import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/model/community/event_item_model.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:aku_new_community/models/community/comment_list_model.dart'; +import 'package:aku_new_community/models/community/dynamic_detail_model.dart'; import 'package:aku_new_community/provider/user_provider.dart'; +import 'package:aku_new_community/ui/community/community_views/widgets/chat_card.dart'; import 'package:aku_new_community/ui/community/community_views/widgets/chat_card_detail.dart'; -import 'package:aku_new_community/ui/community/community_views/widgets/send_a_chat.dart'; +import 'package:aku_new_community/utils/bee_date_util.dart'; +import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/login_util.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/cupertino.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; class EventDetailPage extends StatefulWidget { - final int? themeId; - final EventItemModel eventItemModel; + final int dynamicId; final VoidCallback? onDelete; EventDetailPage({ Key? key, - required this.themeId, - required this.eventItemModel, this.onDelete, + required this.dynamicId, + this.onDelete, }) : super(key: key); @override @@ -35,44 +39,64 @@ class EventDetailPage extends StatefulWidget { class _EventDetailPageState extends State { EasyRefreshController _refreshController = EasyRefreshController(); - EventItemModel? _model; + DynamicDetailModel? _model; bool get _isMyself { final userProvider = Provider.of(context, listen: false); - return (userProvider.userInfoModel?.id ?? -1) == - widget.eventItemModel.createId; + return (userProvider.userInfoModel?.id ?? -1) == widget.dynamicId; + } + + TextEditingController _textEditingController = TextEditingController(); + int rootId = 0; + int parentId = 0; + + int _page = 1; + int _type = 1; + int _size = 10; + List _comments = []; + + //评论输入框焦点 + FocusNode _focusNode = FocusNode(); + + Map get params => { + 'rootId': rootId, + 'parentId': parentId, + 'dynamicId': widget.dynamicId, + 'content': _textEditingController.text + }; + + Future updateComments() async { + var base = await NetUtil().getList(SARSAPI.community.commentList, params: { + 'pageNum': _page, + 'size': _size, + 'dynamicId': widget.dynamicId, + 'type': _type, + }); + _comments.replaceRange((_page - 1) * _size, _page * _size, + base.rows.map((e) => CommentListModel.fromJson(e)).toList()); + setState(() {}); } @override void initState() { - // TODO: implement initState - super.initState(); } + @override + void dispose() { + _textEditingController.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { return BeeScaffold( title: '详情', bottomNavi: _bottomButton(), actions: [ - PopupMenuButton( - shape: - RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)), - itemBuilder: (context) { - return [ - _isMyself - ? PopupMenuItem( - child: '删除'.text.isIntrinsic.make(), - value: 0, - ) - : PopupMenuItem( - child: '举报'.text.isIntrinsic.make(), - value: 0, - ), - ]; - }, - onSelected: (dynamic _) async { + (CommunityPopButton( + isMyself: _isMyself, + onSelect: (dynamic _) async { if (LoginUtil.isNotLogin) return; if (!_isMyself) { VoidCallback cancel = BotToast.showLoading(); @@ -98,7 +122,7 @@ class _EventDetailPageState extends State { if (result == true) { await NetUtil().get( API.community.deleteMyEvent, - params: {'themeId': widget.themeId}, + params: {'dynamicId': widget.dynamicId}, showMessage: true, ); if (widget.onDelete != null) { @@ -108,142 +132,354 @@ class _EventDetailPageState extends State { } } }, - child: Container( - width: 40.w, - height: 32.w, - alignment: Alignment.center, - child: Image.asset( - R.ASSETS_ICONS_ICON_MORE_BLACK_PNG, - width: 40.w, - height: 32.w, - fit: BoxFit.fitHeight, - )), - ).paddingOnly(right: 32.w), + )).paddingOnly(right: 32.w), ], - body: EasyRefresh( + body: EasyRefresh.custom( controller: _refreshController, header: MaterialHeader(), firstRefresh: true, onRefresh: () async { BaseModel model = await NetUtil().get( - API.community.getEventDetail, - params: {'themeId': widget.themeId}, + SARSAPI.community.dynamicDetail, + params: {'dynamicId': widget.dynamicId}, ); - _model = EventItemModel.fromJson(model.data); + _model = DynamicDetailModel.fromJson(model.data); + _page = 1; + + var base = + await NetUtil().getList(SARSAPI.community.commentList, params: { + 'pageNum': _page, + 'size': _size, + 'dynamicId': widget.dynamicId, + 'type': _type, + }); + _comments = + base.rows.map((e) => CommentListModel.fromJson(e)).toList(); setState(() {}); }, - child: _model == null - ? SizedBox() - : ListView( - children: [ - ChatCardDetail( - model: _model, - hideLine: true, - canTap: false, + onLoad: () async { + _page++; + var base = + await NetUtil().getList(SARSAPI.community.commentList, params: { + 'pageNum': _page, + 'size': _size, + 'dynamicId': widget.dynamicId, + 'type': _type, + }); + if (_comments.length < base.total) { + _comments.addAll( + base.rows.map((e) => CommentListModel.fromJson(e)).toList()); + } + setState(() {}); + }, + slivers: _model == null + ? [] + : [ + SliverToBoxAdapter( + child: Column( + children: [ + ChatCardDetail( + model: _model!, + hideLine: true, + canTap: false, + ), + _renderLikeAndCommentWidget(), + ], ), - ], - ), + ), + SliverList( + delegate: SliverChildListDelegate( + _comments.map((e) => _commentWidget(e)).toList())) + ], ), ); } - _bottomButton() { - final userProvider = Provider.of(context); + _renderLikeAndCommentWidget() { return Container( - width: double.infinity, - height: 100.w, - decoration: BoxDecoration(color: Colors.white, boxShadow: [ - BoxShadow( - color: Color(0x4D000000), - offset: Offset(0.0, -1), //阴影xy轴偏移量 - blurRadius: 0, //阴影模糊程度 - spreadRadius: 0 //阴影扩散程度 - ) - ] - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: GestureDetector( - onTap: (){ - if (widget.eventItemModel.isComment == 1) - SendAChat.send( - parentId: 0, - themeId: widget.eventItemModel.id, - ); - else - BotToast.showText(text: '不可评论'); + padding: EdgeInsets.only(top: 22.w, bottom: 22.w), + color: Colors.white, + child: Column( + children: [ + Row( + children: [ + 32.wb, + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ('评论 ' + '${_model!.commentNum}') + .text + .size(28.sp) + .black + .make(), + 8.hb, + Container( + width: 64.w, + height: 4.w, + color: Color(0xCCFFB634), + ) + ], + ), + Spacer(), + GestureDetector( + onTap: () { + if (_type == 1) { + _type = 2; + } else { + _type = 1; + } + _refreshController.callRefresh(); }, child: Container( - color: Colors.transparent, child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,width: 50.w,height: 50.w,), - //Image.asset(widget.model!.isComment!=1?R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG:R.ASSETS_ICONS_COMMUNITY_COMMENT_IS_PNG,width: 32.w,height: 32.w,), - 5.wb, - '评论' + Image.asset( + R.ASSETS_ICONS_ICON_SORT_PNG, + height: 40.w, + width: 40.w, + ), + 8.wb, + ('${_type == 1 ? '按时间' : '按热度'}') .text - .size(30.sp) - .color(Color(0xFF999999)) + .size(28.sp) + .color(ktextPrimary) .make(), ], ), ), ), - ), + 32.wb, + ], + ), + // _renderLikeAndComment(), + ], + ), + ); + } - Expanded( - child: GestureDetector( - onTap: ()async{ - await NetUtil().get( - API.community.like, - params: {'themeId': widget.eventItemModel.id}, - showMessage: true, + Widget _commentWidget(CommentListModel model) { + return Container( + color: Colors.white, + padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w), + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + [ + Material( + color: Color(0xFFF5F5F5), + borderRadius: BorderRadius.circular(48.w), + clipBehavior: Clip.antiAlias, + child: FadeInImage.assetNetwork( + placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + image: SARSAPI.image(ImgModel.first(model.avatarImgList)), + height: 96.w, + width: 96.w, + fit: BoxFit.cover, + imageErrorBuilder: (context, error, stackTrace) { + return Image.asset( + R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + height: 86.w, + width: 86.w, ); - setState(() { - if (widget.eventItemModel.isLike == 0) { - widget.eventItemModel.likeNames!.add( - LikeNames( - id: Random().nextInt(1000), - name: userProvider.userInfoModel!.nickName, - ), - ); - } else { - widget.eventItemModel.likeNames!.removeWhere( - (element) => - element.name == - userProvider.userInfoModel!.nickName); - } - widget.eventItemModel.isLike = - (widget.eventItemModel.isLike == 1) ? 0 : 1; - }); }, - child: Container( - color: Colors.transparent, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset(widget.eventItemModel.isLike!=1? R.ASSETS_ICONS_COMMUNITY_LIKE_PNG:R.ASSETS_ICONS_COMMUNITY_LIKE_IS_PNG,width: 50.w,height: 50.w,), - 5.wb, - '点赞' - .text - .size(30.sp) - .color(Color(0xFF999999)) - .make(), - ], - ), - ), ), ), + 20.wb, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + model.createName, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.black.withOpacity(0.85), + fontSize: 30.sp, + fontWeight: FontWeight.w500), + ), + 12.hb, + BeeDateUtil(DateUtil.getDateTime(model.createDate)) + .timeAgoWithHm + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make(), + ], + ), + Spacer(), + CommunityPopButton(isMyself: false, onSelect: (value) {}) + ].row(), + 40.hb, + model.content.text.size(28.sp).color(ktextSubColor).make(), + 30.hb, + Row( + children: [ + Spacer(), + Image.asset( + R.ASSETS_ICONS_COMMUNITY_LIKE_PNG, + width: 40.w, + height: 40.w, + ), + 5.wb, + '${model.likes}'.text.size(24.sp).color(Color(0xFF999999)).make(), + 32.wb, + Image.asset( + R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG, + width: 40.w, + height: 40.w, + ), + 5.wb, + '${model.commentNum}' + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make(), + ], + ), + 40.hb, + model.commentTwoList.isEmpty + ? SizedBox.shrink() + : Container( + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.06), + borderRadius: BorderRadius.circular(16.w)), + margin: EdgeInsets.only(left: 125.w), + width: 600.w, + padding: + EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), + child: Column( + children: model.commentTwoList + .map((e) => + _subCommentWidget(e, model.createId, model.id)) + .toList() + .sepWidget(separate: 24.hb), + ), + ), + ], + ), + ); + } - ], - ) - + Widget _subCommentWidget(CommentTwoList model, int createId, int rootId) { + return GestureDetector( + onTap: () { + rootId = rootId; + parentId = model.id; + _focusNode.requestFocus(); + }, + child: RichText( + text: TextSpan( + text: '${model.createName}', + style: TextStyle( + color: Color(0xFF5D98F9), + fontSize: 28.sp, + ), + children: [ + if (rootId == model.createId) + WidgetSpan( + child: Container( + width: 56.w, + height: 28.w, + decoration: BoxDecoration( + color: Color(0xFFF8B133), + borderRadius: BorderRadius.circular(4.w)), + child: Text( + '楼主', + style: TextStyle( + color: Colors.white, + fontSize: 24.sp, + fontWeight: FontWeight.bold), + ), + )), + if (model.parentName != null) + TextSpan( + text: ' 回复 ', + style: TextStyle( + color: Colors.black.withOpacity(0.85), + fontSize: 28.sp, + )), + if (model.parentName != null) + TextSpan( + text: '${model.parentName}', + style: TextStyle( + color: Color(0xFF5D98F9), + fontSize: 28.sp, + ), + ), + TextSpan( + text: ':${model.content}', + style: TextStyle( + color: Colors.black.withOpacity(0.85), + fontSize: 28.sp, + )) + ])), ); } + _bottomButton() { + final userProvider = Provider.of(context); + return Container( + width: double.infinity, + height: 100.w, + padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Expanded( + child: Container( + height: 56.w, + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.06), + borderRadius: BorderRadius.circular(32.w), + ), + child: TextField( + controller: _textEditingController, + focusNode: _focusNode, + decoration: InputDecoration( + hintText: '参与评论', + contentPadding: + EdgeInsets.symmetric(horizontal: 24.w, vertical: 8.w), + isDense: true, + hintStyle: TextStyle( + fontSize: 28.sp, + color: Colors.black.withOpacity(0.25), + ), + border: InputBorder.none), + ), + ), + ), + 24.w.widthBox, + MaterialButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(34.w), + ), + elevation: 0, + color: kPrimaryColor, + minWidth: 120.w, + height: 55.w, + onPressed: () async { + var res = await NetUtil() + .post(SARSAPI.community.commentInsert, params: params); + if (res.success) { + _textEditingController.clear(); + await updateComments(); + setState(() {}); + } else { + BotToast.showText(text: res.msg); + } + }, + child: Text( + '发布', + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 28.sp), + ), + ) + ], + )); + } } diff --git a/lib/ui/community/community_views/my_community_view.dart b/lib/ui/community/community_views/my_community_view.dart index 2483bd6f..417ace07 100644 --- a/lib/ui/community/community_views/my_community_view.dart +++ b/lib/ui/community/community_views/my_community_view.dart @@ -1,20 +1,20 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/main_initialize.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/community/my_event_item_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/community/community_views/widgets/my_event_card.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/login_util.dart'; -import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/line/vertical_line_painter.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; import 'package:aku_new_community/widget/views/bee_grid_image_view.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; - import '../community_func.dart'; class MyCommunityView extends StatefulWidget { @@ -50,86 +50,125 @@ class MyCommunityViewState extends State child: _onload ? SizedBox() : ListView( - children: [ - Container( - width: double.infinity, - decoration: BoxDecoration( - image: new DecorationImage( - image: new AssetImage(R.ASSETS_IMAGES_COMMUNITY_MY_BG_PNG,), - fit: BoxFit.fitWidth - ), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - 12.hb, - Image.asset(R.ASSETS_ICONS_ICON_LOGISTICS_PNG,width: 132.w,height: 132.w,), - 32.hb, - '吼姆拉'.text.size(32.sp).fontWeight(FontWeight.bold).color(Color(0xD9000000)).make(), - 12.hb, - '当一个新时代的天之圣杯'.text.size(24.sp).color(Color(0x73000000)).make(), - 32.hb, - ], - ), - ), - Container( - width: double.infinity, - height: 156.w, - color: Colors.white, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - '111'.text.size(40.sp).fontWeight(FontWeight.bold).color(Color(0xD9000000)).make(), - '动态'.text.size(24.sp).color(Color(0x73000000)).make(), - ], + Container( + width: double.infinity, + decoration: BoxDecoration( + image: new DecorationImage( + image: new AssetImage( + R.ASSETS_IMAGES_COMMUNITY_MY_BG_PNG, + ), + fit: BoxFit.fitWidth), ), - ), - Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, children: [ - '111'.text.size(40.sp).fontWeight(FontWeight.bold).color(Color(0xD9000000)).make(), - '动态'.text.size(24.sp).color(Color(0x73000000)).make(), + 12.hb, + Image.asset( + R.ASSETS_ICONS_ICON_LOGISTICS_PNG, + width: 132.w, + height: 132.w, + ), + 32.hb, + '吼姆拉' + .text + .size(32.sp) + .fontWeight(FontWeight.bold) + .color(Color(0xD9000000)) + .make(), + 12.hb, + '当一个新时代的天之圣杯' + .text + .size(24.sp) + .color(Color(0x73000000)) + .make(), + 32.hb, ], ), ), - Expanded( - child: Column( + Container( + width: double.infinity, + height: 156.w, + color: Colors.white, + child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - '111'.text.size(40.sp).fontWeight(FontWeight.bold).color(Color(0xD9000000)).make(), - '动态'.text.size(24.sp).color(Color(0x73000000)).make(), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + '111' + .text + .size(40.sp) + .fontWeight(FontWeight.bold) + .color(Color(0xD9000000)) + .make(), + '动态' + .text + .size(24.sp) + .color(Color(0x73000000)) + .make(), + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + '111' + .text + .size(40.sp) + .fontWeight(FontWeight.bold) + .color(Color(0xD9000000)) + .make(), + '动态' + .text + .size(24.sp) + .color(Color(0x73000000)) + .make(), + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + '111' + .text + .size(40.sp) + .fontWeight(FontWeight.bold) + .color(Color(0xD9000000)) + .make(), + '动态' + .text + .size(24.sp) + .color(Color(0x73000000)) + .make(), + ], + ), + ), ], ), ), + ..._myEventItems.map( + (e) => _getMoments(e), + ), + + //_getMoments(), + // _getMoments(), ], ), - ), - ..._myEventItems.map((e) => _getMoments(e),), - - //_getMoments(), - // _getMoments(), - - ], - ), ); - - BeeListView( + BeeListView( path: API.community.myEvent, controller: _refreshController, convert: (model) { - return model.tableList! - .map((e) => MyEventItemModel.fromJson(e)) - .toList(); + return model.rows.map((e) => MyEventItemModel.fromJson(e)).toList(); }, builder: (items) { return ListView.separated( @@ -145,115 +184,132 @@ class MyCommunityViewState extends State ); }, ); - } - Widget _getMoments( MyEventItemModel item){ + + Widget _getMoments(MyEventItemModel item) { return Container( - padding: EdgeInsets.only(top: 32.w,left: 25.w,right: 32.w,bottom: 32.w), + padding: + EdgeInsets.only(top: 32.w, left: 25.w, right: 32.w, bottom: 32.w), color: Colors.white, child: CustomPaint( painter: VerticalLinePainter( - color: Color(0x0F000000),//最后一个调整为透明 - width: 4.w,//根据UI调整即可 - paddingTop: 100.w,//根据UI调整即可 - paddingLeft: 0,//根据UI调整即可 - paddingBottom: 100.w),//根据UI - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - '11.15'.text.size(32.sp).color(Color(0xA6000000)).bold.isIntrinsic.make(), - '2021'.text.size(24.sp).color(Color(0x73000000)).bold.isIntrinsic.make(), - ], - ), - 50.wb, - Column( - children: [ - Container( - width: 552.w, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - '25.61'.text.size(28.sp).color(Color(0xA6000000)).isIntrinsic.make(), - - PopupMenuButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.w)), - itemBuilder: (context) { - return [ - PopupMenuItem( - child: '删除'.text.isIntrinsic.make(), - value: 0, - ) - ]; - }, - onSelected: (dynamic _) async { - if (LoginUtil.isNotLogin) return; - bool? result = - await Get.dialog(CupertinoAlertDialog( - title: '你确定删除吗'.text.isIntrinsic.make(), - actions: [ - CupertinoDialogAction( - child: '取消'.text.black.isIntrinsic.make(), - onPressed: () => Get.back(), - ), - CupertinoDialogAction( - child: '确定' - .text - .color(Colors.orange) - .isIntrinsic - .make(), - onPressed: () => Get.back(result: true), - ), - ], - )); - - // if (result == true) { - // await NetUtil().get( - // API.community.deleteMyEvent, - // params: {'themeId': widget.model!.id}, - // showMessage: true, - // ); - // - // } - - + color: Color(0x0F000000), //最后一个调整为透明 + width: 4.w, //根据UI调整即可 + paddingTop: 100.w, //根据UI调整即可 + paddingLeft: 0, //根据UI调整即可 + paddingBottom: 100.w), //根据UI + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '11.15' + .text + .size(32.sp) + .color(Color(0xA6000000)) + .bold + .isIntrinsic + .make(), + '2021' + .text + .size(24.sp) + .color(Color(0x73000000)) + .bold + .isIntrinsic + .make(), + ], + ), + 50.wb, + Column( + children: [ + Container( + width: 552.w, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + '25.61' + .text + .size(28.sp) + .color(Color(0xA6000000)) + .isIntrinsic + .make(), + PopupMenuButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.w)), + itemBuilder: (context) { + return [ + PopupMenuItem( + child: '删除'.text.isIntrinsic.make(), + value: 0, + ) + ]; + }, + onSelected: (dynamic _) async { + if (LoginUtil.isNotLogin) return; + bool? result = await Get.dialog(CupertinoAlertDialog( + title: '你确定删除吗'.text.isIntrinsic.make(), + actions: [ + CupertinoDialogAction( + child: '取消'.text.black.isIntrinsic.make(), + onPressed: () => Get.back(), + ), + CupertinoDialogAction( + child: '确定' + .text + .color(Colors.orange) + .isIntrinsic + .make(), + onPressed: () => Get.back(result: true), + ), + ], + )); - }, - child: Container( + // if (result == true) { + // await NetUtil().get( + // API.community.deleteMyEvent, + // params: {'themeId': widget.model!.id}, + // showMessage: true, + // ); + // + // } + }, + child: Container( + width: 32.w, + height: 32.w, + child: Image.asset( + R.ASSETS_ICONS_ICON_MORE_PNG, width: 32.w, height: 32.w, - child: Image.asset( - R.ASSETS_ICONS_ICON_MORE_PNG, - width: 32.w, - height: 32.w, - fit: BoxFit.fitHeight, - )), - ), - ], - ), + fit: BoxFit.fitHeight, + )), + ), + ], ), - 32.hb, - Container( - width: 552.w, - child: item.content!.text.size(28.sp).color(Color(0xA6000000)).isIntrinsic.black.make(),), - 40.hb, - _renderImage(item) - - ], - ), - ], - ), + ), + 32.hb, + Container( + width: 552.w, + child: item.content!.text + .size(28.sp) + .color(Color(0xA6000000)) + .isIntrinsic + .black + .make(), + ), + 40.hb, + _renderImage(item) + ], + ), + ], ), + ), ); } - _renderImage(MyEventItemModel item) { if (item.imgUrl!.isEmpty) return SizedBox(); if (item.imgUrl!.length == 1) @@ -280,7 +336,7 @@ class MyCommunityViewState extends State tag: ImgModel.first(item.imgUrl), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(item.imgUrl)), + image: SARSAPI.image(ImgModel.first(item.imgUrl)), imageErrorBuilder: (context, error, stackTrace) { return Image.asset( R.ASSETS_IMAGES_PLACEHOLDER_WEBP, @@ -295,9 +351,7 @@ class MyCommunityViewState extends State else return Container( width: 552.w, - - child: BeeGridImageView( - urls: item.imgUrl!.map((e) => e.url).toList()), + child: BeeGridImageView(urls: item.imgUrl!.map((e) => e.url).toList()), ); } diff --git a/lib/ui/community/community_views/new_community_view.dart b/lib/ui/community/community_views/new_community_view.dart index 14cc5a18..f542c5f7 100644 --- a/lib/ui/community/community_views/new_community_view.dart +++ b/lib/ui/community/community_views/new_community_view.dart @@ -1,9 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/model/community/event_item_model.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/models/community/all_dynamic_list_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/community/community_views/widgets/chat_card.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; class NewCommunityView extends StatefulWidget { NewCommunityView({Key? key}) : super(key: key); @@ -30,15 +33,15 @@ class NewCommunityViewState extends State Widget build(BuildContext context) { super.build(context); return BeeListView( - path: API.community.newEventList, + path: SARSAPI.community.dynamicList, controller: _refreshController, convert: (model) { - return model.tableList!.map((e) => EventItemModel.fromJson(e)).toList(); + return model.rows.map((e) => AllDynamicListModel.fromJson(e)).toList(); }, builder: (items) { return ListView.builder( itemBuilder: (context, index) { - final item = items[index] as EventItemModel; + final item = items[index] as AllDynamicListModel; return ChatCard( model: item, onDelete: () { diff --git a/lib/ui/community/community_views/topic/topic_community_view.dart b/lib/ui/community/community_views/topic/topic_community_view.dart index 17b723be..cab08364 100644 --- a/lib/ui/community/community_views/topic/topic_community_view.dart +++ b/lib/ui/community/community_views/topic/topic_community_view.dart @@ -1,12 +1,12 @@ import 'dart:ui'; import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:aku_new_community/model/community/community_topic_model.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/models/community/topic_list_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/community/community_views/topic/topic_detail_page.dart'; import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/beeImageNetwork.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; @@ -22,139 +22,120 @@ class TopicCommunityView extends StatefulWidget { class TopicCommunityViewState extends State { EasyRefreshController _refreshController = EasyRefreshController(); - _buildItem(CommunityTopicModel model, int index) { + _buildItem(TopicListModel model, int index) { return GestureDetector( onTap: () { - Get.to(() => TopicDetailPage(model: model)); + Get.to(() => TopicDetailPage(topicId: model.id)); }, child: Container( padding: EdgeInsets.symmetric(vertical: 20.w, horizontal: 32.w), decoration: BoxDecoration( color: Colors.white, ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, + child: Column( children: [ - Column( + Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - index <= 2 - ? Container( - width: 36.w, - height: 35.w, - clipBehavior: Clip.antiAlias, - alignment: Alignment.center, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(index == 0 - ? R.ASSETS_ICONS_ICON_TOPIC_FIRST_PNG - : index == 1 - ? R.ASSETS_ICONS_ICON_TOPIC_SECOND_PNG - : R.ASSETS_ICONS_ICON_TOPIC_THIRD_PNG), - fit: BoxFit.cover, + Row( + children: [ + index <= 2 + ? Container( + width: 36.w, + height: 35.w, + clipBehavior: Clip.antiAlias, + alignment: Alignment.center, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(index == 0 + ? R.ASSETS_ICONS_ICON_TOPIC_FIRST_PNG + : index == 1 + ? R.ASSETS_ICONS_ICON_TOPIC_SECOND_PNG + : R.ASSETS_ICONS_ICON_TOPIC_THIRD_PNG), + fit: BoxFit.cover, + ), + ), + child: (index + 1) + .text + .white + .size(24.sp) + .bold + .make(), + ) + : Container( + width: 32.w, + height: 32.w, + clipBehavior: Clip.antiAlias, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFC4C4C4), + borderRadius: + BorderRadius.all(Radius.circular(4.w)), + ), + child: (index + 1) + .text + .white + .size(24.sp) + .bold + .make(), ), - ), - child: - (index + 1).text.white.size(24.sp).bold.make(), - ) - : Container( - width: 32.w, - height: 32.w, - clipBehavior: Clip.antiAlias, - alignment: Alignment.center, - decoration: BoxDecoration( - color: Color(0xFFC4C4C4), - borderRadius: - BorderRadius.all(Radius.circular(4.w)), - ), - child: - (index + 1).text.white.size(24.sp).bold.make(), - ), - 15.wb, - Container( - width: 400.w, - child: ('#' + model.summary!) - .text - .maxLines(1) - .size(30.sp) - .bold - .isIntrinsic - .overflow(TextOverflow.ellipsis) - .make(), - ) - ], - ), - 20.hb, - (model.content ?? '') - .text - .maxLines(2) - .size(22.sp) - .color(Color(0xFF666666)) - .overflow(TextOverflow.ellipsis) - .make(), - 21.hb, - [ - Spacer(), - Image.asset( - R.ASSETS_ICONS_HOT_FIRE_PNG, - height: 24.w, - width: 24.w, - ), - 12.wb, - '${model.activityNum}' - .text - .maxLines(1) - .size(22.sp) - .overflow(TextOverflow.ellipsis) - .make() - ].row(), - ], - ).box.make().expand(), - 12.wb, - Hero( - // tag: "${model.firstImg}_${model.id}", - tag: model.hashCode.toString(), - child: Container( - clipBehavior: Clip.antiAlias, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.w), - color: Colors.black12, - ), - child: Stack( - children: [ - FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrl)), - height: 160.w, - width: 160.w, - fit: BoxFit.cover, + 15.wb, + Container( + width: 400.w, + child: ('#' + model.title) + .text + .maxLines(1) + .size(30.sp) + .bold + .isIntrinsic + .overflow(TextOverflow.ellipsis) + .make(), + ) + ], ), - // Positioned( - // bottom: 0, - // left: 0, - // right: 0, - // child: ClipRRect( - // borderRadius: BorderRadius.vertical( - // bottom: Radius.circular(8.w), - // ), - // child: BackdropFilter( - // filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), - // child: ('#${model.summary}') - // .text - // .center - // .size(28.sp) - // .white - // .make() - // .material(color: Colors.black26), - // ), - // ), - // ), + 20.hb, + (model.content) + .text + .maxLines(2) + .size(22.sp) + .color(Color(0xFF666666)) + .overflow(TextOverflow.ellipsis) + .make(), + 21.hb, ], + ).box.make().expand(), + 12.wb, + Hero( + // tag: "${model.firstImg}_${model.id}", + tag: model.hashCode.toString(), + child: Container( + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Colors.black12, + ), + child: Stack( + children: [ + BeeImageNetwork(urls: model.imgList), + ], + ), + ), ), - ), + ], ), + 32.w.heightBox, + Row( + children: [ + '${model.dynamicNum}条动态 · ${model.commentNum}人讨论' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make() + ], + ) ], ), ), @@ -165,13 +146,11 @@ class TopicCommunityViewState extends State { Widget build(BuildContext context) { return BeeScaffold( title: '所有话题'.text.color(ktextPrimary).size(32.sp).normal.make(), - body: BeeListView( - path: API.community.topicList, + body: BeeListView( + path: SARSAPI.community.topicList, controller: _refreshController, convert: (model) { - return model.tableList! - .map((e) => CommunityTopicModel.fromJson(e)) - .toList(); + return model.rows.map((e) => TopicListModel.fromJson(e)).toList(); }, builder: (items) { return ListView.separated( @@ -186,7 +165,4 @@ class TopicCommunityViewState extends State { ), ); } - - @override - bool get wantKeepAlive => true; } diff --git a/lib/ui/community/community_views/topic/topic_detail_page.dart b/lib/ui/community/community_views/topic/topic_detail_page.dart index b86e5b4e..c1017e05 100644 --- a/lib/ui/community/community_views/topic/topic_detail_page.dart +++ b/lib/ui/community/community_views/topic/topic_detail_page.dart @@ -1,22 +1,26 @@ -import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:aku_new_community/model/community/community_topic_model.dart'; -import 'package:aku_new_community/model/community/event_item_model.dart'; -import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; +import 'package:aku_new_community/models/community/all_dynamic_list_model.dart'; +import 'package:aku_new_community/models/community/top_detail_model.dart'; import 'package:aku_new_community/ui/community/community_views/add_new_event_page.dart'; import 'package:aku_new_community/ui/community/community_views/topic/topic_sliver_header.dart'; import 'package:aku_new_community/ui/community/community_views/widgets/chat_card.dart'; import 'package:aku_new_community/utils/login_util.dart'; +import 'package:aku_new_community/utils/network/base_list_model.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; class TopicDetailPage extends StatefulWidget { - final CommunityTopicModel? model; + final int? topicId; - TopicDetailPage({Key? key, this.model}) : super(key: key); + TopicDetailPage({Key? key, this.topicId}) : super(key: key); @override _TopicDetailPageState createState() => _TopicDetailPageState(); @@ -24,6 +28,9 @@ class TopicDetailPage extends StatefulWidget { class _TopicDetailPageState extends State { EasyRefreshController _refreshController = EasyRefreshController(); + TopDetailModel? _detailModel; + List _dynamicList = []; + bool _onLoad = true; @override void dispose() { @@ -31,6 +38,10 @@ class _TopicDetailPageState extends State { super.dispose(); } + int _page = 1; + int _currentIndex = 0; + List _tabs = ['最新', '最热']; + @override Widget build(BuildContext context) { return AnnotatedRegion( @@ -41,52 +52,131 @@ class _TopicDetailPageState extends State { onPressed: () async { if (LoginUtil.isNotLogin) return; await Get.to(() => AddNewEventPage.topic( - topicName: widget.model!.summary, - initTopic: widget.model!.id, + topicName: _detailModel?.title, + initTopic: widget.topicId, )); }, child: Icon(Icons.add), ), - body: BeeListView( - convert: (model) { - return model.tableList! - .map((e) => EventItemModel.fromJson(e)) - .toList(); - }, - path: API.community.eventByTopicId, - extraParams: {'gambitId': widget.model!.id}, - controller: _refreshController, - builder: (items) { - return CustomScrollView( - slivers: [ - SliverPersistentHeader( - delegate: TopicSliverHeader( - id: widget.model!.id, - title: widget.model!.summary, - imgPath: ImgModel.first(widget.model!.imgUrl), - subTitle: widget.model!.content, - ), - pinned: true, - floating: true, - ), - SliverList( - delegate: SliverChildBuilderDelegate( - (context, index) { - final item = items[index] as EventItemModel; - return ChatCard( - model: item, - onDelete: () { - _refreshController.callRefresh(); + body: EasyRefresh.custom( + firstRefresh: true, + controller: _refreshController, + header: MaterialHeader(), + footer: MaterialFooter(), + onRefresh: () async { + _page = 1; + var res = await NetUtil().get(SARSAPI.community.topicDetail, + params: {'topicId': widget.topicId}); + if (res.success) { + _detailModel = TopDetailModel.fromJson(res.data); + } + var baseList = await NetUtil() + .getList(SARSAPI.community.dynamicList, params: { + 'pageNum': _page, + 'size': 4, + 'topicId': widget.topicId, + 'type': _currentIndex + }); + _dynamicList = baseList.rows + .map((e) => AllDynamicListModel.fromJson(e)) + .toList(); + _onLoad = false; + setState(() {}); + }, + onLoad: () async { + _page++; + BaseListModel baseList = await NetUtil() + .getList(SARSAPI.community.dynamicList, params: { + 'pageNum': _page, + 'size': 4, + 'topicId': widget.topicId, + 'type': 1 + }); + if (_dynamicList.length < baseList.total) { + _dynamicList.addAll(baseList.rows + .map((e) => AllDynamicListModel.fromJson(e)) + .toList()); + } + }, + slivers: _onLoad + ? [] + : [ + SliverPersistentHeader( + delegate: TopicSliverHeader( + id: widget.topicId, + title: _detailModel?.title, + imgPath: ImgModel.first(_detailModel?.imgList), + subTitle: _detailModel?.content, + ), + pinned: true, + floating: true, + ), + SliverToBoxAdapter( + child: Container( + width: double.infinity, + height: 100.w, + color: Colors.white, + padding: EdgeInsets.symmetric( + vertical: 20.w, horizontal: 32.w), + child: Row( + children: [ + ..._tabs + .mapIndexed((e, index) => _tab(e, index)) + .toList() + .sepWidget(separate: 40.w.widthBox), + ], + ), + ), + ), + SliverList( + delegate: SliverChildBuilderDelegate( + (context, index) { + return Padding( + padding: EdgeInsets.only(top: 20.w), + child: ChatCard( + model: _dynamicList[index], + onDelete: () { + _refreshController.callRefresh(); + }, + ), + ); }, - ); - }, - childCount: items.length, - ), + childCount: _dynamicList.length, + ), + ), + ]), + ), + ); + } + + Widget _tab(String text, int index) { + var select = _currentIndex == index; + return GestureDetector( + onTap: () async { + _currentIndex = index; + _refreshController.callRefresh(); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + text.text + .color(Colors.black) + .fontWeight(select ? FontWeight.bold : FontWeight.normal) + .size(30.sp) + .make(), + 8.w.heightBox, + !select + ? SizedBox( + height: 4.w, + ) + : Container( + width: 40.w, + height: 4.w, + color: Color(0xFFB634).withOpacity(0.8), ), - ], - ); - }, - ), + ], ), ); } diff --git a/lib/ui/community/community_views/topic/topic_search_page.dart b/lib/ui/community/community_views/topic/topic_search_page.dart new file mode 100644 index 00000000..87f48366 --- /dev/null +++ b/lib/ui/community/community_views/topic/topic_search_page.dart @@ -0,0 +1,169 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/src/extensions/num_ext.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; +import 'package:aku_new_community/models/community/topic_list_model.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; + +class TopicSearchPage extends StatefulWidget { + const TopicSearchPage({ + Key? key, + }) : super(key: key); + + @override + _TopicSearchPageState createState() => _TopicSearchPageState(); +} + +class _TopicSearchPageState extends State { + List _models = []; + bool isHot = true; + + Future _getModels() async { + var re = await NetUtil().get(SARSAPI.community.topicList, params: { + 'pageNum': 1, + 'size': 10, + }); + if (re.success) { + _models = (re.data['rows'] as List) + .map((e) => TopicListModel.fromJson(e)) + .toList(); + setState(() {}); + } + } + + @override + void initState() { + _getModels(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + var appbar = PreferredSize( + preferredSize: Size.fromHeight(128.w), + child: Padding( + padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), + child: Row( + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(40.w), + color: Colors.black.withOpacity(0.06)), + padding: EdgeInsets.symmetric(vertical: 15.w, horizontal: 32.w), + margin: EdgeInsets.only(left: 32.w), + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(top: 6.w), + child: Icon( + CupertinoIcons.search, + size: 32.w, + color: Colors.black.withOpacity(0.25), + ), + ), + 12.w.widthBox, + Expanded( + child: TextField( + onSubmitted: (text) async { + if (text.isEmpty) { + isHot = true; + _getModels(); + return; + } + var re = await NetUtil() + .get(SARSAPI.community.topicList, params: { + 'pageNum': 1, + 'size': 20, + }); + if (re.success) { + _models = (re.data['rows'] as List) + .map((e) => TopicListModel.fromJson(e)) + .toList(); + setState(() {}); + } + }, + decoration: InputDecoration( + border: InputBorder.none, + contentPadding: EdgeInsets.zero, + hintText: '请输入话题关键字', + hintStyle: TextStyle( + color: Colors.black.withOpacity(0.25), + fontSize: 24.sp), + isDense: true), + ), + ), + ], + ), + ), + ), + TextButton( + onPressed: () {}, + child: '取消' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make()) + ], + ), + ), + ); + return Scaffold( + appBar: appbar, + body: ListView( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), + children: [ + Offstage( + offstage: !isHot, + child: '猜你喜欢' + .text + .size(26.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ), + ..._models + .map((e) => _tile(e)) + .toList() + .sepWidget(separate: BeeDivider.horizontal()) + ], + ), + ); + } + + Widget _tile(TopicListModel model) { + return GestureDetector( + onTap: () { + Get.back(result: model); + }, + child: Material( + color: Colors.transparent, + child: Padding( + padding: EdgeInsets.symmetric(vertical: 28.w), + child: Row( + children: [ + '#'.text.size(24.sp).color(Color(0xFAC058)).make(), + model.title.text + .size(26.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + Spacer(), + '${model.dynamicNum}条动态' + .text + .size(26.sp) + .color(Colors.black.withOpacity(0.85)) + .make() + ], + ), + ), + ), + ); + } +} diff --git a/lib/ui/community/community_views/topic/topic_sliver_header.dart b/lib/ui/community/community_views/topic/topic_sliver_header.dart index d2b5ff77..c4fbd397 100644 --- a/lib/ui/community/community_views/topic/topic_sliver_header.dart +++ b/lib/ui/community/community_views/topic/topic_sliver_header.dart @@ -1,4 +1,4 @@ -import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:flutter/material.dart'; @@ -9,13 +9,16 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate { final String? title; final String? subTitle; final int? id; + final int? dynamicNum; + final int? commentNum; - TopicSliverHeader({ - this.imgPath, - this.title, - this.subTitle, - required this.id, - }); + TopicSliverHeader( + {this.imgPath, + this.title, + this.subTitle, + required this.id, + this.commentNum, + this.dynamicNum}); _buildOverlay(double shrinkOffset) { return Positioned( @@ -43,12 +46,24 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate { _buildTitle(double shrinkOffset) { return Positioned( - bottom: 202.w - 195.w * _filterOffset(shrinkOffset), + bottom: 248.w - 248.w * _filterOffset(shrinkOffset), left: 32.w + (95.w - 32.w) * _offset(shrinkOffset), child: '#$title'.text.bold.white.size(52.sp).make(), ); } + _buildNum(double shrinkOffset) { + return Positioned( + bottom: 206.w - 206.w * _offset(shrinkOffset) * 2, + left: 32.w + (95.w - 32.w) * _offset(shrinkOffset), + child: '${dynamicNum ?? 0}条动态 ${commentNum ?? 0}人讨论' + .text + .size(24.sp) + .white + .make(), + ); + } + _buildSubTitle(double shrinkOffset) { return Positioned( bottom: 104.w - 104.w * _offset(shrinkOffset) * 2, @@ -80,7 +95,7 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate { tag: "$imgPath\_$id", child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(imgPath), + image: SARSAPI.image(imgPath), fit: BoxFit.cover, ), ), @@ -91,9 +106,10 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate { bottom: 0, child: Material(color: Colors.black.withOpacity(0.4)), ), - _buildOverlay(shrinkOffset), + // _buildOverlay(shrinkOffset), _buildBackButton(), _buildTitle(shrinkOffset), + _buildNum(shrinkOffset), _buildSubTitle(shrinkOffset), ], ), @@ -117,10 +133,10 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate { } @override - double get maxExtent => 460.w + ScreenUtil().statusBarHeight; + double get maxExtent => 500.w + ScreenUtil().statusBarHeight; @override - double get minExtent => 48 + ScreenUtil().statusBarHeight; + double get minExtent => 50 + ScreenUtil().statusBarHeight; @override bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) { diff --git a/lib/ui/community/community_views/widgets/chat_card.dart b/lib/ui/community/community_views/widgets/chat_card.dart index 418b9f13..216327f8 100644 --- a/lib/ui/community/community_views/widgets/chat_card.dart +++ b/lib/ui/community/community_views/widgets/chat_card.dart @@ -1,19 +1,21 @@ import 'dart:math'; +import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:aku_new_community/model/community/event_item_model.dart'; +import 'package:aku_new_community/models/community/all_dynamic_list_model.dart'; import 'package:aku_new_community/provider/user_provider.dart'; +import 'package:aku_new_community/ui/community/community_views/add_new_event_page.dart'; import 'package:aku_new_community/ui/community/community_views/event_detail_page.dart'; -import 'package:aku_new_community/ui/community/community_views/widgets/send_a_chat.dart'; import 'package:aku_new_community/utils/bee_date_util.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/login_util.dart'; -import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; import 'package:aku_new_community/widget/views/bee_grid_image_view.dart'; import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -21,10 +23,9 @@ import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; class ChatCard extends StatefulWidget { - final EventItemModel? model; + final AllDynamicListModel model; final VoidCallback? onDelete; - final bool hideLine; final bool canTap; @@ -43,12 +44,14 @@ class ChatCard extends StatefulWidget { class _ChatCardState extends State { bool get _isMyself { final userProvider = Provider.of(context, listen: false); - return (userProvider.userInfoModel?.id ?? -1) == widget.model!.createId; + return (userProvider.userInfoModel?.id ?? -1) == widget.model.createId; } + late bool _isLiked; + _renderImage() { - if (widget.model!.imgUrls!.isEmpty) return SizedBox(); - if (widget.model!.imgUrls!.length == 1) + if (widget.model.dynamicList.isEmpty) return SizedBox(); + if (widget.model.dynamicList.length == 1) return MaterialButton( materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, padding: EdgeInsets.zero, @@ -59,8 +62,8 @@ class _ChatCardState extends State { ), onPressed: () { BeeImagePreview.toPath( - path: ImgModel.first(widget.model!.imgUrls), - tag: ImgModel.first(widget.model!.imgUrls), + path: ImgModel.first(widget.model.dynamicList), + tag: ImgModel.first(widget.model.dynamicList), ); }, child: ConstrainedBox( @@ -68,242 +71,98 @@ class _ChatCardState extends State { maxHeight: 300.w, maxWidth: 300.w, ), - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(widget.model!.imgUrls)), - imageErrorBuilder: (context, error, stackTrace) { - return Image.asset( - R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - height: 300.w, - width: 300.w, - ); - }, - ), - + child: FadeInImage.assetNetwork( + placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + image: SARSAPI.image(ImgModel.first(widget.model.dynamicList)), + imageErrorBuilder: (context, error, stackTrace) { + return Image.asset( + R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + height: 300.w, + width: 300.w, + ); + }, + ), ), ); else return BeeGridImageView( - urls: widget.model!.imgUrls!.map((e) => e.url).toList()); + urls: widget.model.dynamicList.map((e) => e.url).toList()); } - _buildMoreButton() { - return Builder(builder: (context) { - final userProvider = Provider.of(context); - return MaterialButton( - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6.w), - ), - padding: EdgeInsets.zero, - height: 40.w, - minWidth: 0, - color: Color(0xFFD8D8D8), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - onPressed: () { - if (LoginUtil.isNotLogin) return; - BotToast.showAttachedWidget( - targetContext: context, - preferDirection: PreferDirection.leftCenter, - attachedBuilder: (cancel) { - return Padding( - padding: EdgeInsets.only(right: 10.w), - child: Material( - color: Color(0xFFD8D8D8), - borderRadius: BorderRadius.circular(8.w), - clipBehavior: Clip.antiAlias, - child: SizedBox( - height: 78.w, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - MaterialButton( - height: 78.w, - materialTapTargetSize: - MaterialTapTargetSize.shrinkWrap, - onPressed: () async { - cancel(); - await NetUtil().get( - API.community.like, - params: {'themeId': widget.model!.id}, - showMessage: true, - ); - setState(() { - if (widget.model!.isLike == 0) { - widget.model!.likeNames!.add( - LikeNames( - id: Random().nextInt(1000), - name: userProvider.userInfoModel!.nickName, - ), - ); - } else { - widget.model!.likeNames!.removeWhere( - (element) => - element.name == - userProvider.userInfoModel!.nickName); - } - widget.model!.isLike = - (widget.model!.isLike == 1) ? 0 : 1; - }); - }, - child: [ - widget.model!.isLike == 1 - ? Icon(Icons.favorite, - size: 30.w, color: Colors.red) - : Icon(Icons.favorite_border, size: 30.w), - 10.wb, - '赞'.text.make(), - ].row(), - ), - VerticalDivider(width: 1.w, thickness: 1.w), - MaterialButton( - height: 78.w, - materialTapTargetSize: - MaterialTapTargetSize.shrinkWrap, - onPressed: () { - if (widget.model!.isComment == 1) - SendAChat.send( - parentId: 0, - themeId: widget.model!.id, - ); - else - BotToast.showText(text: '不可评论'); - }, - child: [ - Icon(CupertinoIcons.bubble_right, size: 30.w), - 10.wb, - '评论'.text.make(), - ].row(), - ), - ], - ), - ), - ), - ); + _buildLikeAndComment() { + return Padding( + padding: EdgeInsets.only(top: 24.w, left: 32.w, right: 32.w), + child: Row( + children: [ + '${widget.model.views}浏览' + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make(), + Spacer(), + GestureDetector( + onTap: () async { + var res = await NetUtil().get(SARSAPI.community.dynamicLike, + params: {'dynamicId': widget.model.id}); + if (res.success) { + _isLiked = !_isLiked; + setState(() {}); + } else { + BotToast.showText(text: res.msg); + } }, - ); - }, - child: Row( - children: [ - 20.wb, - Container( - height: 8.w, - width: 8.w, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4.w), + child: Material( + color: Colors.transparent, + child: Row( + children: [ + Image.asset( + R.ASSETS_ICONS_COMMUNITY_LIKE_PNG, + width: 32.w, + height: 32.w, + color: !_isLiked + ? Colors.black.withOpacity(0.45) + : kPrimaryColor, + ), + 5.wb, + '${widget.model.likes}' + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make(), + ], ), ), - 8.wb, - Container( - height: 8.w, - width: 8.w, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4.w), + ), + 20.wb, + GestureDetector( + onTap: widget.model.isComment == 1 ? () async {} : () async {}, + child: Material( + color: Colors.transparent, + child: Row( + children: [ + Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG, + width: 32.w, + height: 32.w, + color: Colors.black.withOpacity(0.45)), + 5.wb, + '${widget.model.commentNum}' + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make(), + ], ), ), - 20.wb, - ], - ), - ); - }); - } - - _buildLikeAndComment(){ - return Row( - children: [ - 30.wb, - '${widget.model!.views}浏览' - - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - Spacer(), - Image.asset(R.ASSETS_ICONS_COMMUNITY_LIKE_PNG,width: 32.w,height: 32.w,), - //Image.asset(widget.model!.isLike!=1? R.ASSETS_ICONS_COMMUNITY_LIKE_PNG:R.ASSETS_ICONS_COMMUNITY_LIKE_IS_PNG,width: 32.w,height: 32.w,), - 5.wb, - '${widget.model!.likeNamesNum}' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - 20.wb, - Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,width: 32.w,height: 32.w,), - //Image.asset(widget.model!.isComment!=1?R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG:R.ASSETS_ICONS_COMMUNITY_COMMENT_IS_PNG,width: 32.w,height: 32.w,), - 5.wb, - '${widget.model!.gambitThemeCommentNum}' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - 30.wb, - ], - ); - } - _renderLike() { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Flex( - direction: Axis.horizontal, - children: [ - Icon(Icons.favorite_border_rounded, size: 24.w), - 14.wb, - ...widget.model!.likeNames! - .map((e) => e.name!.text.make()) - .toList() - .sepWidget(separate: ','.text.make()), + ) ], ), ); } - _renderComment() { - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: widget.model!.gambitThemeCommentVoList!.map((e) { - StringBuffer buffer = StringBuffer(); - buffer.write(e.createName); - if (e.parentName != null) buffer.write('回复${e.parentName}'); - buffer.write(':${e.content}'); - return InkWell( - child: Text( - buffer.toString(), - style: Theme.of(context).textTheme.subtitle2, - ), - onTap: () { - SendAChat.send(parentId: e.id, themeId: widget.model!.id); - }, - ); - }).toList(), - ); - } - - _renderLikeAndComment() { - if (widget.model!.likeNames!.isEmpty && - widget.model!.gambitThemeCommentVoList!.isEmpty) return SizedBox(); - return Material( - borderRadius: BorderRadius.circular(8.w), - color: Color(0xFFF7F7F7), - child: Padding( - padding: EdgeInsets.all(8.w), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - widget.model!.likeNames!.isEmpty ? SizedBox() : _renderLike(), - (widget.model!.likeNames!.isNotEmpty && - widget.model!.gambitThemeCommentVoList!.isNotEmpty) - ? Divider(height: 1.w, thickness: 1.w) - : SizedBox(), - widget.model!.gambitThemeCommentVoList!.isEmpty - ? SizedBox() - : _renderComment(), - ], - ), - ), - ); + @override + void initState() { + _isLiked = widget.model.isLike; + super.initState(); } @override @@ -311,24 +170,15 @@ class _ChatCardState extends State { return DecoratedBox( decoration: BoxDecoration( color: Colors.white, - // border: Border( - // bottom: BorderSide( - // color: widget.hideLine - // ? Colors.transparent - // : Color(0xFFE5E5E5).withOpacity(0.5), - // ), - // ), ), child: MaterialButton( padding: EdgeInsets.zero, onPressed: widget.canTap - ? () async{ - BaseModel model = await NetUtil().get( - API.community.getEventDetail, - params: {'themeId': widget.model!.id}, - ); - EventItemModel models = EventItemModel.fromJson(model.data); - Get.to(() => EventDetailPage(themeId: widget.model!.id, eventItemModel: models,onDelete: widget.onDelete,)); + ? () async { + Get.to(() => EventDetailPage( + dynamicId: widget.model.id, + onDelete: widget.onDelete, + )); } : null, child: Column( @@ -341,8 +191,8 @@ class _ChatCardState extends State { clipBehavior: Clip.antiAlias, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API - .image(ImgModel.first(widget.model!.headSculptureImgUrl)), + image: + SARSAPI.image(ImgModel.first(widget.model.avatarImgList)), height: 96.w, width: 96.w, fit: BoxFit.cover, @@ -360,7 +210,7 @@ class _ChatCardState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - widget.model!.createName!, + widget.model.createName, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( @@ -369,7 +219,7 @@ class _ChatCardState extends State { fontWeight: FontWeight.w500), ), 12.hb, - BeeDateUtil(widget.model!.date) + BeeDateUtil(DateUtil.getDateTime(widget.model.createDate)) .timeAgoWithHm .text .size(24.sp) @@ -378,33 +228,18 @@ class _ChatCardState extends State { ], ), Spacer(), - PopupMenuButton( - - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.w)), - itemBuilder: (context) { - return [ - _isMyself? - PopupMenuItem( - child: '删除'.text.isIntrinsic.make(), - value: 0, - ):PopupMenuItem( - child: '举报'.text.isIntrinsic.make(), - value: 0, - ), - ]; - }, - onSelected: (dynamic _) async { + CommunityPopButton( + isMyself: _isMyself, + onSelect: (dynamic _) async { if (LoginUtil.isNotLogin) return; - if(!_isMyself){ + if (!_isMyself) { VoidCallback cancel = BotToast.showLoading(); await Future.delayed( Duration(milliseconds: 500 + Random().nextInt(500))); cancel(); BotToast.showText(text: '举报成功'); - }else{ - bool? result = - await Get.dialog(CupertinoAlertDialog( + } else { + bool? result = await Get.dialog(CupertinoAlertDialog( title: '你确定删除吗'.text.isIntrinsic.make(), actions: [ CupertinoDialogAction( @@ -412,11 +247,8 @@ class _ChatCardState extends State { onPressed: () => Get.back(), ), CupertinoDialogAction( - child: '确定' - .text - .color(Colors.orange) - .isIntrinsic - .make(), + child: + '确定'.text.color(Colors.orange).isIntrinsic.make(), onPressed: () => Get.back(result: true), ), ], @@ -425,28 +257,15 @@ class _ChatCardState extends State { if (result == true) { await NetUtil().get( API.community.deleteMyEvent, - params: {'themeId': widget.model!.id}, + params: {'themeId': widget.model.id}, showMessage: true, ); if (widget.onDelete != null) widget.onDelete!(); } } - - }, - child: Container( - width: 80.w, - height: 80.w, - alignment: Alignment.center, - child: Image.asset( - R.ASSETS_ICONS_ICON_MORE_PNG, - width: 8.w, - height: 32.w, - fit: BoxFit.fitHeight, - )), ).paddingOnly(right: 32.w), - ].row(), - + ].row(crossAlignment: CrossAxisAlignment.start), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -454,79 +273,19 @@ class _ChatCardState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ 32.hb, - widget.model!.content!.text.size(32.sp).black.make(), + widget.model.content!.text.size(32.sp).black.make(), 32.hb, _renderImage(), - widget.model!.gambitTitle?.isEmpty ?? true + widget.model.topicTags.isEmpty ? SizedBox() - : Chip( - label: '# ${widget.model!.gambitTitle}' - .text - .color(Color(0xFF547fc0)) - .size(28.sp) - .make(), - padding: EdgeInsets.symmetric( - horizontal: 16.w, vertical: 5.w), - labelPadding: EdgeInsets.zero, - backgroundColor: Colors.transparent, - materialTapTargetSize: - MaterialTapTargetSize.shrinkWrap, - // shape: StadiumBorder( - // side: BorderSide(), - // ), - ).pOnly(top: 20.w), + : TopicWidgets(topicTags: widget.model.topicTags) + .pOnly(top: 20.w), 20.hb, ], ).paddingOnly(right: 32.w, left: 32.w), - Divider(height: 1.w, thickness: 1.w), 10.hb, - // Row( - // children: [ - // // 64.hb, - // _isMyself - // ? TextButton( - // onPressed: () async { - // bool? result = - // await Get.dialog(CupertinoAlertDialog( - // title: '你确定删除吗'.text.isIntrinsic.make(), - // actions: [ - // CupertinoDialogAction( - // child: '取消'.text.black.isIntrinsic.make(), - // onPressed: () => Get.back(), - // ), - // CupertinoDialogAction( - // child: '确定' - // .text - // .color(Colors.orange) - // .isIntrinsic - // .make(), - // onPressed: () => Get.back(result: true), - // ), - // ], - // )); - // - // if (result == true) { - // await NetUtil().get( - // API.community.deleteMyEvent, - // params: {'themeId': widget.model!.id}, - // showMessage: true, - // ); - // if (widget.onDelete != null) widget.onDelete!(); - // } - // }, - // child: '删除'.text.black.size(28.sp).make(), - // ) - // : SizedBox(), - // Spacer(), - // // _buildLikeAndComment(), - // //_buildMoreButton(), - // 20.wb, - // ], - // ), - // 20.hb, _buildLikeAndComment(), - //_renderLikeAndComment(), ], ), ], @@ -535,3 +294,45 @@ class _ChatCardState extends State { ).paddingOnly(bottom: 16.w); } } + +class CommunityPopButton extends StatelessWidget { + const CommunityPopButton({ + Key? key, + required this.isMyself, + required this.onSelect, + }) : super(key: key); + + final bool isMyself; + final Function(int) onSelect; + + @override + Widget build(BuildContext context) { + return PopupMenuButton( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)), + itemBuilder: (context) { + return [ + isMyself + ? PopupMenuItem( + child: '删除'.text.isIntrinsic.make(), + value: 0, + ) + : PopupMenuItem( + child: '举报'.text.isIntrinsic.make(), + value: 0, + ), + ]; + }, + onSelected: onSelect, + child: Container( + width: 80.w, + height: 80.w, + alignment: Alignment.center, + child: Image.asset( + R.ASSETS_ICONS_ICON_MORE_PNG, + width: 8.w, + height: 32.w, + fit: BoxFit.fitHeight, + )), + ); + } +} diff --git a/lib/ui/community/community_views/widgets/chat_card_detail.dart b/lib/ui/community/community_views/widgets/chat_card_detail.dart index 87ae811b..83190e1d 100644 --- a/lib/ui/community/community_views/widgets/chat_card_detail.dart +++ b/lib/ui/community/community_views/widgets/chat_card_detail.dart @@ -1,19 +1,14 @@ -import 'dart:math'; - import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:aku_new_community/model/community/event_item_model.dart'; +import 'package:aku_new_community/models/community/dynamic_detail_model.dart'; import 'package:aku_new_community/provider/user_provider.dart'; -import 'package:aku_new_community/ui/community/community_views/event_detail_page.dart'; -import 'package:aku_new_community/ui/community/community_views/widgets/send_a_chat.dart'; +import 'package:aku_new_community/ui/community/community_views/add_new_event_page.dart'; import 'package:aku_new_community/utils/bee_date_util.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/utils/login_util.dart'; -import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; import 'package:aku_new_community/widget/views/bee_grid_image_view.dart'; -import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -21,7 +16,7 @@ import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; class ChatCardDetail extends StatefulWidget { - final EventItemModel? model; + final DynamicDetailModel model; final VoidCallback? onDelete; @@ -43,12 +38,12 @@ class ChatCardDetail extends StatefulWidget { class _ChatCardDetailState extends State { bool get _isMyself { final userProvider = Provider.of(context, listen: false); - return (userProvider.userInfoModel?.id ?? -1) == widget.model!.createId; + return (userProvider.userInfoModel?.id ?? -1) == widget.model.createId; } _renderImage() { - if (widget.model!.imgUrls!.isEmpty) return SizedBox(); - if (widget.model!.imgUrls!.length == 1) + if (widget.model.dynamicImgList.isEmpty) return SizedBox(); + if (widget.model.dynamicImgList.length == 1) return MaterialButton( materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, padding: EdgeInsets.zero, @@ -59,8 +54,8 @@ class _ChatCardDetailState extends State { ), onPressed: () { BeeImagePreview.toPath( - path: ImgModel.first(widget.model!.imgUrls), - tag: ImgModel.first(widget.model!.imgUrls), + path: ImgModel.first(widget.model.dynamicImgList), + tag: ImgModel.first(widget.model.dynamicImgList), ); }, child: ConstrainedBox( @@ -69,10 +64,10 @@ class _ChatCardDetailState extends State { maxWidth: 300.w, ), child: Hero( - tag: ImgModel.first(widget.model!.imgUrls), + tag: ImgModel.first(widget.model.dynamicImgList), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(widget.model!.imgUrls)), + image: SARSAPI.image(ImgModel.first(widget.model.dynamicImgList)), imageErrorBuilder: (context, error, stackTrace) { return Image.asset( R.ASSETS_IMAGES_PLACEHOLDER_WEBP, @@ -86,484 +81,140 @@ class _ChatCardDetailState extends State { ); else return BeeGridImageView( - urls: widget.model!.imgUrls!.map((e) => e.url).toList()); - } - - _buildMoreButton() { - return Builder(builder: (context) { - final userProvider = Provider.of(context); - return MaterialButton( - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6.w), - ), - padding: EdgeInsets.zero, - height: 40.w, - minWidth: 0, - color: Color(0xFFD8D8D8), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - onPressed: () { - if (LoginUtil.isNotLogin) return; - BotToast.showAttachedWidget( - targetContext: context, - preferDirection: PreferDirection.leftCenter, - attachedBuilder: (cancel) { - return Padding( - padding: EdgeInsets.only(right: 10.w), - child: Material( - color: Color(0xFFD8D8D8), - borderRadius: BorderRadius.circular(8.w), - clipBehavior: Clip.antiAlias, - child: SizedBox( - height: 78.w, - child: Row( - - children: [ - MaterialButton( - height: 78.w, - materialTapTargetSize: - MaterialTapTargetSize.shrinkWrap, - onPressed: () async { - cancel(); - await NetUtil().get( - API.community.like, - params: {'themeId': widget.model!.id}, - showMessage: true, - ); - setState(() { - if (widget.model!.isLike == 0) { - widget.model!.likeNames!.add( - LikeNames( - id: Random().nextInt(1000), - name: userProvider.userInfoModel!.nickName, - ), - ); - } else { - widget.model!.likeNames!.removeWhere( - (element) => - element.name == - userProvider.userInfoModel!.nickName); - } - widget.model!.isLike = - (widget.model!.isLike == 1) ? 0 : 1; - }); - }, - child: [ - widget.model!.isLike == 1 - ? Icon(Icons.favorite, - size: 30.w, color: Colors.red) - : Icon(Icons.favorite_border, size: 30.w), - 10.wb, - '赞'.text.make(), - ].row(), - ), - VerticalDivider(width: 1.w, thickness: 1.w), - MaterialButton( - height: 78.w, - materialTapTargetSize: - MaterialTapTargetSize.shrinkWrap, - onPressed: () { - if (widget.model!.isComment == 1) - SendAChat.send( - parentId: 0, - themeId: widget.model!.id, - ); - else - BotToast.showText(text: '不可评论'); - }, - child: [ - Icon(CupertinoIcons.bubble_right, size: 30.w), - 10.wb, - '评论'.text.make(), - ].row(), - ), - ], - ), - ), - ), - ); - }, - ); - }, - child: Row( - children: [ - 20.wb, - Container( - height: 8.w, - width: 8.w, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4.w), - ), - ), - 8.wb, - Container( - height: 8.w, - width: 8.w, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4.w), - ), - ), - 20.wb, - ], - ), - ); - }); - } - - _buildLikeAndComment(){ - return Row( - children: [ - 30.wb, - '${widget.model!.views}浏览' - - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - Spacer(), - Image.asset(R.ASSETS_ICONS_COMMUNITY_LIKE_PNG,width: 32.w,height: 32.w,), - //Image.asset(widget.model!.isLike!=1? R.ASSETS_ICONS_COMMUNITY_LIKE_PNG:R.ASSETS_ICONS_COMMUNITY_LIKE_IS_PNG,width: 32.w,height: 32.w,), - 5.wb, - '${widget.model!.likeNamesNum}' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - 20.wb, - Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,width: 32.w,height: 32.w,), - //Image.asset(widget.model!.isComment!=1?R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG:R.ASSETS_ICONS_COMMUNITY_COMMENT_IS_PNG,width: 32.w,height: 32.w,), - 5.wb, - '${widget.model!.gambitThemeCommentNum}' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - 30.wb, - ], - ); - } - _renderLike() { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Flex( - direction: Axis.horizontal, - children: [ - Icon(Icons.favorite_border_rounded, size: 24.w), - 14.wb, - ...widget.model!.likeNames! - .map((e) => Container(child: e.name!.text.make(),margin: EdgeInsets.only(right: 10.w),)) - .toList() - .sepWidget(separate: ','.text.make()), - ], - ), - ); - } - - _renderComment() { - return Padding( - padding: EdgeInsets.only(left: 20.w,right: 20.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: widget.model!.gambitThemeCommentVoList!.map((e) { - - // StringBuffer buffer = StringBuffer(); - // buffer.write(e.createName); - // - // if (e.parentName != null) buffer.write(' 回复 ${e.parentName}'); - // buffer.write(': ${e.content}'); - return InkWell( - child: e.createName!.richText.color(Color(0xFF5D98F9)).size(24.sp).withTextSpanChildren([ - - e.parentName != null ?' 回复'.textSpan.size(24.sp).color(ktextSubColor).make(): - ''.textSpan.size(24.sp).color(Color(0xFF5D98F9)).make(), - e.parentName != null ?' ${e.parentName}'.textSpan.size(24.sp).color(Color(0xFF5D98F9)).make(): - ''.textSpan.size(24.sp).color(ktextPrimary).make(), - ' : '.textSpan.size(24.sp).color(ktextPrimary).make(), - '${e.content}'.textSpan.size(24.sp).black.make(), - ]).make(), - onTap: () { - SendAChat.send(parentId: e.id, themeId: widget.model!.id); - }, - ); - }).toList(), - ), - ); + urls: widget.model.dynamicImgList.map((e) => e.url).toList()); } - - @override Widget build(BuildContext context) { - return Column( - children: [ - Container( - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - [ - Material( - color: Color(0xFFF5F5F5), - borderRadius: BorderRadius.circular(48.w), - clipBehavior: Clip.antiAlias, - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API - .image(ImgModel.first(widget.model!.headSculptureImgUrl)), - height: 96.w, - width: 96.w, - fit: BoxFit.cover, - imageErrorBuilder: (context, error, stackTrace) { - return Image.asset( - R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - height: 86.w, - width: 86.w, - ); - }, - ), - ).paddingOnly(left: 32.w), - 20.wb, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.model!.createName!, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Colors.black.withOpacity(0.85), - fontSize: 30.sp, - fontWeight: FontWeight.w500), - ), - 12.hb, - BeeDateUtil(widget.model!.date) - .timeAgoWithHm - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - ], - ), - Spacer(), - Image.asset(R.ASSETS_ICONS_COMMUNITY_LIKE_PNG,width: 40.w,height: 40.w,), - //Image.asset(widget.model!.isLike!=1? R.ASSETS_ICONS_COMMUNITY_LIKE_PNG:R.ASSETS_ICONS_COMMUNITY_LIKE_IS_PNG,width: 32.w,height: 32.w,), - 5.wb, - '${widget.model!.likeNamesNum}' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - 32.wb, - - - - - ].row(), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - 32.hb, - widget.model!.content!.text.size(28.sp).color(ktextSubColor).make(), - 32.hb, - _renderImage(), - Row( - children: [ - widget.model!.gambitTitle?.isEmpty ?? true - ? SizedBox() - : Chip( - label: '# ${widget.model!.gambitTitle}' - .text - .color(Color(0xFF547fc0)) - .size(28.sp) - .make(), - padding: EdgeInsets.symmetric( - horizontal: 16.w, vertical: 5.w), - labelPadding: EdgeInsets.zero, - backgroundColor: Colors.transparent, - materialTapTargetSize: - MaterialTapTargetSize.shrinkWrap, - // shape: StadiumBorder( - // side: BorderSide(), - // ), - ).pOnly(top: 20.w), - - ], - ), - - 20.hb, - ], - ).paddingOnly(right: 32.w, left: 32.w) - , - - // Divider(height: 1.w, thickness: 1.w), - // 10.hb, - // Row( - // children: [ - // // 64.hb, - // - // Spacer(), - // _buildMoreButton(), - // 20.wb, - // ], - // ), - 20.hb, - //_buildLikeAndComment(), - - ], - ), - ], - ).paddingOnly(top: 20.w), - ).marginOnly(top: 12.w, bottom: 12.w), - _renderLikeAndCommentWidget() - ] - - - ).paddingOnly(bottom: 16.w); - } - - _renderLikeAndComment() { - if (widget.model!.likeNames!.isEmpty && - widget.model!.gambitThemeCommentVoList!.isEmpty) return SizedBox(); - return Material( - borderRadius: BorderRadius.circular(8.w), - color: Color(0xFFF7F7F7), - child: Padding( - padding: EdgeInsets.all(8.w), + return Column(children: [ + Container( + color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - widget.model!.likeNames!.isEmpty ? SizedBox() : _renderLike(), - 10.hb, - (widget.model!.likeNames!.isNotEmpty && - widget.model!.gambitThemeCommentVoList!.isNotEmpty) - ? Divider(height: 1.w, thickness: 1.w) - : SizedBox(), - 10.hb, - widget.model!.gambitThemeCommentVoList!.isEmpty - ? SizedBox() - : _renderComment(), - ], - ), - ), - ); - } - - _renderLikeAndCommentWidget(){ - return Container( - padding: EdgeInsets.only(top: 22.w,bottom: 22.w), - color: Colors.white, - child: Column( - children: [ - Row( - children: [ - 32.wb, + [ + Material( + color: Color(0xFFF5F5F5), + borderRadius: BorderRadius.circular(48.w), + clipBehavior: Clip.antiAlias, + child: FadeInImage.assetNetwork( + placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + image: + SARSAPI.image(ImgModel.first(widget.model.avatarImgList)), + height: 96.w, + width: 96.w, + fit: BoxFit.cover, + imageErrorBuilder: (context, error, stackTrace) { + return Image.asset( + R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + height: 86.w, + width: 86.w, + ); + }, + ), + ).paddingOnly(left: 32.w), + 20.wb, Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - - ('评论'+'${widget.model!.gambitThemeCommentNum!}').text.size(28.sp).black.make(), - Container( - width: 32.w, - height: 2.w, - color: Color(0xCCFFB634), - ) + Text( + widget.model.createName, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.black.withOpacity(0.85), + fontSize: 30.sp, + fontWeight: FontWeight.w500), + ), + 12.hb, + BeeDateUtil(DateUtil.getDateTime(widget.model.createDate)) + .timeAgoWithHm + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make(), ], ), Spacer(), - GestureDetector( - child: Container( - child: Row( - children: [ - Image.asset(R.ASSETS_ICONS_ICON_SORT_PNG,height: 40.w,width: 40.w,), - 8.wb, - ('按时间').text.size(28.sp).color(ktextPrimary).make(), - ], - ), - ), + Image.asset( + R.ASSETS_ICONS_COMMUNITY_LIKE_PNG, + width: 40.w, + height: 40.w, ), + 5.wb, + '${widget.model.likes}' + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make(), 32.wb, - ], - ), - _renderLikeAndComment(), - - - ], - ), - ); - } - - _commentWidget(List? headSculptureImgUrl,String createName,DateTime? date,num? likeNamesNum){ - return Container( - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - [ - Material( - color: Color(0xFFF5F5F5), - borderRadius: BorderRadius.circular(48.w), - clipBehavior: Clip.antiAlias, - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API - .image(ImgModel.first(headSculptureImgUrl)), - height: 96.w, - width: 96.w, - fit: BoxFit.cover, - imageErrorBuilder: (context, error, stackTrace) { - return Image.asset( - R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - height: 86.w, - width: 86.w, - ); - }, - ), - ).paddingOnly(left: 32.w), - 20.wb, + ].row(), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - createName, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Colors.black.withOpacity(0.85), - fontSize: 30.sp, - fontWeight: FontWeight.w500), - ), - 12.hb, - BeeDateUtil(date) - .timeAgoWithHm - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 32.hb, + widget.model.content!.text + .size(28.sp) + .color(ktextSubColor) + .make(), + 32.hb, + _renderImage(), + 20.hb, + TopicWidgets( + topicTags: widget.model.topicTags, + ), + ], + ).paddingOnly(right: 32.w, left: 32.w), + + // Divider(height: 1.w, thickness: 1.w), + // 10.hb, + // Row( + // children: [ + // // 64.hb, + // + // Spacer(), + // _buildMoreButton(), + // 20.wb, + // ], + // ), + 20.hb, + //_buildLikeAndComment(), ], ), - Spacer(), - Image.asset(R.ASSETS_ICONS_COMMUNITY_LIKE_PNG,width: 40.w,height: 40.w,), - //Image.asset(widget.model!.isLike!=1? R.ASSETS_ICONS_COMMUNITY_LIKE_PNG:R.ASSETS_ICONS_COMMUNITY_LIKE_IS_PNG,width: 32.w,height: 32.w,), - 5.wb, - '${likeNamesNum}' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - 32.wb, - ].row(), - 20.hb, - widget.model!.content!.text.size(28.sp).color(ktextSubColor).make(), - - - ], - ).paddingOnly(top: 20.w), - ).marginOnly(top: 12.w, bottom: 12.w); + ], + ).paddingOnly(top: 20.w), + ).marginOnly(top: 12.w, bottom: 12.w), + ]).paddingOnly(bottom: 16.w); } + // _renderLikeAndComment() { + // if (widget.model!.likeNames!.isEmpty && + // widget.model!.gambitThemeCommentVoList!.isEmpty) return SizedBox(); + // return Material( + // borderRadius: BorderRadius.circular(8.w), + // color: Color(0xFFF7F7F7), + // child: Padding( + // padding: EdgeInsets.all(8.w), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // widget.model!.likeNames!.isEmpty ? SizedBox() : _renderLike(), + // 10.hb, + // (widget.model!.likeNames!.isNotEmpty && + // widget.model!.gambitThemeCommentVoList!.isNotEmpty) + // ? Divider(height: 1.w, thickness: 1.w) + // : SizedBox(), + // 10.hb, + // widget.model!.gambitThemeCommentVoList!.isEmpty + // ? SizedBox() + // : _renderComment(), + // ], + // ), + // ), + // ); + // } + } diff --git a/lib/ui/community/community_views/widgets/my_event_card.dart b/lib/ui/community/community_views/widgets/my_event_card.dart index 90145c01..47d23f6c 100644 --- a/lib/ui/community/community_views/widgets/my_event_card.dart +++ b/lib/ui/community/community_views/widgets/my_event_card.dart @@ -1,8 +1,7 @@ -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; -import 'package:aku_new_community/model/community/event_item_model.dart'; import 'package:aku_new_community/model/community/my_event_item_model.dart'; +import 'package:aku_new_community/models/community/dynamic_detail_model.dart'; import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/ui/community/community_views/event_detail_page.dart'; import 'package:aku_new_community/utils/bee_date_util.dart'; @@ -66,13 +65,16 @@ class MyEventCard extends StatelessWidget { .paddingOnly(left: 32.w, top: isFirst ? 0 : 64.w, bottom: 32.w) : SizedBox(), MaterialButton( - onPressed: () async{ + onPressed: () async { BaseModel models = await NetUtil().get( - API.community.getEventDetail, - params: {'themeId': model.id}, + SARSAPI.community.dynamicDetail, + params: {'dynamicId': model.id}, ); - EventItemModel eventItemModel = EventItemModel.fromJson(models.data); - Get.to(() => EventDetailPage(themeId: model.id, eventItemModel: eventItemModel,)); + DynamicDetailModel eventItemModel = + DynamicDetailModel.fromJson(models.data); + Get.to(() => EventDetailPage( + dynamicId: model.id ?? 0, + )); }, child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -100,7 +102,7 @@ class MyEventCard extends StatelessWidget { ), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrl)), + image: SARSAPI.image(ImgModel.first(model.imgUrl)), width: 152.w, height: 152.w, fit: BoxFit.cover, diff --git a/lib/ui/community/community_views/widgets/send_a_chat.dart b/lib/ui/community/community_views/widgets/send_a_chat.dart index 7952e555..439eda00 100644 --- a/lib/ui/community/community_views/widgets/send_a_chat.dart +++ b/lib/ui/community/community_views/widgets/send_a_chat.dart @@ -1,19 +1,22 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:flutter/material.dart'; + import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; + class SendAChat extends StatefulWidget { final FocusNode? node; SendAChat({Key? key, this.node}) : super(key: key); static Future send({ + required int? rootId, required int? parentId, - required int? themeId, + required int? dynamicId, }) async { FocusNode node = FocusNode(); node.requestFocus(); @@ -23,10 +26,11 @@ class SendAChat extends StatefulWidget { ); if (result != null) { await NetUtil().post( - API.community.sendAComment, + SARSAPI.community.commentInsert, params: { + 'rootId': rootId, 'parentId': parentId, - 'gambitThemeId': themeId, + 'dynamicId': dynamicId, 'content': result, }, showMessage: true, @@ -70,7 +74,7 @@ class _SendAChatState extends State { // enabledBorder: OutlineInputBorder( - borderSide: BorderSide.none, + borderSide: BorderSide.none, borderRadius: BorderRadius.circular(40.w), ), focusedBorder: OutlineInputBorder( @@ -81,7 +85,7 @@ class _SendAChatState extends State { ).p(16.w).expand(), 16.wb, GestureDetector( - onTap: (){ + onTap: () { Get.back(result: _textEditingController.text); }, child: Container( @@ -92,11 +96,7 @@ class _SendAChatState extends State { borderRadius: BorderRadius.all(Radius.circular(34.w)), ), alignment: Alignment.center, - child: '发布' - .text - .size(28.sp) - .color(Color(0xD9000000)) - .make(), + child: '发布'.text.size(28.sp).color(Color(0xD9000000)).make(), ), ), // MaterialButton( diff --git a/lib/ui/community/facility/facility_appointment_card.dart b/lib/ui/community/facility/facility_appointment_card.dart index 174a2f26..d083b811 100644 --- a/lib/ui/community/facility/facility_appointment_card.dart +++ b/lib/ui/community/facility/facility_appointment_card.dart @@ -1,14 +1,17 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/facility/facility_appointment_model.dart'; import 'package:aku_new_community/ui/common/qr_scan.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class FacilityAppointmentCard extends StatelessWidget { final FacilityAppointmentModel model; diff --git a/lib/ui/community/facility/facility_appointment_page.dart b/lib/ui/community/facility/facility_appointment_page.dart index 81581d24..1b504865 100644 --- a/lib/ui/community/facility/facility_appointment_page.dart +++ b/lib/ui/community/facility/facility_appointment_page.dart @@ -1,10 +1,12 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:get/get.dart'; + import 'package:aku_new_community/ui/community/facility/facility_appointment_view.dart'; import 'package:aku_new_community/ui/community/facility/pick_facility_page.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class FacilityAppointmentPage extends StatefulWidget { FacilityAppointmentPage({Key? key}) : super(key: key); diff --git a/lib/ui/community/facility/facility_appointment_view.dart b/lib/ui/community/facility/facility_appointment_view.dart index 360c52cf..54e30135 100644 --- a/lib/ui/community/facility/facility_appointment_view.dart +++ b/lib/ui/community/facility/facility_appointment_view.dart @@ -1,10 +1,13 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/facility/facility_appointment_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/community/facility/facility_appointment_card.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; enum FacilityAppointmentType { MY, @@ -50,9 +53,8 @@ class _FacilityAppointmentViewState extends State { return BeeListView( path: API.manager.facility.appointment, controller: _refreshController, - convert: (model) => model.tableList! - .map((e) => FacilityAppointmentModel.fromJson(e)) - .toList(), + convert: (model) => + model.rows.map((e) => FacilityAppointmentModel.fromJson(e)).toList(), extraParams: {'facilitiesType': _facilityType}, builder: (items) { return ListView.separated( diff --git a/lib/ui/community/facility/facility_type_card.dart b/lib/ui/community/facility/facility_type_card.dart index 98297375..991e7490 100644 --- a/lib/ui/community/facility/facility_type_card.dart +++ b/lib/ui/community/facility/facility_type_card.dart @@ -1,11 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/facility/facility_type_model.dart'; import 'package:aku_new_community/ui/community/facility/facility_preorder_page.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class FacilityTypeCard extends StatelessWidget { final FacilityTypeModel model; @@ -26,7 +29,7 @@ class FacilityTypeCard extends StatelessWidget { children: [ FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: SARSAPI.image(ImgModel.first(model.imgUrls)), height: 320.w, width: double.infinity, fit: BoxFit.cover, diff --git a/lib/ui/community/facility/facility_type_detail_page.dart b/lib/ui/community/facility/facility_type_detail_page.dart index 647fb5df..5398f209 100644 --- a/lib/ui/community/facility/facility_type_detail_page.dart +++ b/lib/ui/community/facility/facility_type_detail_page.dart @@ -1,12 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/facility/facility_type_detail_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; class FacilityTypeDetailPage extends StatefulWidget { final int id; diff --git a/lib/ui/community/facility/fcility_order_date_list_page.dart b/lib/ui/community/facility/fcility_order_date_list_page.dart index 1d823739..88bd3f1c 100644 --- a/lib/ui/community/facility/fcility_order_date_list_page.dart +++ b/lib/ui/community/facility/fcility_order_date_list_page.dart @@ -1,13 +1,16 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/facility/facility_order_date_list_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class FacilityOrderDateListPage extends StatefulWidget { final int facilitiesId; @@ -46,7 +49,7 @@ class _FacilityOrderDateListPageState extends State { }, controller: _refreshController, convert: (models) { - return models.tableList! + return models.rows .map((e) => FacilityOrderDateListModel.fromJson(e)) .toList(); }, diff --git a/lib/ui/community/facility/pick_facility_page.dart b/lib/ui/community/facility/pick_facility_page.dart index 896f2674..c3779ae3 100644 --- a/lib/ui/community/facility/pick_facility_page.dart +++ b/lib/ui/community/facility/pick_facility_page.dart @@ -1,11 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/facility/facility_type_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/community/facility/facility_type_card.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; class PickFacilityPage extends StatefulWidget { PickFacilityPage({Key? key}) : super(key: key); @@ -31,7 +34,7 @@ class _PickFacilityPageState extends State { path: API.manager.facility.type, controller: _refreshController, convert: (model) => - model.tableList!.map((e) => FacilityTypeModel.fromJson(e)).toList(), + model.rows.map((e) => FacilityTypeModel.fromJson(e)).toList(), builder: (items) { return ListView.separated( padding: EdgeInsets.all(32.w), diff --git a/lib/ui/community/notice/notice_card.dart b/lib/ui/community/notice/notice_card.dart index ba82c4f2..bfca65f5 100644 --- a/lib/ui/community/notice/notice_card.dart +++ b/lib/ui/community/notice/notice_card.dart @@ -1,14 +1,17 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/community/board_model.dart'; import 'package:aku_new_community/ui/community/notice/notice_detail_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class NoticeCard extends StatelessWidget { final BoardItemModel model; @@ -101,7 +104,7 @@ class NoticeCard extends StatelessWidget { '${ImgModel.first(model.imgUrls)}${model.hashCode}', child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: SARSAPI.image(ImgModel.first(model.imgUrls)), width: 152.w, height: 152.w, fit: BoxFit.cover, diff --git a/lib/ui/community/notice/notice_detail_page.dart b/lib/ui/community/notice/notice_detail_page.dart index 7d16f4c7..108e0603 100644 --- a/lib/ui/community/notice/notice_detail_page.dart +++ b/lib/ui/community/notice/notice_detail_page.dart @@ -1,5 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:open_file/open_file.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/community/board_detail_model.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; @@ -8,10 +15,6 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; import 'package:aku_new_community/widget/views/bee_download_view.dart'; import 'package:aku_new_community/widget/views/doc_view.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:open_file/open_file.dart'; class NoticeDetailPage extends StatefulWidget { final int? id; @@ -75,7 +78,7 @@ class _NoticeDetailPageState extends State { ), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(e.url), + image: SARSAPI.image(e.url), fit: BoxFit.cover, ), ), diff --git a/lib/ui/community/notice/notice_page.dart b/lib/ui/community/notice/notice_page.dart index da2934c3..fd1fe65b 100644 --- a/lib/ui/community/notice/notice_page.dart +++ b/lib/ui/community/notice/notice_page.dart @@ -1,11 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/community/board_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/community/notice/notice_card.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; class NoticePage extends StatefulWidget { NoticePage({Key? key}) : super(key: key); @@ -25,7 +28,7 @@ class _NoticePageState extends State { controller: _refreshController, path: API.community.boardList, convert: (model) => - model.tableList!.map((e) => BoardItemModel.fromJson(e)).toList(), + model.rows.map((e) => BoardItemModel.fromJson(e)).toList(), builder: (items) { return ListView.separated( padding: EdgeInsets.symmetric(vertical: 32.w), diff --git a/lib/ui/home/application/all_application.dart b/lib/ui/home/application/all_application.dart index 30bb257b..04901123 100644 --- a/lib/ui/home/application/all_application.dart +++ b/lib/ui/home/application/all_application.dart @@ -1,3 +1,11 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/application_objects.dart'; import 'package:aku_new_community/provider/app_provider.dart'; @@ -5,12 +13,6 @@ import 'package:aku_new_community/ui/search/bee_search.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/login_util.dart'; import 'package:aku_new_community/widget/bee_back_button.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; class AllApplicationPage extends StatefulWidget { AllApplicationPage({Key? key}) : super(key: key); diff --git a/lib/ui/home/home_notification.dart b/lib/ui/home/home_notification.dart index c4706d3e..fc1d6600 100644 --- a/lib/ui/home/home_notification.dart +++ b/lib/ui/home/home_notification.dart @@ -1,15 +1,17 @@ -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/model/community/board_model.dart'; -import 'package:aku_new_community/ui/community/notice/notice_page.dart'; -import 'package:aku_new_community/utils/bee_date_util.dart'; -import 'package:aku_new_community/utils/headers.dart'; -import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; + +import 'package:carousel_slider/carousel_slider.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/model/community/board_model.dart'; +import 'package:aku_new_community/ui/community/notice/notice_page.dart'; +import 'package:aku_new_community/utils/bee_date_util.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class HomeNotification extends StatefulWidget { final List items; diff --git a/lib/ui/home/home_title.dart b/lib/ui/home/home_title.dart index df61b408..704ee3f9 100644 --- a/lib/ui/home/home_title.dart +++ b/lib/ui/home/home_title.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class HomeTitle extends StatelessWidget { final String title; final String suffixTitle; diff --git a/lib/ui/home/public_infomation/public_infomation_card.dart b/lib/ui/home/public_infomation/public_infomation_card.dart index 9e1e123f..ea3720a1 100644 --- a/lib/ui/home/public_infomation/public_infomation_card.dart +++ b/lib/ui/home/public_infomation/public_infomation_card.dart @@ -1,12 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/news/news_item_model.dart'; import 'package:aku_new_community/ui/home/public_infomation/public_information_detail_page.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class PublicInfomationCard extends StatelessWidget { final NewsItemModel model; @@ -59,7 +62,7 @@ class PublicInfomationCard extends StatelessWidget { width: 240.w, height: 200.w, fit: BoxFit.cover, - image: API.image(ImgModel.first(model.imgList)), + image: SARSAPI.image(ImgModel.first(model.imgList)), ), ], ), diff --git a/lib/ui/home/public_infomation/public_infomation_page.dart b/lib/ui/home/public_infomation/public_infomation_page.dart index e04961e8..3bb2e957 100644 --- a/lib/ui/home/public_infomation/public_infomation_page.dart +++ b/lib/ui/home/public_infomation/public_infomation_page.dart @@ -1,8 +1,9 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/models/news/news_category_model.dart'; import 'package:aku_new_community/ui/home/public_infomation/public_infomation_view.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; -import 'package:flutter/material.dart'; class PublicInfomationPage extends StatefulWidget { final List models; diff --git a/lib/ui/home/public_infomation/public_infomation_view.dart b/lib/ui/home/public_infomation/public_infomation_view.dart index 37463955..e856a403 100644 --- a/lib/ui/home/public_infomation/public_infomation_view.dart +++ b/lib/ui/home/public_infomation/public_infomation_view.dart @@ -1,11 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/news/news_category_model.dart'; import 'package:aku_new_community/models/news/news_item_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/home/public_infomation/public_infomation_card.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; class PublicInfomationView extends StatefulWidget { final NewsCategoryModel model; @@ -28,7 +31,7 @@ class _PublicInfomationViewState extends State controller: _refreshController, extraParams: {'newsCategoryId': widget.model.id}, convert: (model) => - model.tableList!.map((e) => NewsItemModel.fromJson(e)).toList(), + model.rows.map((e) => NewsItemModel.fromJson(e)).toList(), builder: (items) { return ListView.separated( padding: EdgeInsets.symmetric(vertical: 24.w), diff --git a/lib/ui/home/public_infomation/public_information_detail_page.dart b/lib/ui/home/public_infomation/public_information_detail_page.dart index 107a847c..7d8806d1 100644 --- a/lib/ui/home/public_infomation/public_information_detail_page.dart +++ b/lib/ui/home/public_infomation/public_information_detail_page.dart @@ -1,21 +1,24 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/models/news/news_detail_model.dart'; -import 'package:aku_new_community/utils/link_text_parase.dart'; -import 'package:aku_new_community/utils/network/base_model.dart'; -import 'package:aku_new_community/utils/network/net_util.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/models/news/news_detail_model.dart'; +import 'package:aku_new_community/utils/link_text_parase.dart'; +import 'package:aku_new_community/utils/network/base_model.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class PublicInformationDetailPage extends StatefulWidget { final int id; diff --git a/lib/ui/manager/advice/advice_add_comment_page.dart b/lib/ui/manager/advice/advice_add_comment_page.dart index 099c3f6b..a92dceb2 100644 --- a/lib/ui/manager/advice/advice_add_comment_page.dart +++ b/lib/ui/manager/advice/advice_add_comment_page.dart @@ -1,13 +1,16 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class AdviceAddCommentPage extends StatefulWidget { final int? id; diff --git a/lib/ui/manager/advice/advice_card.dart b/lib/ui/manager/advice/advice_card.dart index daf3a6a3..70063e86 100644 --- a/lib/ui/manager/advice/advice_card.dart +++ b/lib/ui/manager/advice/advice_card.dart @@ -1,13 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_rating_bar/flutter_rating_bar.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/manager/suggestion_or_complain_model.dart'; import 'package:aku_new_community/ui/manager/advice/advice_detail_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/views/horizontal_image_view.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_rating_bar/flutter_rating_bar.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class AdviceCard extends StatefulWidget { final SuggestionOrComplainModel? model; diff --git a/lib/ui/manager/advice/advice_detail_page.dart b/lib/ui/manager/advice/advice_detail_page.dart index 56bfdd04..5d946d09 100644 --- a/lib/ui/manager/advice/advice_detail_page.dart +++ b/lib/ui/manager/advice/advice_detail_page.dart @@ -1,6 +1,17 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:dio/dio.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart' hide Response; +import 'package:shimmer/shimmer.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/manager/advice_detail_model.dart'; import 'package:aku_new_community/model/manager/suggestion_or_complain_model.dart'; import 'package:aku_new_community/ui/manager/advice/advice_add_comment_page.dart'; @@ -11,14 +22,6 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/views/bee_grid_image_view.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:dio/dio.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart' hide Response; -import 'package:shimmer/shimmer.dart'; -import 'package:velocity_x/velocity_x.dart'; class AdviceDetailPage extends StatefulWidget { final SuggestionOrComplainModel? model; diff --git a/lib/ui/manager/advice/advice_evaluate_page.dart b/lib/ui/manager/advice/advice_evaluate_page.dart index 955ba12d..350b9d1b 100644 --- a/lib/ui/manager/advice/advice_evaluate_page.dart +++ b/lib/ui/manager/advice/advice_evaluate_page.dart @@ -1,13 +1,16 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_rating_bar/flutter_rating_bar.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_rating_bar/flutter_rating_bar.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class AdviceEvaluatePage extends StatefulWidget { final int? id; diff --git a/lib/ui/manager/advice/advice_page.dart b/lib/ui/manager/advice/advice_page.dart index 57ed84fd..69616f68 100644 --- a/lib/ui/manager/advice/advice_page.dart +++ b/lib/ui/manager/advice/advice_page.dart @@ -1,5 +1,13 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/manager/suggestion_or_complain_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/manager/advice/advice_card.dart'; @@ -13,11 +21,6 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/buttons/radio_button.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; enum AdviceType { SUGGESTION, @@ -111,7 +114,7 @@ class _AdvicePageState extends State with TickerProviderStateMixin { path: API.manager.advice, extraParams: {'adviceType': adviceValue(index)}, controller: _refreshController, - convert: (model) => model.tableList! + convert: (model) => model.rows .map((e) => SuggestionOrComplainModel.fromJson(e)) .toList(), builder: (items) { diff --git a/lib/ui/manager/advice/new_advice_page.dart b/lib/ui/manager/advice/new_advice_page.dart index 86189bb3..ab45d3b1 100644 --- a/lib/ui/manager/advice/new_advice_page.dart +++ b/lib/ui/manager/advice/new_advice_page.dart @@ -1,8 +1,19 @@ import 'dart:io'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/ui/manager/advice/advice_page.dart'; import 'package:aku_new_community/utils/headers.dart'; @@ -11,14 +22,6 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/picker/grid_image_picker.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; class NewAdvicePage extends StatefulWidget { final AdviceType type; diff --git a/lib/ui/manager/house_keeping/add_house_keeping_page.dart b/lib/ui/manager/house_keeping/add_house_keeping_page.dart index 9b89461d..3d3a4472 100644 --- a/lib/ui/manager/house_keeping/add_house_keeping_page.dart +++ b/lib/ui/manager/house_keeping/add_house_keeping_page.dart @@ -1,7 +1,16 @@ import 'dart:io'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/ui/manager/house_keeping/house_keeping_func.dart'; import 'package:aku_new_community/ui/manager/house_keeping/house_keeping_submit_page.dart'; @@ -12,12 +21,6 @@ import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/house_head_card.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/grid_image_picker.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; -import 'package:velocity_x/velocity_x.dart'; class AddHouseKeepingPage extends StatefulWidget { AddHouseKeepingPage({Key? key}) : super(key: key); diff --git a/lib/ui/manager/house_keeping/evaluate_page.dart b/lib/ui/manager/house_keeping/evaluate_page.dart index 74c9d8a7..16b72998 100644 --- a/lib/ui/manager/house_keeping/evaluate_page.dart +++ b/lib/ui/manager/house_keeping/evaluate_page.dart @@ -1,17 +1,19 @@ import 'dart:io'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_rating_bar/flutter_rating_bar.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/ui/manager/house_keeping/house_keeping_func.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/picker/grid_image_picker.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_rating_bar/flutter_rating_bar.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; class EvaluatePage extends StatefulWidget { final int id; diff --git a/lib/ui/manager/house_keeping/house_keeping_card.dart b/lib/ui/manager/house_keeping/house_keeping_card.dart index e4afdfdc..1fb35436 100644 --- a/lib/ui/manager/house_keeping/house_keeping_card.dart +++ b/lib/ui/manager/house_keeping/house_keeping_card.dart @@ -1,6 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/house_keeping/house_keeping_list_model.dart'; import 'package:aku_new_community/models/house_keeping/house_keeping_process_model.dart'; import 'package:aku_new_community/ui/manager/house_keeping/house_keeping_detail_page.dart'; @@ -8,12 +17,6 @@ import 'package:aku_new_community/ui/manager/house_keeping/house_keeping_func.da import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; import 'package:aku_new_community/widget/others/aku_chip_box.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class HouseKeepingCard extends StatelessWidget { final HouseKeepingListModel model; @@ -121,7 +124,7 @@ class HouseKeepingCard extends StatelessWidget { clipBehavior: Clip.antiAlias, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(imgObj ?? '')), + image: SARSAPI.image(imgObj ?? '')), ); }, itemCount: model.submitImgList.length, diff --git a/lib/ui/manager/house_keeping/house_keeping_detail_page.dart b/lib/ui/manager/house_keeping/house_keeping_detail_page.dart index 3c15bf68..c6619943 100644 --- a/lib/ui/manager/house_keeping/house_keeping_detail_page.dart +++ b/lib/ui/manager/house_keeping/house_keeping_detail_page.dart @@ -1,6 +1,18 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_rating_bar/flutter_rating_bar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/house_keeping/house_keeping_list_model.dart'; import 'package:aku_new_community/models/house_keeping/house_keeping_process_model.dart'; import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart'; @@ -12,15 +24,6 @@ import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/views/bee_grid_image_view.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_rating_bar/flutter_rating_bar.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; -import 'package:velocity_x/velocity_x.dart'; class HouseKeepingDetailPage extends StatefulWidget { final HouseKeepingListModel model; diff --git a/lib/ui/manager/house_keeping/house_keeping_func.dart b/lib/ui/manager/house_keeping/house_keeping_func.dart index 6c51f8a5..f19cca8c 100644 --- a/lib/ui/manager/house_keeping/house_keeping_func.dart +++ b/lib/ui/manager/house_keeping/house_keeping_func.dart @@ -1,10 +1,12 @@ import 'dart:io'; +import 'package:bot_toast/bot_toast.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/house_keeping/house_keeping_process_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; -import 'package:bot_toast/bot_toast.dart'; class HouseKeepingFunc { ///提交新增家政服务 diff --git a/lib/ui/manager/house_keeping/house_keeping_page.dart b/lib/ui/manager/house_keeping/house_keeping_page.dart index 41b86877..f0b3638a 100644 --- a/lib/ui/manager/house_keeping/house_keeping_page.dart +++ b/lib/ui/manager/house_keeping/house_keeping_page.dart @@ -1,3 +1,10 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/ui/manager/house_keeping/add_house_keeping_page.dart'; import 'package:aku_new_community/ui/manager/house_keeping/house_keeping_view.dart'; import 'package:aku_new_community/utils/hive_store.dart'; @@ -5,11 +12,6 @@ import 'package:aku_new_community/utils/websocket/tips_dialog.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class HouseKeepingPage extends StatefulWidget { HouseKeepingPage({Key? key}) : super(key: key); diff --git a/lib/ui/manager/house_keeping/house_keeping_submit_page.dart b/lib/ui/manager/house_keeping/house_keeping_submit_page.dart index c82b3225..f16ba455 100644 --- a/lib/ui/manager/house_keeping/house_keeping_submit_page.dart +++ b/lib/ui/manager/house_keeping/house_keeping_submit_page.dart @@ -1,10 +1,12 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/others/finish_result_image.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/finish_result_image.dart'; + class HouseKeepingSubmitPage extends StatefulWidget { HouseKeepingSubmitPage({Key? key}) : super(key: key); diff --git a/lib/ui/manager/house_keeping/house_keeping_view.dart b/lib/ui/manager/house_keeping/house_keeping_view.dart index 47fadc4d..bd58a1fc 100644 --- a/lib/ui/manager/house_keeping/house_keeping_view.dart +++ b/lib/ui/manager/house_keeping/house_keeping_view.dart @@ -1,12 +1,15 @@ -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/models/house_keeping/house_keeping_list_model.dart'; -import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; -import 'package:aku_new_community/ui/manager/house_keeping/house_keeping_card.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/models/house_keeping/house_keeping_list_model.dart'; +import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; +import 'package:aku_new_community/ui/manager/house_keeping/house_keeping_card.dart'; + class HouseKeepingView extends StatefulWidget { final int index; @@ -42,7 +45,7 @@ class _HouseKeepingViewState extends State "housekeepingStatus": widget.index == 0 ? null : widget.index }, convert: (models) { - return models.tableList! + return models.rows .map((e) => HouseKeepingListModel.fromJson(e)) .toList(); }, diff --git a/lib/ui/manager/questionnaire/questionnaire_detail_page.dart b/lib/ui/manager/questionnaire/questionnaire_detail_page.dart index 0ad527b2..43c74238 100644 --- a/lib/ui/manager/questionnaire/questionnaire_detail_page.dart +++ b/lib/ui/manager/questionnaire/questionnaire_detail_page.dart @@ -1,6 +1,13 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/manager/questionnaire_detail_model.dart'; import 'package:aku_new_community/model/manager/quetionnaire_submit_model.dart'; @@ -14,10 +21,6 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; class QuestionnaireDetailPage extends StatefulWidget { final int? id; @@ -226,7 +229,7 @@ class _QuestionnaireDetailPageState extends State { clipBehavior: Clip.antiAlias, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image( + image: SARSAPI.image( ImgModel.first(_model.voResourcesImgList), ), ), diff --git a/lib/ui/manager/questionnaire/questionnaire_page.dart b/lib/ui/manager/questionnaire/questionnaire_page.dart index 385be67d..fee99729 100644 --- a/lib/ui/manager/questionnaire/questionnaire_page.dart +++ b/lib/ui/manager/questionnaire/questionnaire_page.dart @@ -1,5 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/manager/questinnaire_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; @@ -9,10 +16,6 @@ import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/utils/websocket/tips_dialog.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/stack_avatar.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; class QuestionnairePage extends StatefulWidget { QuestionnairePage({Key? key}) : super(key: key); @@ -79,7 +82,7 @@ class _QuestionnairePageState extends State { child: ClipRRect( child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: SARSAPI.image(ImgModel.first(model.imgUrls)), ), ), ), @@ -173,7 +176,7 @@ class _QuestionnairePageState extends State { path: API.manager.questionnaireList, controller: _easyRefreshController, convert: (model) { - return model.tableList! + return model.rows .map((e) => QuestionnaireModel.fromJson(e)) .toList(); }, diff --git a/lib/ui/manager/questionnaire/questionnaire_siglecheck.dart b/lib/ui/manager/questionnaire/questionnaire_siglecheck.dart index 7ad00d06..7745ada8 100644 --- a/lib/ui/manager/questionnaire/questionnaire_siglecheck.dart +++ b/lib/ui/manager/questionnaire/questionnaire_siglecheck.dart @@ -1,7 +1,8 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/model/manager/questionnaire_detail_model.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/buttons/bee_single_check.dart'; -import 'package:flutter/material.dart'; class QuestionnaireSingleCheck extends StatefulWidget { final String? title; diff --git a/lib/ui/manager/questionnaire/questionnaire_truefalse.dart b/lib/ui/manager/questionnaire/questionnaire_truefalse.dart index cec5c473..d438007c 100644 --- a/lib/ui/manager/questionnaire/questionnaire_truefalse.dart +++ b/lib/ui/manager/questionnaire/questionnaire_truefalse.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/widget/buttons/bee_single_check.dart'; import 'package:flutter/material.dart'; + import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/buttons/bee_single_check.dart'; + class QuestionnaireTruefalse extends StatefulWidget { final String? title; final int? selected; diff --git a/lib/ui/manager/questionnaire/questionnarie_raido_check.dart b/lib/ui/manager/questionnaire/questionnarie_raido_check.dart index 9e7ca506..539461ec 100644 --- a/lib/ui/manager/questionnaire/questionnarie_raido_check.dart +++ b/lib/ui/manager/questionnaire/questionnarie_raido_check.dart @@ -1,7 +1,8 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/model/manager/questionnaire_detail_model.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/buttons/bee_check_radio.dart'; -import 'package:flutter/material.dart'; class QuestionnaireRadioCheck extends StatefulWidget { final String? title; diff --git a/lib/ui/manager/questionnaire/submit_complish_page.dart b/lib/ui/manager/questionnaire/submit_complish_page.dart index 8ef5ba4e..34fd29bb 100644 --- a/lib/ui/manager/questionnaire/submit_complish_page.dart +++ b/lib/ui/manager/questionnaire/submit_complish_page.dart @@ -1,12 +1,14 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/others/finish_result_image.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/finish_result_image.dart'; + class SubmitComplishPage extends StatelessWidget { final bool? status; final String? message; diff --git a/lib/ui/manager/visitor/visitor_list_item.dart b/lib/ui/manager/visitor/visitor_list_item.dart index b4d3cd97..b809eb4f 100644 --- a/lib/ui/manager/visitor/visitor_list_item.dart +++ b/lib/ui/manager/visitor/visitor_list_item.dart @@ -1,15 +1,18 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/manager/visitor_list_item_model.dart'; import 'package:aku_new_community/ui/manager/visitor/visitor_passport_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class VisitorListItem extends StatefulWidget { final VisitorListItemModel model; diff --git a/lib/ui/manager/visitor/visitor_passport_page.dart b/lib/ui/manager/visitor/visitor_passport_page.dart index eef139b4..d03363a5 100644 --- a/lib/ui/manager/visitor/visitor_passport_page.dart +++ b/lib/ui/manager/visitor/visitor_passport_page.dart @@ -1,6 +1,16 @@ import 'dart:typed_data'; import 'dart:ui' as ui; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/services.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:fluwx/fluwx.dart'; +import 'package:qr_flutter/qr_flutter.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/app_theme.dart'; @@ -8,14 +18,7 @@ import 'package:aku_new_community/model/manager/visitor_list_item_model.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_back_button.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/services.dart'; -import 'package:fluwx/fluwx.dart'; -import 'package:qr_flutter/qr_flutter.dart'; -import 'package:velocity_x/velocity_x.dart'; + // import 'package:qr_flutter/qr_flutter.dart'; class VisitorPassportPage extends StatefulWidget { diff --git a/lib/ui/manager/visitor/visitor_record_page.dart b/lib/ui/manager/visitor/visitor_record_page.dart index 9fe3942d..26cbe4d8 100644 --- a/lib/ui/manager/visitor/visitor_record_page.dart +++ b/lib/ui/manager/visitor/visitor_record_page.dart @@ -1,8 +1,9 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + import 'package:aku_new_community/ui/manager/visitor/visitor_record_view.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; class VisitorRecordPage extends StatefulWidget { VisitorRecordPage({Key? key}) : super(key: key); diff --git a/lib/ui/manager/visitor/visitor_record_view.dart b/lib/ui/manager/visitor/visitor_record_view.dart index 4d595cab..0867fa06 100644 --- a/lib/ui/manager/visitor/visitor_record_view.dart +++ b/lib/ui/manager/visitor/visitor_record_view.dart @@ -1,10 +1,13 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/manager/visitor_list_item_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/manager/visitor/visitor_list_item.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; class VisitorRecordView extends StatefulWidget { ///访客状态(1.已分享,2.已提交,3.已到期) @@ -32,9 +35,7 @@ class _VisitorRecordViewState extends State { path: API.manager.visitorAccessList, extraParams: {'visitorInviteStatus': widget.type}, convert: (model) { - return model.tableList! - .map((e) => VisitorListItemModel.fromJson(e)) - .toList(); + return model.rows.map((e) => VisitorListItemModel.fromJson(e)).toList(); }, builder: (items) { return ListView.separated( diff --git a/lib/ui/market/category/new_category_page.dart b/lib/ui/market/category/new_category_page.dart index 27257db8..fd86fa89 100644 --- a/lib/ui/market/category/new_category_page.dart +++ b/lib/ui/market/category/new_category_page.dart @@ -1,10 +1,10 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/market/market_all_category_model.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - import 'new_category_sub_view.dart'; class NewCategoryPage extends StatefulWidget { diff --git a/lib/ui/market/category/new_category_sub_card.dart b/lib/ui/market/category/new_category_sub_card.dart index f3a3e827..1c614d55 100644 --- a/lib/ui/market/category/new_category_sub_card.dart +++ b/lib/ui/market/category/new_category_sub_card.dart @@ -1,9 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:get/get.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/market/market_all_category_model.dart'; import 'package:aku_new_community/ui/market/search/search_goods_page.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class NewCategorySubCard extends StatelessWidget { final MarketAllCategoryModel subModels; @@ -20,7 +23,7 @@ class NewCategorySubCard extends StatelessWidget { children: [ Spacer(), FadeInImage.assetNetwork( - image: API.image( + image: SARSAPI.image( subModels.imgUrls.isNotEmpty ? subModels.imgUrls.first : ''), //subModels.imgUrls!.isNotEmpty? subModels.imgUrls!.first :'', placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, diff --git a/lib/ui/market/category/new_category_sub_view.dart b/lib/ui/market/category/new_category_sub_view.dart index 57ccbbd3..8ee57bd6 100644 --- a/lib/ui/market/category/new_category_sub_view.dart +++ b/lib/ui/market/category/new_category_sub_view.dart @@ -1,7 +1,7 @@ -import 'package:aku_new_community/models/market/market_all_category_model.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/models/market/market_all_category_model.dart'; +import 'package:aku_new_community/utils/headers.dart'; import 'new_category_sub_card.dart'; class NewCategorySubView extends StatefulWidget { diff --git a/lib/ui/market/collection/collection_func.dart b/lib/ui/market/collection/collection_func.dart index 4e576b1f..fd2cff89 100644 --- a/lib/ui/market/collection/collection_func.dart +++ b/lib/ui/market/collection/collection_func.dart @@ -1,3 +1,4 @@ +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/collection/collection_goods_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; diff --git a/lib/ui/market/collection/collection_list_card.dart b/lib/ui/market/collection/collection_list_card.dart index ae620da9..b6154147 100644 --- a/lib/ui/market/collection/collection_list_card.dart +++ b/lib/ui/market/collection/collection_list_card.dart @@ -1,9 +1,11 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/collection/collection_goods_model.dart'; import 'package:aku_new_community/ui/market/collection/collection_func.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; class CollectionListCard extends StatelessWidget { final CollectionGoodsModel model; diff --git a/lib/ui/market/collection/my_collection.dart b/lib/ui/market/collection/my_collection.dart index 2b689f9e..e4910351 100644 --- a/lib/ui/market/collection/my_collection.dart +++ b/lib/ui/market/collection/my_collection.dart @@ -1,11 +1,12 @@ -import 'package:aku_new_community/models/collection/collection_goods_model.dart'; -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; +import 'package:aku_new_community/models/collection/collection_goods_model.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'collection_func.dart'; import 'collection_list_card.dart'; @@ -84,7 +85,7 @@ class MyCollectionPageState extends State { // extraParams: { // "keyword":_searchText, // }, - // convert: (model) => model.tableList! + // convert: (model) => model.rows! // .map((e) => CollectionGoodsModel.fromJson(e)) // .toList(), // builder: (items) { diff --git a/lib/ui/market/integral/integral_exchange_page.dart b/lib/ui/market/integral/integral_exchange_page.dart index 5f10ad09..41ea33cf 100644 --- a/lib/ui/market/integral/integral_exchange_page.dart +++ b/lib/ui/market/integral/integral_exchange_page.dart @@ -1,12 +1,14 @@ -import 'package:aku_new_community/gen/assets.gen.dart'; -import 'package:aku_new_community/ui/market/integral/integral_sku_model.dart'; -import 'package:aku_new_community/ui/market/search/good_detail_page.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/ui/market/integral/integral_sku_model.dart'; +import 'package:aku_new_community/ui/market/search/good_detail_page.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class IntegralExchangePage extends StatefulWidget { const IntegralExchangePage({Key? key}) : super(key: key); diff --git a/lib/ui/market/market_home_goods_card.dart b/lib/ui/market/market_home_goods_card.dart index 1e4332c9..3b41f507 100644 --- a/lib/ui/market/market_home_goods_card.dart +++ b/lib/ui/market/market_home_goods_card.dart @@ -1,9 +1,11 @@ +import 'package:flutter/material.dart'; + +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/market/order/goods_home_model.dart'; import 'package:aku_new_community/ui/market/search/good_detail_page.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class MarketHomeGoodsCard extends StatelessWidget { final GoodsHomeModel item; diff --git a/lib/ui/market/market_page.dart b/lib/ui/market/market_page.dart index 8d2aa6df..1b0c4159 100644 --- a/lib/ui/market/market_page.dart +++ b/lib/ui/market/market_page.dart @@ -2,8 +2,18 @@ import 'dart:ui' as ui; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:card_swiper/card_swiper.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/model/good/market_swiper_model.dart'; @@ -25,13 +35,6 @@ import 'package:aku_new_community/utils/network/base_list_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/home/home_sliver_app_bar.dart'; import 'package:aku_new_community/widget/others/rectIndicator.dart'; -import 'package:card_swiper/card_swiper.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; - import 'category/new_category_page.dart'; import 'market_home_goods_card.dart'; import 'order/order_page.dart'; @@ -90,12 +93,11 @@ class _MarketPageState extends State 'orderByPrice': orderByPrice, }, ); - if (baseListModel.tableList!.isNotEmpty) { - _goodsHomeModelList = (baseListModel.tableList as List) - .map((e) => GoodsHomeModel.fromJson(e)) - .toList(); + if (baseListModel.rows.isNotEmpty) { + _goodsHomeModelList = + (baseListModel.rows).map((e) => GoodsHomeModel.fromJson(e)).toList(); } - _pageCount = baseListModel.pageCount!; + _pageCount = baseListModel.total; } Future loadMarketInfo() async { @@ -108,12 +110,11 @@ class _MarketPageState extends State 'orderByPrice': orderByPrice, }, ); - if (baseListModel.tableList!.isNotEmpty) { - _goodsHomeModelList.addAll((baseListModel.tableList as List) - .map((e) => GoodsHomeModel.fromJson(e)) - .toList()); + if (baseListModel.rows.isNotEmpty) { + _goodsHomeModelList.addAll( + (baseListModel.rows).map((e) => GoodsHomeModel.fromJson(e)).toList()); } - _pageCount = baseListModel.pageCount!; + _pageCount = baseListModel.total; } @override @@ -168,7 +169,7 @@ class _MarketPageState extends State onLoad: () async { _pageNum++; await loadMarketInfo(); - if (_pageCount <= _pageNum) { + if (_goodsHomeModelList.length >= _pageCount) { _refreshController.finishLoad(noMore: false); } setState(() {}); @@ -760,7 +761,7 @@ class _MarketPageState extends State ), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(swiperModel.imgList!.isNotEmpty + image: SARSAPI.image(swiperModel.imgList!.isNotEmpty ? swiperModel.imgList!.first.url : ''), fit: BoxFit.fill, diff --git a/lib/ui/market/order/logistics_page.dart b/lib/ui/market/order/logistics_page.dart index a15d1d44..ec4463ca 100644 --- a/lib/ui/market/order/logistics_page.dart +++ b/lib/ui/market/order/logistics_page.dart @@ -1,12 +1,13 @@ import 'dart:ui'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/model/order/logistics_model.dart'; import 'package:aku_new_community/model/order/order_list_model.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; class LogisticsPage extends StatefulWidget { final List models; diff --git a/lib/ui/market/order/order_card.dart b/lib/ui/market/order/order_card.dart index aaff17c0..8fb4b5f3 100644 --- a/lib/ui/market/order/order_card.dart +++ b/lib/ui/market/order/order_card.dart @@ -1,5 +1,15 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/order/order_list_model.dart'; import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart'; @@ -10,13 +20,6 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/buttons/line_button.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; - import 'order_detail_page.dart'; class OrderCard extends StatefulWidget { diff --git a/lib/ui/market/order/order_detail_page.dart b/lib/ui/market/order/order_detail_page.dart index 986d82d9..b29e351e 100644 --- a/lib/ui/market/order/order_detail_page.dart +++ b/lib/ui/market/order/order_detail_page.dart @@ -1,8 +1,18 @@ import 'dart:async'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/order/logistics_model.dart'; import 'package:aku_new_community/model/order/order_list_model.dart'; @@ -13,13 +23,6 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/line_button.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; - import 'logistics_page.dart'; import 'order_page.dart'; diff --git a/lib/ui/market/order/order_page.dart b/lib/ui/market/order/order_page.dart index e55a0acd..f52898f7 100644 --- a/lib/ui/market/order/order_page.dart +++ b/lib/ui/market/order/order_page.dart @@ -1,8 +1,9 @@ -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; import 'order_view.dart'; class OrderPage extends StatefulWidget { diff --git a/lib/ui/market/order/order_view.dart b/lib/ui/market/order/order_view.dart index 42139a49..7d172a6c 100644 --- a/lib/ui/market/order/order_view.dart +++ b/lib/ui/market/order/order_view.dart @@ -1,10 +1,12 @@ -import 'package:aku_new_community/constants/sars_api.dart'; -import 'package:aku_new_community/model/order/order_list_model.dart'; -import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/model/order/order_list_model.dart'; +import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'order_card.dart'; class OrderView extends StatefulWidget { @@ -38,9 +40,7 @@ class _OrderViewState extends State { controller: _refreshController, extraParams: {"tradeStatus": widget.index, 'orderCode': null}, convert: (models) { - return models.tableList! - .map((e) => OrderListModel.fromJson(e)) - .toList(); + return models.rows.map((e) => OrderListModel.fromJson(e)).toList(); }, builder: (items) { return ListView.builder( diff --git a/lib/ui/market/order/receive_success.dart b/lib/ui/market/order/receive_success.dart index c21b5a15..4b0bf7c9 100644 --- a/lib/ui/market/order/receive_success.dart +++ b/lib/ui/market/order/receive_success.dart @@ -1,12 +1,14 @@ -import 'package:aku_new_community/pages/tab_navigator.dart'; -import 'package:aku_new_community/ui/profile/order/order_page.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/pages/tab_navigator.dart'; +import 'package:aku_new_community/ui/profile/order/order_page.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class ReceiveSuccess extends StatefulWidget { final bool integralGood; final int? integral; diff --git a/lib/ui/market/search/good_detail_bottomSheet.dart b/lib/ui/market/search/good_detail_bottomSheet.dart index ddefe1f5..037b279a 100644 --- a/lib/ui/market/search/good_detail_bottomSheet.dart +++ b/lib/ui/market/search/good_detail_bottomSheet.dart @@ -6,11 +6,14 @@ * remark : * ==================================================== */ + +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/market/good_detail_model.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; class GoodDetailBottomSheet extends StatefulWidget { final GoodDetailModel goodDetail; diff --git a/lib/ui/market/search/good_detail_page.dart b/lib/ui/market/search/good_detail_page.dart index 2d3875c2..257659ce 100644 --- a/lib/ui/market/search/good_detail_page.dart +++ b/lib/ui/market/search/good_detail_page.dart @@ -1,5 +1,13 @@ import 'dart:async'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/model/user/adress_model.dart'; @@ -13,13 +21,6 @@ import 'package:aku_new_community/ui/market/shop_car/shop_car_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; - import 'good_detail_bottomSheet.dart'; class GoodDetailPage extends StatefulWidget { diff --git a/lib/ui/market/search/goods_list_card.dart b/lib/ui/market/search/goods_list_card.dart index f9f1ef86..5c9e6567 100644 --- a/lib/ui/market/search/goods_list_card.dart +++ b/lib/ui/market/search/goods_list_card.dart @@ -1,11 +1,12 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/models/search/search_goods_model.dart'; -import 'package:aku_new_community/ui/market/collection/collection_func.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/models/search/search_goods_model.dart'; +import 'package:aku_new_community/ui/market/collection/collection_func.dart'; +import 'package:aku_new_community/utils/headers.dart'; import 'good_detail_page.dart'; class GoodsListCard extends StatefulWidget { diff --git a/lib/ui/market/search/search_func.dart b/lib/ui/market/search/search_func.dart index 628508f6..036c344f 100644 --- a/lib/ui/market/search/search_func.dart +++ b/lib/ui/market/search/search_func.dart @@ -1,4 +1,6 @@ import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/market/good_detail_model.dart'; import 'package:aku_new_community/models/market/order/order_detail_model.dart'; @@ -47,8 +49,8 @@ class SearchFunc { API.market.findGoodsList, params: params, ); - if (model.tableList!.length == 0) return []; - return model.tableList!.map((e) => SearchGoodsModel.fromJson(e)).toList(); + if (model.rows.length == 0) return []; + return model.rows.map((e) => SearchGoodsModel.fromJson(e)).toList(); } ///查询商品详情 diff --git a/lib/ui/market/search/search_goods_page.dart b/lib/ui/market/search/search_goods_page.dart index f048054d..eee2a1af 100644 --- a/lib/ui/market/search/search_goods_page.dart +++ b/lib/ui/market/search/search_goods_page.dart @@ -1,5 +1,14 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; +import 'package:waterfall_flow/waterfall_flow.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/market/goods_popular_model.dart'; import 'package:aku_new_community/models/search/search_goods_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; @@ -10,13 +19,6 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/utils/text_utils.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; -import 'package:waterfall_flow/waterfall_flow.dart'; - import '../search_goods_card.dart'; import 'good_detail_page.dart'; import 'goods_list_card.dart'; @@ -376,7 +378,7 @@ class SearchGoodsPageState extends State { // path: API.market.search, // controller: _refreshController, // extraParams: {'searchName': ''}, - // convert: (model) => model.tableList! + // convert: (model) => model.rows! // .map((e) => GoodsItem.fromJson(e)) // .toList(), // builder: (items) { @@ -446,7 +448,7 @@ class SearchGoodsPageState extends State { "maxPrice": maxPrice, 'categoryThirdId': widget.categoryId, }, - convert: (model) => model.tableList! + convert: (model) => model.rows .map((e) => SearchGoodsModel.fromJson(e)) .toList(), builder: (items) { diff --git a/lib/ui/market/search/submit_order_page.dart b/lib/ui/market/search/submit_order_page.dart index a2d2dbac..f11d19ae 100644 --- a/lib/ui/market/search/submit_order_page.dart +++ b/lib/ui/market/search/submit_order_page.dart @@ -1,6 +1,18 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/order/create_order_model.dart'; import 'package:aku_new_community/model/user/adress_model.dart'; @@ -16,14 +28,6 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/end_button.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; class SubmitOrderPage extends StatefulWidget { final List models; diff --git a/lib/ui/market/search/submit_order_page_normal.dart b/lib/ui/market/search/submit_order_page_normal.dart index 864389f8..d96126bd 100644 --- a/lib/ui/market/search/submit_order_page_normal.dart +++ b/lib/ui/market/search/submit_order_page_normal.dart @@ -1,5 +1,15 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/model/order/create_order_model.dart'; @@ -16,12 +26,6 @@ import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/end_button.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; class SubmitOrderNormalPage extends StatefulWidget { final GoodDetailModel goodModel; diff --git a/lib/ui/market/search_goods_card.dart b/lib/ui/market/search_goods_card.dart index 63492c45..35431e2f 100644 --- a/lib/ui/market/search_goods_card.dart +++ b/lib/ui/market/search_goods_card.dart @@ -1,11 +1,12 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/models/search/search_goods_model.dart'; -import 'package:aku_new_community/ui/market/search/good_detail_page.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/models/search/search_goods_model.dart'; +import 'package:aku_new_community/ui/market/search/good_detail_page.dart'; +import 'package:aku_new_community/utils/headers.dart'; import 'collection/collection_func.dart'; class SearchGoodsCard extends StatefulWidget { diff --git a/lib/ui/market/shop_car/shop_car_page.dart b/lib/ui/market/shop_car/shop_car_page.dart index aa44b379..a3b77aec 100644 --- a/lib/ui/market/shop_car/shop_car_page.dart +++ b/lib/ui/market/shop_car/shop_car_page.dart @@ -1,5 +1,16 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/market/shop_car/shop_car_list_model.dart'; import 'package:aku_new_community/ui/market/search/submit_order_page.dart'; @@ -10,14 +21,6 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bee_check_radio.dart'; import 'package:aku_new_community/widget/buttons/end_button.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class ShopCarPage extends StatefulWidget { const ShopCarPage({Key? key}) : super(key: key); diff --git a/lib/ui/market/widget/market_app_bar.dart b/lib/ui/market/widget/market_app_bar.dart index 41d30f1b..a7c8b980 100644 --- a/lib/ui/market/widget/market_app_bar.dart +++ b/lib/ui/market/widget/market_app_bar.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/provider/app_provider.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:provider/provider.dart'; +import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class MarketAppBar extends StatefulWidget with PreferredSizeWidget { final List? actions; final Widget? flexibleSpace; diff --git a/lib/ui/market/widget/market_success_page.dart b/lib/ui/market/widget/market_success_page.dart index 803e8d49..16bab18a 100644 --- a/lib/ui/market/widget/market_success_page.dart +++ b/lib/ui/market/widget/market_success_page.dart @@ -1,7 +1,14 @@ import 'dart:ui'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:waterfall_flow/waterfall_flow.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/market/order/goods_home_model.dart'; import 'package:aku_new_community/pages/tab_navigator.dart'; import 'package:aku_new_community/utils/headers.dart'; @@ -10,11 +17,6 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/end_button.dart'; import 'package:aku_new_community/widget/buttons/line_button.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:waterfall_flow/waterfall_flow.dart'; - import '../market_home_goods_card.dart'; class MarketSuccessPage extends StatefulWidget { @@ -32,7 +34,6 @@ class _MarketSuccessPageState extends State bool _onload = true; List _goodsHomeModelList = []; int _pageNum = 1; - int _pageCount = 0; int _size = 10; @override @@ -162,12 +163,10 @@ class _MarketSuccessPageState extends State 'orderByPrice': null, }, ); - if (baseListModel.tableList!.isNotEmpty) { - _goodsHomeModelList = (baseListModel.tableList as List) - .map((e) => GoodsHomeModel.fromJson(e)) - .toList(); + if (baseListModel.rows.isNotEmpty) { + _goodsHomeModelList = + (baseListModel.rows).map((e) => GoodsHomeModel.fromJson(e)).toList(); } - _pageCount = baseListModel.pageCount!; } Future loadMarketInfo() async { @@ -180,12 +179,10 @@ class _MarketSuccessPageState extends State 'orderByPrice': null, }, ); - if (baseListModel.tableList!.isNotEmpty) { - _goodsHomeModelList.addAll((baseListModel.tableList as List) - .map((e) => GoodsHomeModel.fromJson(e)) - .toList()); + if (baseListModel.rows.isNotEmpty) { + _goodsHomeModelList.addAll( + (baseListModel.rows).map((e) => GoodsHomeModel.fromJson(e)).toList()); } - _pageCount = baseListModel.pageCount!; } _getTitle(int index) { diff --git a/lib/ui/profile/car/car_manage_card.dart b/lib/ui/profile/car/car_manage_card.dart index ec6e2a32..9ea8cf61 100644 --- a/lib/ui/profile/car/car_manage_card.dart +++ b/lib/ui/profile/car/car_manage_card.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/model/user/car_parking_model.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; class CarManageCard extends StatelessWidget { final CarParkingModel model; diff --git a/lib/ui/profile/car/car_manage_page.dart b/lib/ui/profile/car/car_manage_page.dart index 21251f45..28949df4 100644 --- a/lib/ui/profile/car/car_manage_page.dart +++ b/lib/ui/profile/car/car_manage_page.dart @@ -1,10 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/ui/profile/car/car_manage_card.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:provider/provider.dart'; class CarManagePage extends StatefulWidget { CarManagePage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/car_parking/car_parking_card.dart b/lib/ui/profile/car_parking/car_parking_card.dart index 779ba893..df9499a6 100644 --- a/lib/ui/profile/car_parking/car_parking_card.dart +++ b/lib/ui/profile/car_parking/car_parking_card.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/model/user/car_parking_model.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; class CarparkingCard extends StatelessWidget { final CarParkingModel model; diff --git a/lib/ui/profile/car_parking/car_parking_page.dart b/lib/ui/profile/car_parking/car_parking_page.dart index 0c4e04a5..53e4d352 100644 --- a/lib/ui/profile/car_parking/car_parking_page.dart +++ b/lib/ui/profile/car_parking/car_parking_page.dart @@ -1,10 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/ui/profile/car_parking/car_parking_card.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:provider/provider.dart'; class CarParkingPage extends StatefulWidget { CarParkingPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/car_parking/manage_car_parking_page.dart b/lib/ui/profile/car_parking/manage_car_parking_page.dart index 5b4a1023..f09bc32a 100644 --- a/lib/ui/profile/car_parking/manage_car_parking_page.dart +++ b/lib/ui/profile/car_parking/manage_car_parking_page.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class ManageCarParkingPage extends StatefulWidget { ManageCarParkingPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/house/add_house_page.dart b/lib/ui/profile/house/add_house_page.dart index b5b035c7..bbb04833 100644 --- a/lib/ui/profile/house/add_house_page.dart +++ b/lib/ui/profile/house/add_house_page.dart @@ -1,4 +1,13 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/ui/profile/house/house_item.dart'; import 'package:aku_new_community/ui/profile/house/pick_building_page.dart'; import 'package:aku_new_community/ui/profile/house/pick_role_page.dart'; @@ -6,12 +15,6 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; class AddHousePage extends StatefulWidget { AddHousePage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/house/contract_stop/contract_stop_page.dart b/lib/ui/profile/house/contract_stop/contract_stop_page.dart index 97129613..0f32b2fd 100644 --- a/lib/ui/profile/house/contract_stop/contract_stop_page.dart +++ b/lib/ui/profile/house/contract_stop/contract_stop_page.dart @@ -1,10 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:get/get.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/ui/profile/house/contract_stop/upload_empty_list_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class ContractStopPage extends StatefulWidget { ContractStopPage({ diff --git a/lib/ui/profile/house/contract_stop/pay_result_page.dart b/lib/ui/profile/house/contract_stop/pay_result_page.dart index 89d242f4..8fe785cd 100644 --- a/lib/ui/profile/house/contract_stop/pay_result_page.dart +++ b/lib/ui/profile/house/contract_stop/pay_result_page.dart @@ -1,12 +1,14 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/ui/profile/house/contract_stop/refund_bond_page.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/others/finish_result_image.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/ui/profile/house/contract_stop/refund_bond_page.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/finish_result_image.dart'; + class PayResultPage extends StatefulWidget { final String name; final double bond; diff --git a/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart b/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart index 6e9bcd00..56d94220 100644 --- a/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart +++ b/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart @@ -1,5 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart'; import 'package:aku_new_community/pages/life_pay/pay_util.dart'; @@ -9,13 +19,6 @@ import 'package:aku_new_community/widget/bottom_sheets/pay_mothod_bottom_sheet.d import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/bee_input_row.dart'; import 'package:aku_new_community/widget/others/house_head_card.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; -import 'package:velocity_x/velocity_x.dart'; class PaySuerplusRentPage extends StatefulWidget { ///不再计租时间 diff --git a/lib/ui/profile/house/contract_stop/refund_bond_page.dart b/lib/ui/profile/house/contract_stop/refund_bond_page.dart index 13a84fc9..572d9d1c 100644 --- a/lib/ui/profile/house/contract_stop/refund_bond_page.dart +++ b/lib/ui/profile/house/contract_stop/refund_bond_page.dart @@ -1,3 +1,10 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/ui/profile/house/house_func.dart'; @@ -5,11 +12,6 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/bee_input_row.dart'; import 'package:aku_new_community/widget/others/house_head_card.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class RefundBondPage extends StatefulWidget { final String name; diff --git a/lib/ui/profile/house/contract_stop/refund_bond_result_page.dart b/lib/ui/profile/house/contract_stop/refund_bond_result_page.dart index 2ba0b7ba..acc705e4 100644 --- a/lib/ui/profile/house/contract_stop/refund_bond_result_page.dart +++ b/lib/ui/profile/house/contract_stop/refund_bond_result_page.dart @@ -1,12 +1,14 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/ui/profile/house/contract_stop/refund_bond_page.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/others/finish_result_image.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/ui/profile/house/contract_stop/refund_bond_page.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/finish_result_image.dart'; + class RefundBondResultPage extends StatefulWidget { final int status; final String name; diff --git a/lib/ui/profile/house/contract_stop/submit_finish_page.dart b/lib/ui/profile/house/contract_stop/submit_finish_page.dart index 2955a12f..4e69877b 100644 --- a/lib/ui/profile/house/contract_stop/submit_finish_page.dart +++ b/lib/ui/profile/house/contract_stop/submit_finish_page.dart @@ -1,3 +1,9 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/house/lease_detail_model.dart'; import 'package:aku_new_community/ui/profile/house/contract_stop/contract_stop_page.dart'; @@ -5,10 +11,6 @@ import 'package:aku_new_community/ui/profile/house/contract_stop/pay_surplus_ren import 'package:aku_new_community/ui/profile/house/house_func.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/finish_result_image.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class SubmitFinishPage extends StatefulWidget { final int status; diff --git a/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart b/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart index 5924240d..e16089f1 100644 --- a/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart +++ b/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart @@ -1,5 +1,15 @@ import 'dart:io'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:open_file/open_file.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/ui/profile/house/house_func.dart'; @@ -11,14 +21,6 @@ import 'package:aku_new_community/widget/others/upload_widget.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:aku_new_community/widget/views/doc_view.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:open_file/open_file.dart'; -import 'package:velocity_x/velocity_x.dart'; class UploadEmptyListPage extends StatefulWidget { UploadEmptyListPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/house/house_card.dart b/lib/ui/profile/house/house_card.dart index e297cac1..c389700d 100644 --- a/lib/ui/profile/house/house_card.dart +++ b/lib/ui/profile/house/house_card.dart @@ -1,10 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:get/get.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/models/user/passed_house_list_model.dart'; import 'package:aku_new_community/ui/profile/house/pick_my_house_page.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; enum CardAuthType { FAIL, diff --git a/lib/ui/profile/house/house_func.dart b/lib/ui/profile/house/house_func.dart index bd99b032..1d5c04f1 100644 --- a/lib/ui/profile/house/house_func.dart +++ b/lib/ui/profile/house/house_func.dart @@ -1,15 +1,16 @@ import 'dart:io'; import 'dart:typed_data'; +import 'package:bot_toast/bot_toast.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/house/lease_detail_model.dart'; import 'package:aku_new_community/models/house/lease_echo_model.dart'; import 'package:aku_new_community/models/house/submit_model.dart'; import 'package:aku_new_community/models/user/passed_house_list_model.dart'; -import 'package:aku_new_community/utils/network/base_file_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; -import 'package:bot_toast/bot_toast.dart'; class HouseFunc { ///查询所有的房屋审核信息 @@ -75,10 +76,10 @@ class HouseFunc { ///上传身份证照片正面 Future uploadIdCardFront(File file) async { - BaseFileModel baseFileModel = + BaseModel baseFileModel = await NetUtil().upload(API.upload.uploadCardFront, file); - if (baseFileModel.status ?? false) { - return baseFileModel.url ?? ''; + if (baseFileModel.success) { + return baseFileModel.data as String; } else { return ''; } @@ -86,10 +87,10 @@ class HouseFunc { ///上传身份证照片背面 Future uploadIdCardBack(File file) async { - BaseFileModel baseFileModel = + BaseModel baseFileModel = await NetUtil().upload(API.upload.uploadCardBack, file); - if (baseFileModel.status ?? false) { - return baseFileModel.url ?? ''; + if (baseFileModel.success) { + return baseFileModel.data as String; } else { return ''; } @@ -119,15 +120,15 @@ class HouseFunc { ///上传合同签名 Future uploadSignName(Uint8List bytes) async { - BaseFileModel baseFileModel = await NetUtil().uploadUnit8List( + BaseModel baseFileModel = await NetUtil().uploadUnit8List( API.upload.uploadSignName, bytes, ); - if (baseFileModel.status ?? false) { - BotToast.showText(text: baseFileModel.message!); - return baseFileModel.url ?? ''; + if (baseFileModel.success) { + BotToast.showText(text: baseFileModel.msg); + return baseFileModel.data as String; } else { - BotToast.showText(text: baseFileModel.message!); + BotToast.showText(text: baseFileModel.msg); return ''; } } @@ -150,10 +151,10 @@ class HouseFunc { ///上传盖章后正式有效合同 Future uploadFormalContract(File file) async { - BaseFileModel baseModel = + BaseModel baseModel = await NetUtil().upload(API.upload.uploadFormalContract, file); - if (baseModel.status ?? false) { - return baseModel.url ?? ''; + if (baseModel.success) { + return baseModel.data as String; } else { return ''; } diff --git a/lib/ui/profile/house/house_owners_page.dart b/lib/ui/profile/house/house_owners_page.dart index 704f259d..474dea76 100644 --- a/lib/ui/profile/house/house_owners_page.dart +++ b/lib/ui/profile/house/house_owners_page.dart @@ -1,3 +1,13 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/models/house/lease_detail_model.dart'; @@ -16,14 +26,6 @@ import 'package:aku_new_community/ui/profile/house/my_house_list.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; -import 'package:provider/provider.dart'; class HouseOwnersPage extends StatefulWidget { final int identify; diff --git a/lib/ui/profile/house/identify_selection_page.dart b/lib/ui/profile/house/identify_selection_page.dart index 68e5711a..9da01f1f 100644 --- a/lib/ui/profile/house/identify_selection_page.dart +++ b/lib/ui/profile/house/identify_selection_page.dart @@ -1,14 +1,16 @@ -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/extensions/widget_list_ext.dart'; -import 'package:aku_new_community/ui/profile/house/lease_relevation/user_identify_page.dart'; -import 'package:aku_new_community/ui/profile/house/my_house_list.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; +import 'package:aku_new_community/ui/profile/house/lease_relevation/user_identify_page.dart'; +import 'package:aku_new_community/ui/profile/house/my_house_list.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class IdentifySelectionPage extends StatelessWidget { const IdentifySelectionPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart b/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart index 87b252d1..f5c4ad93 100644 --- a/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart +++ b/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart @@ -1,5 +1,13 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/house/lease_fee_list_model.dart'; import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart'; import 'package:aku_new_community/pages/life_pay/pay_util.dart'; @@ -9,11 +17,6 @@ import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; class LeasePayQueryDetailPage extends StatefulWidget { final LeaseFeeListModel model; diff --git a/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart b/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart index 541ef0bf..3cf12163 100644 --- a/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart +++ b/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart @@ -1,5 +1,15 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/house/lease_fee_list_model.dart'; import 'package:aku_new_community/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart'; import 'package:aku_new_community/utils/headers.dart'; @@ -8,13 +18,6 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class LeasePayQueryPage extends StatefulWidget { final int id; @@ -109,7 +112,7 @@ class _LeasePayQueryPageState extends State { "years": _years }); _models.clear(); - _models = baseListModel.tableList! + _models = baseListModel.rows .map((e) => LeaseFeeListModel.fromJson(e)) .toList(); setState(() {}); @@ -123,8 +126,8 @@ class _LeasePayQueryPageState extends State { "sysLeaseId": widget.id, "years": _years }); - if (baseListModel.pageCount! >= _page) { - _models.addAll(baseListModel.tableList! + if (baseListModel.total >= _models.length) { + _models.addAll(baseListModel.rows .map((e) => LeaseFeeListModel.fromJson(e)) .toList()); setState(() {}); diff --git a/lib/ui/profile/house/lease_relevation/contract_pay_page.dart b/lib/ui/profile/house/lease_relevation/contract_pay_page.dart index 086ab1c7..310f81b4 100644 --- a/lib/ui/profile/house/lease_relevation/contract_pay_page.dart +++ b/lib/ui/profile/house/lease_relevation/contract_pay_page.dart @@ -1,5 +1,15 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/models/house/lease_detail_model.dart'; import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart'; @@ -9,13 +19,6 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/bottom_sheets/pay_mothod_bottom_sheet.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/bee_input_row.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; -import 'package:velocity_x/velocity_x.dart'; class ContractPayPage extends StatefulWidget { final int id; diff --git a/lib/ui/profile/house/lease_relevation/contract_preview_page.dart b/lib/ui/profile/house/lease_relevation/contract_preview_page.dart index 4a2ee3a3..350378fe 100644 --- a/lib/ui/profile/house/lease_relevation/contract_preview_page.dart +++ b/lib/ui/profile/house/lease_relevation/contract_preview_page.dart @@ -1,20 +1,23 @@ import 'dart:typed_data'; +import 'package:flutter/material.dart'; + import 'package:advance_pdf_viewer/advance_pdf_viewer.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:dotted_border/dotted_border.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/ui/profile/house/house_func.dart'; import 'package:aku_new_community/ui/profile/house/lease_relevation/download_contract_page.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/sign_name_board.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:dotted_border/dotted_border.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; -import 'package:velocity_x/velocity_x.dart'; class ContractPreviewPage extends StatefulWidget { final String url; @@ -36,7 +39,7 @@ class _ContractPreviewPageState extends State { void initState() { Future.delayed(Duration(milliseconds: 300), () async { Function cancel = BotToast.showLoading(); - doc = await PDFDocument.fromURL(API.image(widget.url)); + doc = await PDFDocument.fromURL(SARSAPI.image(widget.url)); cancel(); _currentPage = 0; setState(() {}); diff --git a/lib/ui/profile/house/lease_relevation/download_contract_page.dart b/lib/ui/profile/house/lease_relevation/download_contract_page.dart index e92a4fae..e7a54f6b 100644 --- a/lib/ui/profile/house/lease_relevation/download_contract_page.dart +++ b/lib/ui/profile/house/lease_relevation/download_contract_page.dart @@ -1,14 +1,16 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/ui/profile/house/lease_relevation/upload_contracts_page.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/others/finish_result_image.dart'; -import 'package:aku_new_community/widget/views/bee_download_view.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:open_file/open_file.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/ui/profile/house/lease_relevation/upload_contracts_page.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/finish_result_image.dart'; +import 'package:aku_new_community/widget/views/bee_download_view.dart'; + class DownLoadContractPage extends StatefulWidget { final String path; final int id; diff --git a/lib/ui/profile/house/lease_relevation/house_information_check_page.dart b/lib/ui/profile/house/lease_relevation/house_information_check_page.dart index d5f19e22..0f61f45d 100644 --- a/lib/ui/profile/house/lease_relevation/house_information_check_page.dart +++ b/lib/ui/profile/house/lease_relevation/house_information_check_page.dart @@ -1,3 +1,11 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/models/house/lease_detail_model.dart'; @@ -8,12 +16,6 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; -import 'package:velocity_x/velocity_x.dart'; class HouseInformationCheckPage extends StatefulWidget { final SubmitModel submitModel; diff --git a/lib/ui/profile/house/lease_relevation/identify_selection_page.dart b/lib/ui/profile/house/lease_relevation/identify_selection_page.dart index 68e5711a..9da01f1f 100644 --- a/lib/ui/profile/house/lease_relevation/identify_selection_page.dart +++ b/lib/ui/profile/house/lease_relevation/identify_selection_page.dart @@ -1,14 +1,16 @@ -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/extensions/widget_list_ext.dart'; -import 'package:aku_new_community/ui/profile/house/lease_relevation/user_identify_page.dart'; -import 'package:aku_new_community/ui/profile/house/my_house_list.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/extensions/widget_list_ext.dart'; +import 'package:aku_new_community/ui/profile/house/lease_relevation/user_identify_page.dart'; +import 'package:aku_new_community/ui/profile/house/my_house_list.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class IdentifySelectionPage extends StatelessWidget { const IdentifySelectionPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/house/lease_relevation/lease_house_card.dart b/lib/ui/profile/house/lease_relevation/lease_house_card.dart index 6103f313..241c0935 100644 --- a/lib/ui/profile/house/lease_relevation/lease_house_card.dart +++ b/lib/ui/profile/house/lease_relevation/lease_house_card.dart @@ -1,3 +1,9 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/models/house/lease_list_model.dart'; @@ -6,10 +12,6 @@ import 'package:aku_new_community/ui/profile/house/lease_relevation/supplement_i import 'package:aku_new_community/ui/profile/house/lease_relevation/upload_contracts_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class LeaseHouseCard extends StatelessWidget { final LeaseListModel model; diff --git a/lib/ui/profile/house/lease_relevation/supplement_information_page.dart b/lib/ui/profile/house/lease_relevation/supplement_information_page.dart index 13db2596..d706082c 100644 --- a/lib/ui/profile/house/lease_relevation/supplement_information_page.dart +++ b/lib/ui/profile/house/lease_relevation/supplement_information_page.dart @@ -1,5 +1,13 @@ import 'dart:io'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/models/house/lease_detail_model.dart'; @@ -12,12 +20,6 @@ import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/bee_input_row.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/identify_card_picker.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class SupplementInformationPage extends StatefulWidget { final int leaseId; diff --git a/lib/ui/profile/house/lease_relevation/tenant_house_list_page.dart b/lib/ui/profile/house/lease_relevation/tenant_house_list_page.dart index fa503f9d..83e4a995 100644 --- a/lib/ui/profile/house/lease_relevation/tenant_house_list_page.dart +++ b/lib/ui/profile/house/lease_relevation/tenant_house_list_page.dart @@ -1,12 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/models/house/lease_list_model.dart'; import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_new_community/ui/profile/house/lease_relevation/lease_house_card.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class TenantHouseListPage extends StatefulWidget { final int leaseId; @@ -41,9 +44,7 @@ class _TenantHouseListPageState extends State { controller: _refreshController, extraParams: {'leaseParentId': widget.leaseId}, convert: (models) { - return models.tableList! - .map((e) => LeaseListModel.fromJson(e)) - .toList(); + return models.rows.map((e) => LeaseListModel.fromJson(e)).toList(); }, builder: (items) { return ListView.separated( diff --git a/lib/ui/profile/house/lease_relevation/upload_contracts_page.dart b/lib/ui/profile/house/lease_relevation/upload_contracts_page.dart index b107f2a5..1c1ad2c8 100644 --- a/lib/ui/profile/house/lease_relevation/upload_contracts_page.dart +++ b/lib/ui/profile/house/lease_relevation/upload_contracts_page.dart @@ -1,5 +1,14 @@ import 'dart:io'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:open_file/open_file.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/ui/profile/house/house_func.dart'; @@ -7,13 +16,6 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/upload_widget.dart'; import 'package:aku_new_community/widget/views/doc_view.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:open_file/open_file.dart'; -import 'package:velocity_x/velocity_x.dart'; class UploadContractsPage extends StatefulWidget { final int id; diff --git a/lib/ui/profile/house/lease_relevation/user_identify_page.dart b/lib/ui/profile/house/lease_relevation/user_identify_page.dart index f1362af4..5f6a3283 100644 --- a/lib/ui/profile/house/lease_relevation/user_identify_page.dart +++ b/lib/ui/profile/house/lease_relevation/user_identify_page.dart @@ -1,3 +1,12 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/models/house/lease_echo_model.dart'; @@ -7,13 +16,6 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/bottom_sheets/sex_bottom_sheet.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/bee_input_row.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class UserIdentifyPage extends StatefulWidget { UserIdentifyPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/house/my_house_list.dart b/lib/ui/profile/house/my_house_list.dart index 67171752..7a4c81a6 100644 --- a/lib/ui/profile/house/my_house_list.dart +++ b/lib/ui/profile/house/my_house_list.dart @@ -1,3 +1,11 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/models/user/passed_house_list_model.dart'; @@ -6,12 +14,6 @@ import 'package:aku_new_community/ui/profile/house/house_func.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/bee_row_tile.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class MyHouseList extends StatefulWidget { MyHouseList({Key? key}) : super(key: key); diff --git a/lib/ui/profile/house/pick_building_page.dart b/lib/ui/profile/house/pick_building_page.dart index 58ba0b33..974f0292 100644 --- a/lib/ui/profile/house/pick_building_page.dart +++ b/lib/ui/profile/house/pick_building_page.dart @@ -1,12 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/model/user/pick_building_model.dart'; import 'package:aku_new_community/pages/sign/sign_func.dart'; import 'package:aku_new_community/ui/profile/house/house_item.dart'; import 'package:aku_new_community/ui/profile/house/pick_unit_page.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class PickBuildingPage extends StatefulWidget { PickBuildingPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/house/pick_my_house_page.dart b/lib/ui/profile/house/pick_my_house_page.dart index 55307e0f..34f5220e 100644 --- a/lib/ui/profile/house/pick_my_house_page.dart +++ b/lib/ui/profile/house/pick_my_house_page.dart @@ -1,3 +1,12 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_slidable/flutter_slidable.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/app_theme.dart'; import 'package:aku_new_community/models/user/passed_house_list_model.dart'; @@ -7,13 +16,6 @@ import 'package:aku_new_community/ui/profile/house/house_func.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_slidable/flutter_slidable.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; class PickMyHousePage extends StatefulWidget { PickMyHousePage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/house/pick_plot_page.dart b/lib/ui/profile/house/pick_plot_page.dart index 17d7080d..c7c01430 100644 --- a/lib/ui/profile/house/pick_plot_page.dart +++ b/lib/ui/profile/house/pick_plot_page.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class PickPlotPage extends StatefulWidget { PickPlotPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/house/pick_role_page.dart b/lib/ui/profile/house/pick_role_page.dart index a4e7ce4e..96c2457b 100644 --- a/lib/ui/profile/house/pick_role_page.dart +++ b/lib/ui/profile/house/pick_role_page.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + ///选择身份 /// ///业主 亲属 租客 diff --git a/lib/ui/profile/house/pick_room_page.dart b/lib/ui/profile/house/pick_room_page.dart index 2473ffb5..c88d8e48 100644 --- a/lib/ui/profile/house/pick_room_page.dart +++ b/lib/ui/profile/house/pick_room_page.dart @@ -1,11 +1,13 @@ -import 'package:aku_new_community/model/user/pick_building_model.dart'; -import 'package:aku_new_community/pages/sign/sign_func.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/model/user/pick_building_model.dart'; +import 'package:aku_new_community/pages/sign/sign_func.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class PickRoomPage extends StatefulWidget { final int unitId; diff --git a/lib/ui/profile/house/pick_unit_page.dart b/lib/ui/profile/house/pick_unit_page.dart index 7b3720b8..878a0ab6 100644 --- a/lib/ui/profile/house/pick_unit_page.dart +++ b/lib/ui/profile/house/pick_unit_page.dart @@ -1,12 +1,14 @@ -import 'package:aku_new_community/model/user/pick_building_model.dart'; -import 'package:aku_new_community/pages/sign/sign_func.dart'; -import 'package:aku_new_community/ui/profile/house/pick_room_page.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/model/user/pick_building_model.dart'; +import 'package:aku_new_community/pages/sign/sign_func.dart'; +import 'package:aku_new_community/ui/profile/house/pick_room_page.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class PickUnitPage extends StatefulWidget { final int? buildingId; diff --git a/lib/ui/profile/new_house/add_house_page.dart b/lib/ui/profile/new_house/add_house_page.dart index c7cc182a..05e3b84e 100644 --- a/lib/ui/profile/new_house/add_house_page.dart +++ b/lib/ui/profile/new_house/add_house_page.dart @@ -1,3 +1,12 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/extensions/int_ext.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; @@ -12,12 +21,6 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/bee_house_cascade_picker.dart'; import 'package:aku_new_community/widget/picker/bee_identify_picker.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class AddHousePage extends StatefulWidget { const AddHousePage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/new_house/apply_record_page.dart b/lib/ui/profile/new_house/apply_record_page.dart index f865cf32..f66d6b16 100644 --- a/lib/ui/profile/new_house/apply_record_page.dart +++ b/lib/ui/profile/new_house/apply_record_page.dart @@ -1,3 +1,10 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; @@ -6,10 +13,6 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/tag/bee_tag.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class ApplyRecordPage extends StatefulWidget { const ApplyRecordPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/new_house/certification/certification_page.dart b/lib/ui/profile/new_house/certification/certification_page.dart index 5cdde2b1..9c759e22 100644 --- a/lib/ui/profile/new_house/certification/certification_page.dart +++ b/lib/ui/profile/new_house/certification/certification_page.dart @@ -1,3 +1,12 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/ui/profile/new_house/certification/certification_success_page.dart'; @@ -6,12 +15,6 @@ import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class CertificationPage extends StatefulWidget { const CertificationPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/new_house/certification/certification_success_page.dart b/lib/ui/profile/new_house/certification/certification_success_page.dart index c019c50e..ee1d571c 100644 --- a/lib/ui/profile/new_house/certification/certification_success_page.dart +++ b/lib/ui/profile/new_house/certification/certification_success_page.dart @@ -1,12 +1,14 @@ -import 'package:aku_new_community/gen/assets.gen.dart'; -import 'package:aku_new_community/pages/tab_navigator.dart'; -import 'package:aku_new_community/ui/profile/new_house/widgets/add_house_button.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/pages/tab_navigator.dart'; +import 'package:aku_new_community/ui/profile/new_house/widgets/add_house_button.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; + class CertificationSuccessPage extends StatefulWidget { const CertificationSuccessPage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/new_house/examine_view.dart b/lib/ui/profile/new_house/examine_view.dart index f691ad9e..7bc3d85f 100644 --- a/lib/ui/profile/new_house/examine_view.dart +++ b/lib/ui/profile/new_house/examine_view.dart @@ -1,3 +1,11 @@ +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; @@ -6,11 +14,6 @@ import 'package:aku_new_community/utils/bee_map.dart'; import 'package:aku_new_community/utils/enum/identify.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class ExamineView extends StatefulWidget { const ExamineView({Key? key}) : super(key: key); diff --git a/lib/ui/profile/new_house/member_view.dart b/lib/ui/profile/new_house/member_view.dart index b0d41e09..1bbc27a3 100644 --- a/lib/ui/profile/new_house/member_view.dart +++ b/lib/ui/profile/new_house/member_view.dart @@ -1,4 +1,11 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/models/sars_model/my_house/my_family_member_list_model.dart'; @@ -7,10 +14,6 @@ import 'package:aku_new_community/utils/bee_map.dart'; import 'package:aku_new_community/utils/enum/identify.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class MemberView extends StatefulWidget { const MemberView({Key? key}) : super(key: key); diff --git a/lib/ui/profile/new_house/my_family_page.dart b/lib/ui/profile/new_house/my_family_page.dart index be5becd8..8a38fb86 100644 --- a/lib/ui/profile/new_house/my_family_page.dart +++ b/lib/ui/profile/new_house/my_family_page.dart @@ -1,3 +1,9 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/ui/profile/new_house/examine_view.dart'; @@ -6,11 +12,6 @@ import 'package:aku_new_community/ui/profile/new_house/widgets/add_house_button. import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/dialog/certification_dialog.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; - import 'add_house_page.dart'; class MyFamilyPage extends StatefulWidget { diff --git a/lib/ui/profile/new_house/my_house_page.dart b/lib/ui/profile/new_house/my_house_page.dart index 3ba53217..15acc394 100644 --- a/lib/ui/profile/new_house/my_house_page.dart +++ b/lib/ui/profile/new_house/my_house_page.dart @@ -1,3 +1,9 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; @@ -10,10 +16,6 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/dialog/certification_dialog.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/tag/bee_tag.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class MyHousePage extends StatefulWidget { const MyHousePage({Key? key}) : super(key: key); diff --git a/lib/ui/profile/new_house/widgets/add_house_button.dart b/lib/ui/profile/new_house/widgets/add_house_button.dart index b9bd9d70..a3ed8bb0 100644 --- a/lib/ui/profile/new_house/widgets/add_house_button.dart +++ b/lib/ui/profile/new_house/widgets/add_house_button.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; diff --git a/lib/ui/profile/order/order_page.dart b/lib/ui/profile/order/order_page.dart index d332a7e1..7e58f3b6 100644 --- a/lib/ui/profile/order/order_page.dart +++ b/lib/ui/profile/order/order_page.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; -import 'package:flutter/material.dart'; class OrderPage extends StatefulWidget { final int initIndex; diff --git a/lib/ui/search/bee_search.dart b/lib/ui/search/bee_search.dart index f8c87635..28efdcc5 100644 --- a/lib/ui/search/bee_search.dart +++ b/lib/ui/search/bee_search.dart @@ -1,6 +1,13 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/application_objects.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/community/activity_item_model.dart'; import 'package:aku_new_community/model/community/community_topic_model.dart'; @@ -12,10 +19,6 @@ import 'package:aku_new_community/utils/login_util.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_back_button.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class BeeSearch extends StatefulWidget { BeeSearch({Key? key}) : super(key: key); @@ -111,7 +114,7 @@ class _BeeSearchState extends State { clipBehavior: Clip.antiAlias, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: SARSAPI.image(ImgModel.first(model.imgUrls)), fit: BoxFit.cover, )), ), @@ -148,7 +151,7 @@ class _BeeSearchState extends State { return MaterialButton( onPressed: () { Get.to(() => TopicDetailPage( - model: model, + topicId: model.id, )); }, shape: StadiumBorder(), @@ -162,7 +165,7 @@ class _BeeSearchState extends State { clipBehavior: Clip.antiAlias, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrl)), + image: SARSAPI.image(ImgModel.first(model.imgUrl)), fit: BoxFit.cover, )), ), diff --git a/lib/ui/service/hall/hall_card.dart b/lib/ui/service/hall/hall_card.dart index c6fd7062..6b865841 100644 --- a/lib/ui/service/hall/hall_card.dart +++ b/lib/ui/service/hall/hall_card.dart @@ -1,14 +1,15 @@ -import 'package:aku_new_community/gen/assets.gen.dart'; -import 'package:aku_new_community/models/task/hall_list_model.dart'; -import 'package:aku_new_community/ui/service/hall/hall_detail_page.dart'; -import 'package:aku_new_community/ui/service/task_map.dart'; -import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; -import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/models/task/hall_list_model.dart'; +import 'package:aku_new_community/ui/service/hall/hall_detail_page.dart'; +import 'package:aku_new_community/ui/service/task_map.dart'; +import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; import '../task_func.dart'; class HallCard extends StatelessWidget { diff --git a/lib/ui/service/hall/hall_detail_page.dart b/lib/ui/service/hall/hall_detail_page.dart index 4e46d44a..10e57036 100644 --- a/lib/ui/service/hall/hall_detail_page.dart +++ b/lib/ui/service/hall/hall_detail_page.dart @@ -1,12 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/models/task/hall_list_model.dart'; import 'package:aku_new_community/ui/service/task_map.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class HallDetailPage extends StatefulWidget { final HallListModel model; diff --git a/lib/ui/service/hall/hall_view.dart b/lib/ui/service/hall/hall_view.dart index efe39722..ca6c2ed2 100644 --- a/lib/ui/service/hall/hall_view.dart +++ b/lib/ui/service/hall/hall_view.dart @@ -1,11 +1,13 @@ -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/models/task/hall_list_model.dart'; -import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/src/extensions/num_ext.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/models/task/hall_list_model.dart'; +import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; import 'hall_card.dart'; class HallView extends StatefulWidget { @@ -31,7 +33,7 @@ class _HallViewState extends State { controller: _refreshController, extraParams: {}, convert: (json) => - json.tableList!.map((e) => HallListModel.fromJson(e)).toList(), + json.rows.map((e) => HallListModel.fromJson(e)).toList(), builder: (models) { return ListView.separated( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), diff --git a/lib/ui/service/my_take_task/my_take_task_card.dart b/lib/ui/service/my_take_task/my_take_task_card.dart index 762712ef..26a72d09 100644 --- a/lib/ui/service/my_take_task/my_take_task_card.dart +++ b/lib/ui/service/my_take_task/my_take_task_card.dart @@ -1,3 +1,10 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/models/task/my_take_task_list_model.dart'; @@ -5,12 +12,6 @@ import 'package:aku_new_community/ui/service/my_take_task/my_take_task_detail_pa import 'package:aku_new_community/ui/service/task_map.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; - import '../task_func.dart'; class MyTakeTaskCard extends StatelessWidget { diff --git a/lib/ui/service/my_take_task/my_take_task_detail_page.dart b/lib/ui/service/my_take_task/my_take_task_detail_page.dart index 2ddc3f57..01ea291a 100644 --- a/lib/ui/service/my_take_task/my_take_task_detail_page.dart +++ b/lib/ui/service/my_take_task/my_take_task_detail_page.dart @@ -1,12 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/models/task/my_take_task_list_model.dart'; import 'package:aku_new_community/ui/service/task_map.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class MyTakeTaskDetailPage extends StatefulWidget { final MyTakeTaskListModel model; diff --git a/lib/ui/service/my_take_task/my_take_task_view.dart b/lib/ui/service/my_take_task/my_take_task_view.dart index c9a34867..96277db0 100644 --- a/lib/ui/service/my_take_task/my_take_task_view.dart +++ b/lib/ui/service/my_take_task/my_take_task_view.dart @@ -1,12 +1,15 @@ -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/models/task/my_take_task_list_model.dart'; -import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; -import 'package:aku_new_community/ui/service/my_take_task/my_take_task_card.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/models/task/my_take_task_list_model.dart'; +import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; +import 'package:aku_new_community/ui/service/my_take_task/my_take_task_card.dart'; + class MyTakeTaskView extends StatefulWidget { const MyTakeTaskView({Key? key}) : super(key: key); @@ -28,9 +31,8 @@ class _MyTakeTaskViewState extends State { return BeeListView( path: API.manager.task.myTakeTask, controller: _refreshController, - convert: (json) => json.tableList! - .map((e) => MyTakeTaskListModel.fromJson(e)) - .toList(), + convert: (json) => + json.rows.map((e) => MyTakeTaskListModel.fromJson(e)).toList(), builder: (models) { return ListView.separated( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), diff --git a/lib/ui/service/my_task/my_task_card.dart b/lib/ui/service/my_task/my_task_card.dart index 0810b2b1..f9afff5c 100644 --- a/lib/ui/service/my_task/my_task_card.dart +++ b/lib/ui/service/my_task/my_task_card.dart @@ -1,14 +1,15 @@ -import 'package:aku_new_community/gen/assets.gen.dart'; -import 'package:aku_new_community/models/task/my_task_list_model.dart'; -import 'package:aku_new_community/ui/service/my_task/my_task_detail_page.dart'; -import 'package:aku_new_community/ui/service/task_map.dart'; -import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; -import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/models/task/my_task_list_model.dart'; +import 'package:aku_new_community/ui/service/my_task/my_task_detail_page.dart'; +import 'package:aku_new_community/ui/service/task_map.dart'; +import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; import '../task_func.dart'; class MyTaskCard extends StatelessWidget { diff --git a/lib/ui/service/my_task/my_task_detail_page.dart b/lib/ui/service/my_task/my_task_detail_page.dart index 10201671..6b746349 100644 --- a/lib/ui/service/my_task/my_task_detail_page.dart +++ b/lib/ui/service/my_task/my_task_detail_page.dart @@ -1,12 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/models/task/my_task_list_model.dart'; import 'package:aku_new_community/ui/service/task_map.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; class MyTaskDetailPage extends StatefulWidget { final MyTaskListModel model; diff --git a/lib/ui/service/my_task/my_task_view.dart b/lib/ui/service/my_task/my_task_view.dart index 056fadb8..3b5fa6b8 100644 --- a/lib/ui/service/my_task/my_task_view.dart +++ b/lib/ui/service/my_task/my_task_view.dart @@ -1,12 +1,15 @@ -import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/models/task/my_task_list_model.dart'; -import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; -import 'package:aku_new_community/ui/service/my_task/my_task_card.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/models/task/my_task_list_model.dart'; +import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart'; +import 'package:aku_new_community/ui/service/my_task/my_task_card.dart'; + class MyTaskView extends StatefulWidget { const MyTaskView({Key? key}) : super(key: key); @@ -29,7 +32,7 @@ class _MyTaskViewState extends State { path: API.manager.task.myTask, controller: _refreshController, convert: (json) => - json.tableList!.map((e) => MyTaskListModel.fromJson(e)).toList(), + json.rows.map((e) => MyTaskListModel.fromJson(e)).toList(), builder: (models) { return ListView.separated( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), diff --git a/lib/ui/service/publish_task_page.dart b/lib/ui/service/publish_task_page.dart index 0e0ca0ef..8b071213 100644 --- a/lib/ui/service/publish_task_page.dart +++ b/lib/ui/service/publish_task_page.dart @@ -1,3 +1,12 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/ui/service/task_func.dart'; import 'package:aku_new_community/utils/headers.dart'; @@ -5,13 +14,6 @@ import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class PublishTaskPage extends StatefulWidget { const PublishTaskPage({Key? key}) : super(key: key); diff --git a/lib/ui/service/task_func.dart b/lib/ui/service/task_func.dart index 78403d95..2e29aa63 100644 --- a/lib/ui/service/task_func.dart +++ b/lib/ui/service/task_func.dart @@ -1,4 +1,5 @@ import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; class TaskFunc { diff --git a/lib/ui/service/task_page.dart b/lib/ui/service/task_page.dart index 042c7fa5..dd4c3b3f 100644 --- a/lib/ui/service/task_page.dart +++ b/lib/ui/service/task_page.dart @@ -1,13 +1,15 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'package:aku_new_community/ui/service/hall/hall_view.dart'; import 'package:aku_new_community/ui/service/my_take_task/my_take_task_view.dart'; import 'package:aku_new_community/ui/service/my_task/my_task_view.dart'; import 'package:aku_new_community/ui/service/publish_task_page.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/painter/tab_indicator.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; class TaskPage extends StatefulWidget { const TaskPage({Key? key}) : super(key: key); diff --git a/lib/utils/hive_store.dart b/lib/utils/hive_store.dart index dbbb8bd3..7b76ac02 100644 --- a/lib/utils/hive_store.dart +++ b/lib/utils/hive_store.dart @@ -1,10 +1,12 @@ +import 'package:flutter/foundation.dart'; + +import 'package:hive/hive.dart'; +import 'package:path_provider/path_provider.dart'; + import 'package:aku_new_community/model/user/province_model.dart'; import 'package:aku_new_community/models/login/china_region_model.dart'; import 'package:aku_new_community/models/login/history_login_model.dart'; import 'package:aku_new_community/models/user/user_config_model.dart'; -import 'package:flutter/foundation.dart'; -import 'package:hive/hive.dart'; -import 'package:path_provider/path_provider.dart'; class HiveStore { static Box? _appBox; diff --git a/lib/utils/login_util.dart b/lib/utils/login_util.dart index 7858b0de..f9d1f036 100644 --- a/lib/utils/login_util.dart +++ b/lib/utils/login_util.dart @@ -1,11 +1,12 @@ +import 'package:bot_toast/bot_toast.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/pages/sign/login/login_page.dart'; import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/ui/profile/house/add_house_page.dart'; import 'package:aku_new_community/ui/profile/house/house_owners_page.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; /// | 名称 | 函数 | /// |-----|------| diff --git a/lib/utils/network/base_file_model.dart b/lib/utils/network/base_file_model.dart deleted file mode 100644 index 17573342..00000000 --- a/lib/utils/network/base_file_model.dart +++ /dev/null @@ -1,20 +0,0 @@ -class BaseFileModel { - String? message; - String? url; - bool? status; - - BaseFileModel({ - this.message, - this.url, - this.status, - }); - - BaseFileModel.err( - {this.message = '未知错误', this.url = '', this.status = false}); - - BaseFileModel.fromJson(Map json) { - message = json['message'] ?? ''; - url = json['url'] ?? null; - status = json['status'] ?? false; - } -} diff --git a/lib/utils/network/base_list_model.dart b/lib/utils/network/base_list_model.dart index 3f1dc396..53816ba3 100644 --- a/lib/utils/network/base_list_model.dart +++ b/lib/utils/network/base_list_model.dart @@ -1,29 +1,29 @@ -class BaseListModel { - int? pageCount; - int? rowCount; - List? tableList; +import 'package:json_annotation/json_annotation.dart'; - BaseListModel({ - this.pageCount, - this.rowCount, - this.tableList, - }); +part 'base_list_model.g.dart'; + +@JsonSerializable() +class BaseListModel { + final int pages; + final List rows; + final int total; BaseListModel.zero({ - this.pageCount = 0, - this.rowCount = 0, - this.tableList = const [], + this.total = 0, + this.pages = 0, + this.rows = const [], }); BaseListModel.err({ - this.pageCount = 0, - this.rowCount = 0, - this.tableList = const [], + this.pages = 0, + this.total = 0, + this.rows = const [], + }); + factory BaseListModel.fromJson(Map json) => + _$BaseListModelFromJson(json); + const BaseListModel({ + required this.pages, + required this.rows, + required this.total, }); - - BaseListModel.fromJson(Map json) { - pageCount = json['pageCount'] ?? 0; - rowCount = json['rowCount'] ?? 0; - tableList = json['tableList'] ?? []; - } } diff --git a/lib/utils/network/base_list_model.g.dart b/lib/utils/network/base_list_model.g.dart new file mode 100644 index 00000000..251b50b3 --- /dev/null +++ b/lib/utils/network/base_list_model.g.dart @@ -0,0 +1,14 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseListModel _$BaseListModelFromJson(Map json) => + BaseListModel( + pages: json['pages'] as int, + rows: json['rows'] as List, + total: json['total'] as int, + ); diff --git a/lib/utils/network/base_model.dart b/lib/utils/network/base_model.dart index b976a7c8..c9d2d9ec 100644 --- a/lib/utils/network/base_model.dart +++ b/lib/utils/network/base_model.dart @@ -13,8 +13,9 @@ class BaseModel { _$BaseModelFromJson(json); static BaseModel error( - String? message, bool success, dynamic data, int code) => - BaseModel(code: code, msg: message ?? '未知错误', success: success); + {String? message, bool? success, dynamic data, int? code}) => + BaseModel( + code: code ?? 0, msg: message ?? '未知错误', success: success ?? false); BaseModel({ required this.code, diff --git a/lib/utils/network/net_util.dart b/lib/utils/network/net_util.dart index 94eefbbd..87a5ebce 100644 --- a/lib/utils/network/net_util.dart +++ b/lib/utils/network/net_util.dart @@ -1,19 +1,20 @@ import 'dart:io'; import 'dart:typed_data'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:dio/dio.dart'; +import 'package:get/get.dart' hide Response, FormData, MultipartFile; +import 'package:power_logger/power_logger.dart'; +import 'package:provider/provider.dart'; + +import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/pages/sign/login/login_page.dart'; import 'package:aku_new_community/provider/user_provider.dart'; import 'package:aku_new_community/utils/developer_util.dart'; -import 'package:aku_new_community/utils/network/base_file_model.dart'; import 'package:aku_new_community/utils/network/base_list_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; -import 'package:bot_toast/bot_toast.dart'; -import 'package:dio/dio.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:get/get.dart' hide Response, FormData, MultipartFile; -import 'package:power_logger/power_logger.dart'; -import 'package:provider/provider.dart'; class NetUtil { Dio? _dio; @@ -65,8 +66,11 @@ class NetUtil { try { Response res = await _dio!.get(path, queryParameters: params); if (!res.data['success']) { - _baseModel = BaseModel.error(res.data['msg'], res.data['success'], - res.data['data'], res.data['code']); + _baseModel = BaseModel.error( + message: res.data['msg'], + success: res.data['success'], + data: res.data['data'], + code: res.data['code']); _parseRequestError(_baseModel, showMessage: showMessage); } else { _baseModel = BaseModel.fromJson(res.data); @@ -92,8 +96,11 @@ class NetUtil { try { Response res = await _dio!.post(path, data: params); if (!res.data['success']) { - _baseModel = BaseModel.error(res.data['msg'], res.data['success'], - res.data['data'], res.data['code']); + _baseModel = BaseModel.error( + message: res.data['msg'], + success: res.data['success'], + data: res.data['data'], + code: res.data['code']); _parseRequestError(_baseModel, showMessage: showMessage); } else { _baseModel = BaseModel.fromJson(res.data); @@ -112,41 +119,46 @@ class NetUtil { }) async { try { Response res = await _dio!.get(path, queryParameters: params); - BaseListModel baseListModel = BaseListModel.fromJson(res.data); - return baseListModel; + var base = BaseModel.fromJson(res.data); + if (base.success) { + BaseListModel baseListModel = BaseListModel.fromJson(base.data); + return baseListModel; + } else { + return BaseListModel.err(); + } } on DioError catch (e) { _parseErr(e); } return BaseListModel.err(); } - Future upload(String path, File file) async { + Future upload(String path, File file) async { try { Response res = await _dio!.post(path, data: FormData.fromMap({ 'file': await MultipartFile.fromFile(file.path), })); - BaseFileModel baseListModel = BaseFileModel.fromJson(res.data); + BaseModel baseListModel = BaseModel.fromJson(res.data); return baseListModel; } on DioError catch (e) { print(e); } - return BaseFileModel.err(); + return BaseModel.error(); } - Future uploadUnit8List(String path, Uint8List bytes) async { + Future uploadUnit8List(String path, Uint8List bytes) async { try { Response res = await _dio!.post(path, data: FormData.fromMap({ 'file': await MultipartFile.fromBytes(bytes, filename: 'signName.png'), })); - BaseFileModel baseListModel = BaseFileModel.fromJson(res.data); + BaseModel baseListModel = BaseModel.fromJson(res.data); return baseListModel; } on DioError catch (e) { print(e); } - return BaseFileModel.err(); + return BaseModel.error(); } Future> uploadFiles(List files, String api) async { @@ -155,13 +167,12 @@ class NetUtil { return []; } else { for (var item in files) { - BaseFileModel model = await NetUtil().upload(api, item); - if (model.url != null) { - urls.add(model.url!); + BaseModel model = await NetUtil().upload(api, item); + if (model.data != null) { + urls.add(model.data as String); } } } - return urls; } diff --git a/lib/utils/websocket/fire_dialog.dart b/lib/utils/websocket/fire_dialog.dart index 7afce655..e24cddca 100644 --- a/lib/utils/websocket/fire_dialog.dart +++ b/lib/utils/websocket/fire_dialog.dart @@ -1,14 +1,16 @@ import 'dart:convert'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:get/get.dart'; + import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/pages/tab_navigator.dart'; import 'package:aku_new_community/utils/developer_util.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/websocket/alarm_models/fall_model.dart'; import 'package:aku_new_community/utils/websocket/alarm_models/fire_model.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class FireDialog { static fireAlarm(String content) async { diff --git a/lib/utils/websocket/tips_dialog.dart b/lib/utils/websocket/tips_dialog.dart index 428d02d2..2e0f9587 100644 --- a/lib/utils/websocket/tips_dialog.dart +++ b/lib/utils/websocket/tips_dialog.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/extensions/num_ext.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:aku_new_community/extensions/num_ext.dart'; + class TipsDialog { static tipsDialog() async { await Get.dialog( diff --git a/lib/utils/websocket/web_socket_util.dart b/lib/utils/websocket/web_socket_util.dart index e8892c37..efad391a 100644 --- a/lib/utils/websocket/web_socket_util.dart +++ b/lib/utils/websocket/web_socket_util.dart @@ -1,11 +1,12 @@ import 'dart:async'; -import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:power_logger/power_logger.dart'; import 'package:web_socket_channel/io.dart'; import 'package:web_socket_channel/web_socket_channel.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; + const String baseUri = 'wss://shop.kaidalai.cn/websocket/app'; enum SOCKETSTATUS { CONNECTED, //已连接 diff --git a/lib/widget/animated/OverlayWidget.dart b/lib/widget/animated/OverlayWidget.dart index 1bece2c6..50792f41 100644 --- a/lib/widget/animated/OverlayWidget.dart +++ b/lib/widget/animated/OverlayWidget.dart @@ -1,10 +1,12 @@ -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/pages/opening_code_page/opening_code_page.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/pages/opening_code_page/opening_code_page.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class OverlayLivingBtnWidget extends StatefulWidget { OverlayLivingBtnWidget({ Key? key, diff --git a/lib/widget/beeImageNetwork.dart b/lib/widget/beeImageNetwork.dart new file mode 100644 index 00000000..5be828e9 --- /dev/null +++ b/lib/widget/beeImageNetwork.dart @@ -0,0 +1,32 @@ +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class BeeImageNetwork extends StatelessWidget { + final List urls; + final double? width; + final double? height; + + const BeeImageNetwork({Key? key, required this.urls, this.width, this.height}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return FadeInImage.assetNetwork( + placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + image: SARSAPI.image(ImgModel.first(urls)), + imageErrorBuilder: (context, obj, stackTrace) { + return Image.asset( + R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + width: width ?? 160.w, + height: 160.w, + ); + }, + height: height ?? 160.w, + width: width ?? 160.w, + fit: BoxFit.cover, + ); + } +} diff --git a/lib/widget/bee_divider.dart b/lib/widget/bee_divider.dart index 2043059b..ab645a65 100644 --- a/lib/widget/bee_divider.dart +++ b/lib/widget/bee_divider.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class BeeDivider extends StatelessWidget { diff --git a/lib/widget/bottom_sheets/pay_mothod_bottom_sheet.dart b/lib/widget/bottom_sheets/pay_mothod_bottom_sheet.dart index 1a5f86f2..e0533b85 100644 --- a/lib/widget/bottom_sheets/pay_mothod_bottom_sheet.dart +++ b/lib/widget/bottom_sheets/pay_mothod_bottom_sheet.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; + class PayMethodBottomSheet extends StatelessWidget { final Function(String value) onChoose; diff --git a/lib/widget/bottom_sheets/sex_bottom_sheet.dart b/lib/widget/bottom_sheets/sex_bottom_sheet.dart index 623ea990..9c531197 100644 --- a/lib/widget/bottom_sheets/sex_bottom_sheet.dart +++ b/lib/widget/bottom_sheets/sex_bottom_sheet.dart @@ -1,10 +1,12 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; + class SexBottomSheet extends StatelessWidget { final Function(String value) onChoose; diff --git a/lib/widget/buttons/aku_single_check_button.dart b/lib/widget/buttons/aku_single_check_button.dart index 56176524..abd24d8c 100644 --- a/lib/widget/buttons/aku_single_check_button.dart +++ b/lib/widget/buttons/aku_single_check_button.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; diff --git a/lib/widget/buttons/all_select_button.dart b/lib/widget/buttons/all_select_button.dart index 99b68cb3..33306b2a 100644 --- a/lib/widget/buttons/all_select_button.dart +++ b/lib/widget/buttons/all_select_button.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/base/base_style.dart'; + class AllSelectButton extends StatelessWidget { final VoidCallback onPressed; final Color? backColor; diff --git a/lib/widget/buttons/bee_check_box.dart b/lib/widget/buttons/bee_check_box.dart index 2a9df00c..b4c475d9 100644 --- a/lib/widget/buttons/bee_check_box.dart +++ b/lib/widget/buttons/bee_check_box.dart @@ -1,8 +1,9 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class BeeCheckBox extends StatefulWidget { final Function(bool)? onChange; final bool? isRound; diff --git a/lib/widget/buttons/bee_check_button.dart b/lib/widget/buttons/bee_check_button.dart index 86669741..5ba8d6c2 100644 --- a/lib/widget/buttons/bee_check_button.dart +++ b/lib/widget/buttons/bee_check_button.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; class BeeCheckButton extends StatefulWidget { final Function(T value) onChange; diff --git a/lib/widget/buttons/bee_check_radio.dart b/lib/widget/buttons/bee_check_radio.dart index 38f571cf..410399ba 100644 --- a/lib/widget/buttons/bee_check_radio.dart +++ b/lib/widget/buttons/bee_check_radio.dart @@ -1,8 +1,9 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class BeeCheckRadio extends StatefulWidget { final T? value; final List? groupValue; diff --git a/lib/widget/buttons/bee_numberic_button.dart b/lib/widget/buttons/bee_numberic_button.dart index 20556bdb..a56594a1 100644 --- a/lib/widget/buttons/bee_numberic_button.dart +++ b/lib/widget/buttons/bee_numberic_button.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/painters/as_numberic_painter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/painters/as_numberic_painter.dart'; + ///## 数量选择组件 class BeeNumberPickerButton extends StatefulWidget { ///初始值 diff --git a/lib/widget/buttons/bee_single_check.dart b/lib/widget/buttons/bee_single_check.dart index e98a3142..d61b6a5b 100644 --- a/lib/widget/buttons/bee_single_check.dart +++ b/lib/widget/buttons/bee_single_check.dart @@ -1,8 +1,9 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class BeeSingleCheck extends StatefulWidget { final T? value; final T? groupValue; diff --git a/lib/widget/buttons/bottom_button.dart b/lib/widget/buttons/bottom_button.dart index 8a612b9a..de750211 100644 --- a/lib/widget/buttons/bottom_button.dart +++ b/lib/widget/buttons/bottom_button.dart @@ -1,7 +1,9 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/base/base_style.dart'; + class BottomButton extends StatelessWidget { final VoidCallback? onPressed; final Widget child; diff --git a/lib/widget/buttons/card_bottom_button.dart b/lib/widget/buttons/card_bottom_button.dart index 68d0b457..9fb30ace 100644 --- a/lib/widget/buttons/card_bottom_button.dart +++ b/lib/widget/buttons/card_bottom_button.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; + //各种卡片下方的button组 class CardBottomButton extends StatelessWidget { final String text; diff --git a/lib/widget/buttons/column_action_button.dart b/lib/widget/buttons/column_action_button.dart index f3c19c7a..7a5bbeec 100644 --- a/lib/widget/buttons/column_action_button.dart +++ b/lib/widget/buttons/column_action_button.dart @@ -1,7 +1,9 @@ -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; + import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/utils/headers.dart'; + ///上图片 下文字 的button class ColumnActionButton extends StatelessWidget { final VoidCallback? onPressed; diff --git a/lib/widget/buttons/end_button.dart b/lib/widget/buttons/end_button.dart index a99eb3fc..de9ad34c 100644 --- a/lib/widget/buttons/end_button.dart +++ b/lib/widget/buttons/end_button.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class EndButton extends StatelessWidget { diff --git a/lib/widget/buttons/line_button.dart b/lib/widget/buttons/line_button.dart index 36eaf5f7..3f22bb92 100644 --- a/lib/widget/buttons/line_button.dart +++ b/lib/widget/buttons/line_button.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class LineButton extends StatelessWidget { diff --git a/lib/widget/buttons/radio_button.dart b/lib/widget/buttons/radio_button.dart index 035b1586..5e0f2fbd 100644 --- a/lib/widget/buttons/radio_button.dart +++ b/lib/widget/buttons/radio_button.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; class BeeRadio extends StatefulWidget { final T value; diff --git a/lib/widget/common_input.dart b/lib/widget/common_input.dart index 8b1c17b8..1453edfc 100644 --- a/lib/widget/common_input.dart +++ b/lib/widget/common_input.dart @@ -1,8 +1,9 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/utils/headers.dart'; + @Deprecated("DO NOT USE THIS WIDGET") class CommonInput extends StatefulWidget { final TextEditingController? inputController; diff --git a/lib/widget/dialog/certification_dialog.dart b/lib/widget/dialog/certification_dialog.dart index 5a1e38e0..9baf9b6b 100644 --- a/lib/widget/dialog/certification_dialog.dart +++ b/lib/widget/dialog/certification_dialog.dart @@ -1,10 +1,12 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/ui/profile/new_house/certification/certification_page.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/ui/profile/new_house/certification/certification_page.dart'; + class CertificationDialog extends StatelessWidget { const CertificationDialog({Key? key}) : super(key: key); diff --git a/lib/widget/others/aku_chip_box.dart b/lib/widget/others/aku_chip_box.dart index 361e6441..77941826 100644 --- a/lib/widget/others/aku_chip_box.dart +++ b/lib/widget/others/aku_chip_box.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class AkuChipBox extends StatelessWidget { diff --git a/lib/widget/others/bee_input_row.dart b/lib/widget/others/bee_input_row.dart index 7394f0d2..29d22837 100644 --- a/lib/widget/others/bee_input_row.dart +++ b/lib/widget/others/bee_input_row.dart @@ -1,8 +1,9 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; class BeeInputRow extends StatefulWidget { final String title; diff --git a/lib/widget/others/bee_row_tile.dart b/lib/widget/others/bee_row_tile.dart index 6c684ddf..36693126 100644 --- a/lib/widget/others/bee_row_tile.dart +++ b/lib/widget/others/bee_row_tile.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; + class BeeRowTile extends StatelessWidget { final String assetPath; final String titile; diff --git a/lib/widget/others/bee_search_text_field.dart b/lib/widget/others/bee_search_text_field.dart index d1d02fd6..d8307079 100644 --- a/lib/widget/others/bee_search_text_field.dart +++ b/lib/widget/others/bee_search_text_field.dart @@ -1,7 +1,9 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/base/base_style.dart'; + ///TextFiled class BeeSearchTextField extends StatefulWidget implements PreferredSizeWidget { BeeSearchTextField({ diff --git a/lib/widget/others/bee_text_field.dart b/lib/widget/others/bee_text_field.dart index 2b59e70e..7349ae6a 100644 --- a/lib/widget/others/bee_text_field.dart +++ b/lib/widget/others/bee_text_field.dart @@ -1,7 +1,9 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/base/base_style.dart'; + class BeeTextField extends StatefulWidget { final TextEditingController controller; final VoidCallback? onChange; diff --git a/lib/widget/others/finish_result_image.dart b/lib/widget/others/finish_result_image.dart index 877bdbe8..14fbeca6 100644 --- a/lib/widget/others/finish_result_image.dart +++ b/lib/widget/others/finish_result_image.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/base/base_style.dart'; + class FinishResultImage extends StatelessWidget { const FinishResultImage({ Key? key, diff --git a/lib/widget/others/house_head_card.dart b/lib/widget/others/house_head_card.dart index b5ed1354..8d61a07b 100644 --- a/lib/widget/others/house_head_card.dart +++ b/lib/widget/others/house_head_card.dart @@ -1,15 +1,17 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/provider/app_provider.dart'; -import 'package:aku_new_community/ui/profile/house/pick_my_house_page.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/ui/profile/house/pick_my_house_page.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class HouseHeadCard extends StatelessWidget { const HouseHeadCard({ Key? key, diff --git a/lib/widget/others/sign_name_board.dart b/lib/widget/others/sign_name_board.dart index c60de567..8a851950 100644 --- a/lib/widget/others/sign_name_board.dart +++ b/lib/widget/others/sign_name_board.dart @@ -1,6 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:signature/signature.dart'; diff --git a/lib/widget/others/stack_avatar.dart b/lib/widget/others/stack_avatar.dart index 39fbae16..451700cf 100644 --- a/lib/widget/others/stack_avatar.dart +++ b/lib/widget/others/stack_avatar.dart @@ -1,7 +1,9 @@ +import 'package:flutter/material.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/utils/headers.dart'; -import 'package:flutter/material.dart'; class StackAvatar extends StatelessWidget { final List avatars; @@ -34,7 +36,7 @@ class StackAvatar extends StatelessWidget { height: 44.w, width: 44.w, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(avatars[index]), + image: SARSAPI.image(avatars[index]), fit: BoxFit.cover, ), ), diff --git a/lib/widget/others/upload_widget.dart b/lib/widget/others/upload_widget.dart index b3b5f39c..d96920bb 100644 --- a/lib/widget/others/upload_widget.dart +++ b/lib/widget/others/upload_widget.dart @@ -1,12 +1,14 @@ import 'dart:io'; -import 'package:aku_new_community/painters/upload_painter.dart'; -import 'package:aku_new_community/widget/picker/bee_image_picker.dart'; -import 'package:dotted_border/dotted_border.dart'; import 'package:flutter/material.dart'; + +import 'package:dotted_border/dotted_border.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/painters/upload_painter.dart'; +import 'package:aku_new_community/widget/picker/bee_image_picker.dart'; + class UploadWidget extends StatelessWidget { final String sheetTitle; final Function(File file) onPicked; diff --git a/lib/widget/others/user_tool.dart b/lib/widget/others/user_tool.dart index 18bc3e69..9ea60065 100644 --- a/lib/widget/others/user_tool.dart +++ b/lib/widget/others/user_tool.dart @@ -1,8 +1,9 @@ +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/provider/data_provider.dart'; import 'package:aku_new_community/provider/user_provider.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; class UserTool { static UserProvider get userProvider => diff --git a/lib/widget/painter/tab_indicator.dart b/lib/widget/painter/tab_indicator.dart index 9ca9cfaa..a0426d82 100644 --- a/lib/widget/painter/tab_indicator.dart +++ b/lib/widget/painter/tab_indicator.dart @@ -1,7 +1,9 @@ -import 'package:aku_new_community/widget/painter/tab_indicator_parinter.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/widget/painter/tab_indicator_parinter.dart'; + class TabIndicator extends StatelessWidget { final double? width; final double? height; diff --git a/lib/widget/painter/tab_indicator_parinter.dart b/lib/widget/painter/tab_indicator_parinter.dart index 634f67ab..15a70423 100644 --- a/lib/widget/painter/tab_indicator_parinter.dart +++ b/lib/widget/painter/tab_indicator_parinter.dart @@ -1,6 +1,7 @@ -import 'package:aku_new_community/base/base_style.dart'; import 'package:flutter/material.dart'; +import 'package:aku_new_community/base/base_style.dart'; + class TabIndicatorPainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { diff --git a/lib/widget/picker/bee_city_picker.dart b/lib/widget/picker/bee_city_picker.dart index 645c1262..fe58c7f1 100644 --- a/lib/widget/picker/bee_city_picker.dart +++ b/lib/widget/picker/bee_city_picker.dart @@ -1,10 +1,11 @@ -import 'package:aku_new_community/models/login/china_region_model.dart'; -import 'package:aku_new_community/models/login/picked_city_model.dart'; -import 'package:aku_new_community/utils/hive_store.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/models/login/china_region_model.dart'; +import 'package:aku_new_community/models/login/picked_city_model.dart'; +import 'package:aku_new_community/utils/hive_store.dart'; import 'bee_picker_box.dart'; class BeeCityPicker extends StatefulWidget { diff --git a/lib/widget/picker/bee_community_picker.dart b/lib/widget/picker/bee_community_picker.dart index bf661c45..08f897d5 100644 --- a/lib/widget/picker/bee_community_picker.dart +++ b/lib/widget/picker/bee_community_picker.dart @@ -1,10 +1,12 @@ -import 'package:aku_new_community/models/login/community_model.dart'; -import 'package:aku_new_community/widget/others/bee_search_text_field.dart'; -import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/models/login/community_model.dart'; +import 'package:aku_new_community/widget/others/bee_search_text_field.dart'; +import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; + class BeeCommunityPicker extends StatefulWidget { static Future pick( BuildContext context, List communities) async { diff --git a/lib/widget/picker/bee_custom_picker.dart b/lib/widget/picker/bee_custom_picker.dart index 755c4092..31f51abd 100644 --- a/lib/widget/picker/bee_custom_picker.dart +++ b/lib/widget/picker/bee_custom_picker.dart @@ -1,7 +1,9 @@ -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/material.dart'; + import 'package:get/get.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class BeeCustomPicker extends StatefulWidget { final Widget? body; final VoidCallback? onPressed; diff --git a/lib/widget/picker/bee_date_picker.dart b/lib/widget/picker/bee_date_picker.dart index d60059ca..15b0be1b 100644 --- a/lib/widget/picker/bee_date_picker.dart +++ b/lib/widget/picker/bee_date_picker.dart @@ -1,9 +1,11 @@ -import 'package:aku_new_community/widget/picker/bee_custom_picker.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/widget/picker/bee_custom_picker.dart'; + class BeeDatePicker { static Future pick( DateTime initDate, { diff --git a/lib/widget/picker/bee_house_cascade_picker.dart b/lib/widget/picker/bee_house_cascade_picker.dart index f818d147..cede1fec 100644 --- a/lib/widget/picker/bee_house_cascade_picker.dart +++ b/lib/widget/picker/bee_house_cascade_picker.dart @@ -1,11 +1,13 @@ -import 'package:aku_new_community/models/sars_model/my_house/estate_cascade_model.dart'; -import 'package:aku_new_community/models/sars_model/my_house/picked_house.dart'; -import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:aku_new_community/models/sars_model/my_house/estate_cascade_model.dart'; +import 'package:aku_new_community/models/sars_model/my_house/picked_house.dart'; +import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; + class BeeHouseCascadePicker extends StatefulWidget { final List buildings; diff --git a/lib/widget/picker/bee_house_picker.dart b/lib/widget/picker/bee_house_picker.dart index fae30905..de927f84 100644 --- a/lib/widget/picker/bee_house_picker.dart +++ b/lib/widget/picker/bee_house_picker.dart @@ -1,12 +1,14 @@ -import 'package:aku_new_community/provider/app_provider.dart'; -import 'package:aku_new_community/ui/profile/house/pick_my_house_page.dart'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/ui/profile/house/pick_my_house_page.dart'; +import 'package:aku_new_community/utils/headers.dart'; + @Deprecated('use HouseHeadCard instead') class BeeHousePicker extends StatelessWidget { const BeeHousePicker({Key? key}) : super(key: key); diff --git a/lib/widget/picker/bee_identify_picker.dart b/lib/widget/picker/bee_identify_picker.dart index c09f0e8a..87a545bd 100644 --- a/lib/widget/picker/bee_identify_picker.dart +++ b/lib/widget/picker/bee_identify_picker.dart @@ -1,11 +1,13 @@ -import 'package:aku_new_community/utils/bee_map.dart'; -import 'package:aku_new_community/utils/enum/identify.dart'; -import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:aku_new_community/utils/bee_map.dart'; +import 'package:aku_new_community/utils/enum/identify.dart'; +import 'package:aku_new_community/widget/picker/bee_picker_box.dart'; + class BeeIdentifyPicker extends StatefulWidget { static Future pick(BuildContext context) async { var result = await showModalBottomSheet( diff --git a/lib/widget/picker/bee_image_picker.dart b/lib/widget/picker/bee_image_picker.dart index b85b6145..b8406437 100644 --- a/lib/widget/picker/bee_image_picker.dart +++ b/lib/widget/picker/bee_image_picker.dart @@ -1,11 +1,13 @@ import 'dart:io'; -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; + import 'package:get/get.dart'; import 'package:image_picker/image_picker.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class BeeImagePicker { static Future pick( {required String title, diff --git a/lib/widget/picker/bee_image_preview.dart b/lib/widget/picker/bee_image_preview.dart index 32ca32de..3b7ea0fa 100644 --- a/lib/widget/picker/bee_image_preview.dart +++ b/lib/widget/picker/bee_image_preview.dart @@ -1,10 +1,13 @@ import 'dart:io'; -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/constants/api.dart'; import 'package:flutter/material.dart'; + import 'package:get/get.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; + ///图片点击放大预览 class BeeImagePreview extends StatefulWidget { static Future toFile({required File file, String? tag}) async { @@ -66,7 +69,7 @@ class _BeeImagePreviewState extends State { tag: widget.tag ?? widget.path!, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(widget.path), + image: SARSAPI.image(widget.path), ), ); else diff --git a/lib/widget/picker/bee_picker_box.dart b/lib/widget/picker/bee_picker_box.dart index 91b10ad9..4a98f232 100644 --- a/lib/widget/picker/bee_picker_box.dart +++ b/lib/widget/picker/bee_picker_box.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; + class BeePickerBox extends StatelessWidget { final VoidCallback? onPressed; final String confirmString; diff --git a/lib/widget/picker/grid_image_picker.dart b/lib/widget/picker/grid_image_picker.dart index a2bfd9b4..6890f04f 100644 --- a/lib/widget/picker/grid_image_picker.dart +++ b/lib/widget/picker/grid_image_picker.dart @@ -1,14 +1,16 @@ import 'dart:io'; -import 'package:aku_new_community/painters/plus_painter.dart'; -import 'package:aku_new_community/widget/picker/bee_image_picker.dart'; -import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/painters/plus_painter.dart'; +import 'package:aku_new_community/widget/picker/bee_image_picker.dart'; +import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; + ///网格图片选择 /// ///返回`File`数组 diff --git a/lib/widget/picker/identify_card_picker.dart b/lib/widget/picker/identify_card_picker.dart index cfce991b..b910e675 100644 --- a/lib/widget/picker/identify_card_picker.dart +++ b/lib/widget/picker/identify_card_picker.dart @@ -1,12 +1,14 @@ import 'dart:io'; -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/widget/picker/bee_image_picker.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/const/resource.dart'; +import 'package:aku_new_community/widget/picker/bee_image_picker.dart'; + class IdentifyCardPicker extends StatefulWidget { static Widget front(Function(File? file) onChange) { return Column( diff --git a/lib/widget/tab_bar/bee_tab_bar.dart b/lib/widget/tab_bar/bee_tab_bar.dart index 2f2b41d6..c1ffb38a 100644 --- a/lib/widget/tab_bar/bee_tab_bar.dart +++ b/lib/widget/tab_bar/bee_tab_bar.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; class BeeTabBar extends StatefulWidget with PreferredSizeWidget { diff --git a/lib/widget/tag/bee_tag.dart b/lib/widget/tag/bee_tag.dart index 02a97b16..f0dc8b30 100644 --- a/lib/widget/tag/bee_tag.dart +++ b/lib/widget/tag/bee_tag.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; diff --git a/lib/widget/views/application_box.dart b/lib/widget/views/application_box.dart index 118322d5..5c6e8025 100644 --- a/lib/widget/views/application_box.dart +++ b/lib/widget/views/application_box.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_new_community/utils/headers.dart'; + class ApplicationBox extends StatelessWidget { final Widget? child; diff --git a/lib/widget/views/application_view.dart b/lib/widget/views/application_view.dart index 2e18a395..b9e83716 100644 --- a/lib/widget/views/application_view.dart +++ b/lib/widget/views/application_view.dart @@ -1,13 +1,15 @@ -import 'package:aku_new_community/constants/application_objects.dart'; -import 'package:aku_new_community/provider/app_provider.dart'; -import 'package:aku_new_community/utils/headers.dart'; -import 'package:aku_new_community/utils/login_util.dart'; -import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; + +import 'package:bot_toast/bot_toast.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/constants/application_objects.dart'; +import 'package:aku_new_community/provider/app_provider.dart'; +import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/utils/login_util.dart'; + class ApplicationView extends StatefulWidget { final List? items; final bool needAllApp; diff --git a/lib/widget/views/bee_download_view.dart b/lib/widget/views/bee_download_view.dart index 3aaa4750..635f17bb 100644 --- a/lib/widget/views/bee_download_view.dart +++ b/lib/widget/views/bee_download_view.dart @@ -1,11 +1,14 @@ import 'dart:io'; -import 'package:aku_new_community/constants/api.dart'; -import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; + +import 'package:dio/dio.dart'; import 'package:get/get.dart'; import 'package:path_provider/path_provider.dart'; +import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; + class BeeDownloadView extends StatefulWidget { final String? file; diff --git a/lib/widget/views/bee_grid_image_view.dart b/lib/widget/views/bee_grid_image_view.dart index 49acedb8..b97f298f 100644 --- a/lib/widget/views/bee_grid_image_view.dart +++ b/lib/widget/views/bee_grid_image_view.dart @@ -1,5 +1,4 @@ -import 'package:aku_new_community/const/resource.dart'; -import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; import 'package:flutter/material.dart'; @@ -37,7 +36,7 @@ class BeeGridImageView extends StatelessWidget { height: 184.w, width: 184.w, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(urls[index]), + image: SARSAPI.image(urls[index]), fit: BoxFit.cover, ), ), diff --git a/lib/widget/views/doc_view.dart b/lib/widget/views/doc_view.dart index 47ddc721..c4a26832 100644 --- a/lib/widget/views/doc_view.dart +++ b/lib/widget/views/doc_view.dart @@ -1,8 +1,10 @@ -import 'package:aku_new_community/const/resource.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_new_community/const/resource.dart'; + class DocViw extends StatelessWidget { const DocViw({ Key? key, diff --git a/lib/widget/views/horizontal_image_view.dart b/lib/widget/views/horizontal_image_view.dart index 7fdf3ed1..b2ce7c77 100644 --- a/lib/widget/views/horizontal_image_view.dart +++ b/lib/widget/views/horizontal_image_view.dart @@ -1,10 +1,13 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; + import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/constants/sars_api.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; class HorizontalImageView extends StatelessWidget { final List urls; @@ -36,7 +39,7 @@ class HorizontalImageView extends StatelessWidget { height: 184.w, width: 184.w, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(urls[index]), + image: SARSAPI.image(urls[index]), fit: BoxFit.cover, ), ), diff --git a/test/widget_test.dart b/test/widget_test.dart index df0bd1ad..c8f0ef72 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -5,10 +5,12 @@ // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. -import 'package:aku_new_community/main.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_test/flutter_test.dart'; +import 'package:aku_new_community/main.dart'; + void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame.