diff --git a/lib/constants/api.dart b/lib/constants/api.dart index ef976f88..b676c569 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -315,9 +315,16 @@ class _Manager { String get sharePayRecord => '/user/meterReadingShareDetails/findAllMeterShareOrderByTel'; + ///查询所有的已发布的户型说明 String get houseType => '/user/houseTypeDescription/list'; + + + ///查询所有的周边企业信息 + String get surroundingEnterprises => + '/user/surroundingEnterprises/list'; + } class _Community { diff --git a/lib/constants/application_objects.dart b/lib/constants/application_objects.dart index cd5cb180..e821cf42 100644 --- a/lib/constants/application_objects.dart +++ b/lib/constants/application_objects.dart @@ -6,6 +6,7 @@ import 'package:aku_community/pages/convenient_phone/convenient_phone_page.dart' import 'package:aku_community/pages/electronic_commerc/electronic_commerc_page.dart'; import 'package:aku_community/pages/event_activity/event_voting_page.dart'; import 'package:aku_community/pages/express_packages/express_package_page.dart'; +import 'package:aku_community/pages/geographic_information/geographic_information_page.dart'; import 'package:aku_community/pages/goods_deto_page/goods_deto_page.dart'; import 'package:aku_community/pages/goods_manage_page/select_borrow_return_page.dart'; import 'package:aku_community/pages/house_introduce/house_introduce.dart'; @@ -16,6 +17,7 @@ import 'package:aku_community/pages/opening_code_page/opening_code_page.dart'; import 'package:aku_community/pages/renovation_manage/new_renovation/new_renovation_page.dart'; import 'package:aku_community/pages/service_browse/service_browse_page.dart'; import 'package:aku_community/pages/setting_page/settings_page.dart'; +import 'package:aku_community/pages/surrounding_enterprises/Surrounding_enterprises_page.dart'; import 'package:aku_community/pages/things_page/fixed_submit_page.dart'; import 'package:aku_community/pages/visitor_access_page/visitor_access_page.dart'; import 'package:aku_community/ui/community/activity/activity_list_page.dart'; @@ -93,8 +95,8 @@ List appObjects = [ AO('社区介绍', R.ASSETS_ICONS_INTRODUCE_PNG, () => CommunityIntroducePage()), AO('家政服务', R.ASSETS_ICONS_HOUSE_KEEPING_PNG, () => HouseKeepingPage()), - AO('地理信息', R.ASSETS_ICONS_INTRODUCE_PNG, () => CommunityIntroducePage()), - AO('周边企业', R.ASSETS_ICONS_HOUSE_KEEPING_PNG, () => HouseKeepingPage()), + AO('地理信息', R.ASSETS_ICONS_INTRODUCE_PNG, () => GeographicInformationPage()), + AO('周边企业', R.ASSETS_ICONS_HOUSE_KEEPING_PNG, () => SurroundingEnterprisesPage()), AO('住房介绍', R.ASSETS_ICONS_INTRODUCE_PNG, () => HouseIntroducePage()), // AO( @@ -183,7 +185,10 @@ List _smartManagerApp = [ '家政服务', '地理信息', '周边企业', - '住房介绍', + '住房介绍' + + + // '小区教育', // '健康运动', // '家政服务', diff --git a/lib/main.dart b/lib/main.dart index dbdb3f8c..a4e36ff2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -9,7 +9,6 @@ import 'package:aku_community/utils/headers.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_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -23,17 +22,13 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); ///firebase crashlytics initalize - // await MainInitialize.initFirebase(); + //await MainInitialize.initFirebase(); MainInitialize.initTheme(); - //MainInitialize.initWechat(); + MainInitialize.initWechat(); MainInitialize.initWebSocket(); await MainInitialize.initJPush(); - //强制横屏 - SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]) - .then((_) { - runApp(MyApp()); - }); + runApp(MyApp()); } class MyApp extends StatefulWidget { @@ -78,6 +73,7 @@ class _MyAppState extends State { ], supportedLocales: [const Locale('zh')], locale: Locale('zh'), + //builder: BotToastInit(), builder: (context, child) { return MediaQuery( //设置文字大小不随系统设置改变 diff --git a/lib/models/geographic_information/geographic_information_model.dart b/lib/models/geographic_information/geographic_information_model.dart index 77137a4d..74156973 100644 --- a/lib/models/geographic_information/geographic_information_model.dart +++ b/lib/models/geographic_information/geographic_information_model.dart @@ -40,4 +40,4 @@ class GeographicInformationModel { factory GeographicInformationModel.init() => GeographicInformationModel(id: -1, name: '', content: '', createDate: ''); -} \ No newline at end of file +} diff --git a/lib/models/house_introduce/house_introduce_model.dart b/lib/models/house_introduce/house_introduce_model.dart index d96e35be..3d21b748 100644 --- a/lib/models/house_introduce/house_introduce_model.dart +++ b/lib/models/house_introduce/house_introduce_model.dart @@ -36,4 +36,4 @@ class HouseIntroduceModel { } return data; } -} \ No newline at end of file +} diff --git a/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart b/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart new file mode 100644 index 00000000..8bc76632 --- /dev/null +++ b/lib/models/surrounding_enterprises/surrounding_enterprises_model.dart @@ -0,0 +1,40 @@ +import 'package:aku_community/model/common/img_model.dart'; +import 'package:flustars/flustars.dart'; + +class SurroundingEnterprisesModel { + int? id; + String? name; + String? content; + String? releaseDate; + List? imgList; + + DateTime? get getReleaseDate => DateUtil.getDateTime(releaseDate!); + + SurroundingEnterprisesModel( + {this.id, this.name, this.content, this.releaseDate, this.imgList}); + + SurroundingEnterprisesModel.fromJson(Map json) { + id = json['id']; + name = json['name']; + content = json['content']; + releaseDate = json['releaseDate']; + if (json['imgList'] != null) { + imgList = []; + json['imgList'].forEach((v) { + imgList!.add(new ImgModel.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['content'] = this.content; + data['releaseDate'] = this.releaseDate; + if (this.imgList != null) { + data['imgList'] = this.imgList!.map((v) => v.toJson()).toList(); + } + return data; + } +} \ No newline at end of file diff --git a/lib/pages/geographic_information/geographic_information_page.dart b/lib/pages/geographic_information/geographic_information_page.dart new file mode 100644 index 00000000..850a4161 --- /dev/null +++ b/lib/pages/geographic_information/geographic_information_page.dart @@ -0,0 +1,77 @@ +import 'package:aku_community/models/geographic_information/geographic_information_model.dart'; +import 'package:aku_community/models/house_introduce/house_introduce_model.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_community/base/base_style.dart'; +import 'package:aku_community/const/resource.dart'; +import 'package:aku_community/constants/api.dart'; +import 'package:aku_community/model/common/img_model.dart'; +import 'package:aku_community/models/community_introduce/community_introduce_model.dart'; +import 'package:aku_community/utils/network/base_model.dart'; +import 'package:aku_community/utils/network/net_util.dart'; +import 'package:aku_community/widget/bee_scaffold.dart'; + +class GeographicInformationPage extends StatefulWidget { + + + GeographicInformationPage({Key? key,}) + : super(key: key); + + @override + _GeographicInformationPageState createState() => _GeographicInformationPageState(); +} + +class _GeographicInformationPageState extends State { + GeographicInformationModel _model = GeographicInformationModel.init(); + bool _onload = false; + @override + Widget build(BuildContext context) { + return BeeScaffold( + bodyColor: Colors.white, + title: '地理信息', + body:EasyRefresh( + firstRefresh: true, + header: MaterialHeader(), + onRefresh: () async { + BaseModel baseModel = + await NetUtil().get(API.manager.geographyInformation); + if (baseModel.status! && baseModel.data != null) { + _model = GeographicInformationModel.fromJson(baseModel.data); + } + _onload = false; + setState(() {}); + }, + child: _onload + ? Container() + : + ListView( + children: [ + SizedBox( + child: FadeInImage.assetNetwork( + placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + fit: BoxFit.cover, + image: API + .image(ImgModel.first(_model.imgUrls))), + width: double.infinity, + height: 424.w, + ), + 24.w.heightBox, + + Padding( + padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 40.w), + child: Text( + _model.content ?? '', + style: TextStyle( + fontSize: 26.sp, + color: (ktextSubColor), + fontWeight: FontWeight.bold), + )), + ], + ), + )); + } +} diff --git a/lib/pages/house_introduce/house_detail_page.dart b/lib/pages/house_introduce/house_detail_page.dart index 03ee76b7..d8978b44 100644 --- a/lib/pages/house_introduce/house_detail_page.dart +++ b/lib/pages/house_introduce/house_detail_page.dart @@ -1,7 +1,7 @@ import 'package:aku_community/models/house_introduce/house_introduce_model.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'; @@ -9,9 +9,7 @@ import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/const/resource.dart'; import 'package:aku_community/constants/api.dart'; import 'package:aku_community/model/common/img_model.dart'; -import 'package:aku_community/models/community_introduce/community_introduce_model.dart'; -import 'package:aku_community/utils/network/base_model.dart'; -import 'package:aku_community/utils/network/net_util.dart'; + import 'package:aku_community/widget/bee_scaffold.dart'; class HouseDetailPage extends StatefulWidget { @@ -47,11 +45,11 @@ class _HouseDetailPageState extends State { Padding( padding: EdgeInsets.symmetric(horizontal: 32.w), child: - // widget.houseIntroduceModel.content!.text - // .size(28.sp) - // .color(ktextPrimary) - // .make(), - Text( + // widget.houseIntroduceModel.content!.text + // .size(28.sp) + // .color(ktextPrimary) + // .make(), + Text( widget.houseIntroduceModel.name ?? '', style: TextStyle( fontSize: 30.sp, diff --git a/lib/pages/house_introduce/house_introduce.dart b/lib/pages/house_introduce/house_introduce.dart index d041d483..e1338aa4 100644 --- a/lib/pages/house_introduce/house_introduce.dart +++ b/lib/pages/house_introduce/house_introduce.dart @@ -1,6 +1,5 @@ import 'package:aku_community/models/house_introduce/house_introduce_model.dart'; import 'package:aku_community/utils/hive_store.dart'; -import 'package:aku_community/utils/websocket/tips_dialog.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -79,20 +78,20 @@ class _HouseIntroducePageState extends State { child: Text( '${model.name}', style: TextStyle( - fontSize: 30.sp, - fontWeight: FontWeight.bold, - color: ktextPrimary + fontSize: 30.sp, + fontWeight: FontWeight.bold, + color: ktextPrimary ), maxLines: 4, overflow: TextOverflow.ellipsis, ), ), Spacer(), - '发布于:${model.getReleaseDate}' - .text - .size(20.sp) - .color(ktextThirdColor) - .make(), + '发布于:${model.getReleaseDate}' + .text + .size(20.sp) + .color(ktextThirdColor) + .make(), ], ), diff --git a/lib/pages/surrounding_enterprises/Surrounding_enterprises_page.dart b/lib/pages/surrounding_enterprises/Surrounding_enterprises_page.dart new file mode 100644 index 00000000..d1922280 --- /dev/null +++ b/lib/pages/surrounding_enterprises/Surrounding_enterprises_page.dart @@ -0,0 +1,153 @@ +import 'package:aku_community/models/house_introduce/house_introduce_model.dart'; +import 'package:aku_community/models/surrounding_enterprises/surrounding_enterprises_model.dart'; +import 'package:aku_community/pages/surrounding_enterprises/surrounding_enterprises_detail_page.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'; + +import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/constants/api.dart'; +import 'package:aku_community/constants/app_theme.dart'; +import 'package:aku_community/model/common/img_model.dart'; +import 'package:aku_community/pages/things_page/widget/bee_list_view.dart'; +import 'package:aku_community/utils/headers.dart'; +import 'package:aku_community/widget/bee_scaffold.dart'; + + +class SurroundingEnterprisesPage extends StatefulWidget { + SurroundingEnterprisesPage({Key? key}) : super(key: key); + + @override + _SurroundingEnterprisesPageState createState() => _SurroundingEnterprisesPageState(); +} + + + +class _SurroundingEnterprisesPageState extends State { + EasyRefreshController _refreshController = EasyRefreshController(); + int _page = 1; + int _size = 10; + @override + void initState() { + super.initState(); + // Future.delayed(Duration(milliseconds: 0), () async { + // var agreement = await HiveStore.appBox?.get('IndustryCommitteePage') ?? false; + // if (!agreement) { + // await TipsDialog.tipsDialog(); + // HiveStore.appBox!.put('IndustryCommitteePage',true); + // } + // }); + + } + + + Widget _buildCard(SurroundingEnterprisesModel model) { + return GestureDetector( + onTap: (){ + Get.to(SurroundingEnterprisesDetailPage(surroundingEnterprisesModel: model,)); + }, + child: Container( + padding: EdgeInsets.all(20.w), + color: Colors.white, + height: 250.w, + child: Row( + // .padding(EdgeInsets.all(20.w)).white.withRounded(value: 8.w).make() + + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(4.w), + child: FadeInImage.assetNetwork( + placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + image: API.image(ImgModel.first(model.imgList)), + height: 200.w, + width: 240.w, + fit: BoxFit.fill, + ), + ), + 24.wb, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 440.w, + child: Text( + '${model.name}', + style: TextStyle( + fontSize: 30.sp, + fontWeight: FontWeight.bold, + color: ktextPrimary + ), + maxLines: 4, + overflow: TextOverflow.ellipsis, + ), + ), + 20.hb, + Container( + width: 440.w, + child: Text( + '${model.content}', + style: TextStyle( + fontSize: 24.sp, + + color: ktextPrimary + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ), + Spacer(), + Row( + children: [ + '南宁人才公寓' + .text + .size(20.sp) + .color(ktextThirdColor) + .make(), + Spacer(), + '发布于:${model.getReleaseDate}' + .text + .size(20.sp) + .color(ktextThirdColor) + .make(), + ], + ) + ], + ), + ], + ), + ), + ); + } + + Widget build(BuildContext context) { + return BeeScaffold( + title: '周边企业', + systemStyle: SystemStyle.genStyle(bottom: Color(0xFF2A2A2A)), + body: BeeListView( + path: API.manager.surroundingEnterprises, + extraParams: {'pageNum': _page, 'size': _size}, + convert: (model) { + return model.tableList! + .map((e) => SurroundingEnterprisesModel.fromJson(e)) + .toList(); + }, + controller: _refreshController, + builder: (items) { + return ListView.separated( + padding: EdgeInsets.symmetric(vertical: 20.w), + itemBuilder: (context, index) { + return _buildCard(items[index]); + }, + separatorBuilder: (context, index) => 20.hb, + itemCount: items.length, + ); + }, + ), + ); + } +} diff --git a/lib/pages/surrounding_enterprises/surrounding_enterprises_detail_page.dart b/lib/pages/surrounding_enterprises/surrounding_enterprises_detail_page.dart new file mode 100644 index 00000000..2ba9a1e3 --- /dev/null +++ b/lib/pages/surrounding_enterprises/surrounding_enterprises_detail_page.dart @@ -0,0 +1,83 @@ +import 'package:aku_community/models/house_introduce/house_introduce_model.dart'; +import 'package:aku_community/models/surrounding_enterprises/surrounding_enterprises_model.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_community/base/base_style.dart'; +import 'package:aku_community/const/resource.dart'; +import 'package:aku_community/constants/api.dart'; +import 'package:aku_community/model/common/img_model.dart'; +import 'package:aku_community/models/community_introduce/community_introduce_model.dart'; +import 'package:aku_community/utils/network/base_model.dart'; +import 'package:aku_community/utils/network/net_util.dart'; +import 'package:aku_community/widget/bee_scaffold.dart'; + +class SurroundingEnterprisesDetailPage extends StatefulWidget { + final SurroundingEnterprisesModel surroundingEnterprisesModel; + + SurroundingEnterprisesDetailPage({Key? key, required this.surroundingEnterprisesModel}) + : super(key: key); + + @override + _SurroundingEnterprisesDetailPageState createState() => _SurroundingEnterprisesDetailPageState(); +} + +class _SurroundingEnterprisesDetailPageState extends State { + + @override + Widget build(BuildContext context) { + return BeeScaffold( + bodyColor: Colors.white, + title: '住房详情', + body: ListView( + children: [ + SizedBox( + child: FadeInImage.assetNetwork( + placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + fit: BoxFit.cover, + image: API + .image(ImgModel.first(widget.surroundingEnterprisesModel.imgList))), + width: double.infinity, + height: 424.w, + ), + // 24.w.heightBox, + // Padding( + // padding: EdgeInsets.symmetric(horizontal: 32.w), + // child: + // // widget.houseIntroduceModel.content!.text + // // .size(28.sp) + // // .color(ktextPrimary) + // // .make(), + // Text( + // widget.surroundingEnterprisesModel.name ?? '', + // style: TextStyle( + // fontSize: 30.sp, + // color: (ktextPrimary), + // fontWeight: FontWeight.bold), + // )), + // Padding( + // padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 16.w), + // child: Text( + // '发布于:${widget.surroundingEnterprisesModel.getReleaseDate}' , + // style: TextStyle( + // fontSize: 20.sp, + // color: (ktextThirdColor), + // fontWeight: FontWeight.bold), + // )), + Padding( + padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 32.w), + child: Text( + widget.surroundingEnterprisesModel.content ?? '', + style: TextStyle( + fontSize: 26.sp, + color: (ktextSubColor), + fontWeight: FontWeight.bold), + )), + ], + ), + ); + } +} diff --git a/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart b/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart index b082a16a..d1922280 100644 --- a/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart +++ b/lib/pages/surrounding_enterprises/surrounding_enterprises_page.dart @@ -1,20 +1,17 @@ import 'package:aku_community/models/house_introduce/house_introduce_model.dart'; -import 'package:aku_community/pages/surrounding_enterprises/surrding_enterprises_detail_page.dart'; -import 'package:aku_community/utils/hive_store.dart'; -import 'package:aku_community/utils/websocket/tips_dialog.dart'; +import 'package:aku_community/models/surrounding_enterprises/surrounding_enterprises_model.dart'; +import 'package:aku_community/pages/surrounding_enterprises/surrounding_enterprises_detail_page.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'; import 'package:velocity_x/velocity_x.dart'; import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/app_theme.dart'; import 'package:aku_community/model/common/img_model.dart'; -import 'package:aku_community/model/user/committee_item_model.dart'; import 'package:aku_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; @@ -31,6 +28,8 @@ class SurroundingEnterprisesPage extends StatefulWidget { class _SurroundingEnterprisesPageState extends State { EasyRefreshController _refreshController = EasyRefreshController(); + int _page = 1; + int _size = 10; @override void initState() { super.initState(); @@ -45,10 +44,10 @@ class _SurroundingEnterprisesPageState extends State } - Widget _buildCard(HouseIntroduceModel model) { + Widget _buildCard(SurroundingEnterprisesModel model) { return GestureDetector( onTap: (){ - Get.to(SurroundingEnterprisesDetailPage(houseIntroduceModel: model,)); + Get.to(SurroundingEnterprisesDetailPage(surroundingEnterprisesModel: model,)); }, child: Container( padding: EdgeInsets.all(20.w), @@ -63,7 +62,7 @@ class _SurroundingEnterprisesPageState extends State borderRadius: BorderRadius.circular(4.w), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model.imgUrls)), + image: API.image(ImgModel.first(model.imgList)), height: 200.w, width: 240.w, fit: BoxFit.fill, @@ -87,13 +86,36 @@ class _SurroundingEnterprisesPageState extends State overflow: TextOverflow.ellipsis, ), ), - Spacer(), - '发布于:${model.getReleaseDate}' - .text - .size(20.sp) - .color(ktextThirdColor) - .make(), + 20.hb, + Container( + width: 440.w, + child: Text( + '${model.content}', + style: TextStyle( + fontSize: 24.sp, + color: ktextPrimary + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ), + Spacer(), + Row( + children: [ + '南宁人才公寓' + .text + .size(20.sp) + .color(ktextThirdColor) + .make(), + Spacer(), + '发布于:${model.getReleaseDate}' + .text + .size(20.sp) + .color(ktextThirdColor) + .make(), + ], + ) ], ), ], @@ -104,13 +126,14 @@ class _SurroundingEnterprisesPageState extends State Widget build(BuildContext context) { return BeeScaffold( - title: '住房介绍', + title: '周边企业', systemStyle: SystemStyle.genStyle(bottom: Color(0xFF2A2A2A)), - body: BeeListView( - path: API.manager.houseType, + body: BeeListView( + path: API.manager.surroundingEnterprises, + extraParams: {'pageNum': _page, 'size': _size}, convert: (model) { return model.tableList! - .map((e) => HouseIntroduceModel.fromJson(e)) + .map((e) => SurroundingEnterprisesModel.fromJson(e)) .toList(); }, controller: _refreshController, diff --git a/lib/utils/websocket/AlarmModel.dart b/lib/utils/websocket/AlarmModel.dart index a02f7ee1..3c95d3d2 100644 --- a/lib/utils/websocket/AlarmModel.dart +++ b/lib/utils/websocket/AlarmModel.dart @@ -33,4 +33,4 @@ class AlarmModel { data['type'] = this.type; return data; } -} \ No newline at end of file +} diff --git a/lib/utils/websocket/fire_dialog.dart b/lib/utils/websocket/fire_dialog.dart index 1cae4720..efae20a7 100644 --- a/lib/utils/websocket/fire_dialog.dart +++ b/lib/utils/websocket/fire_dialog.dart @@ -6,9 +6,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:aku_community/extensions/num_ext.dart'; import 'package:aku_community/pages/tab_navigator.dart'; import 'package:aku_community/utils/developer_util.dart'; import 'package:aku_community/utils/headers.dart'; + import 'AlarmModel.dart'; class FireDialog { @@ -21,12 +23,11 @@ class FireDialog { title: getImage(alarmModel), content: Column( children: [ - Text(getTitle(alarmModel)), + 10.hb, Text(getContent(alarmModel)), - ], ), actions: [ @@ -46,7 +47,6 @@ class FireDialog { barrierDismissible: false, ); } - static String getTitle(AlarmModel alarmModel){ switch(alarmModel.type){ case 1: @@ -78,7 +78,6 @@ class FireDialog { } } - static Widget getImage(AlarmModel alarmModel){ switch(alarmModel.type){ case 1: