社区内容更新

hmxc
章文轩 3 years ago
parent 026a47dc1e
commit 1eb084bcfe

@ -7,7 +7,7 @@
<application android:name="io.flutter.app.FlutterApplication" android:label="小蜜蜂智慧小区" android:icon="@mipmap/ic_launcher" android:networkSecurityConfig="@xml/network_security_config"> <application android:name="io.flutter.app.FlutterApplication" android:label="小蜜蜂智慧小区" android:icon="@mipmap/ic_launcher" android:networkSecurityConfig="@xml/network_security_config">
<service android:name="com.amap.api.location.APSService"></service> <service android:name="com.amap.api.location.APSService"></service>
<meta-data android:name="com.amap.api.v2.apikey" <meta-data android:name="com.amap.api.v2.apikey"
android:value="717cf8c606307809bcbd6661123b9837"/> android:value="f6361c0537bf2d6ddb898b10618d3726"/>
<activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> <activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user the Android process has started. This theme is visible to the user

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

@ -15,38 +15,6 @@ PODS:
- AMapFoundation (~> 1.6.8) - AMapFoundation (~> 1.6.8)
- device_info_plus (0.0.1): - device_info_plus (0.0.1):
- Flutter - Flutter
- Firebase/CoreOnly (8.3.0):
- FirebaseCore (= 8.3.0)
- Firebase/Crashlytics (8.3.0):
- Firebase/CoreOnly
- FirebaseCrashlytics (~> 8.3.0)
- firebase_core (1.4.0):
- Firebase/CoreOnly (= 8.3.0)
- Flutter
- firebase_crashlytics (2.1.1):
- Firebase/Crashlytics (= 8.3.0)
- firebase_core
- Flutter
- FirebaseCore (8.3.0):
- FirebaseCoreDiagnostics (~> 8.0)
- GoogleUtilities/Environment (~> 7.4)
- GoogleUtilities/Logger (~> 7.4)
- FirebaseCoreDiagnostics (8.6.0):
- GoogleDataTransport (~> 9.0)
- GoogleUtilities/Environment (~> 7.4)
- GoogleUtilities/Logger (~> 7.4)
- nanopb (~> 2.30908.0)
- FirebaseCrashlytics (8.3.0):
- FirebaseCore (~> 8.0)
- FirebaseInstallations (~> 8.0)
- GoogleDataTransport (~> 9.0)
- nanopb (~> 2.30908.0)
- PromisesObjC (~> 1.2)
- FirebaseInstallations (8.6.0):
- FirebaseCore (~> 8.0)
- GoogleUtilities/Environment (~> 7.4)
- GoogleUtilities/UserDefaults (~> 7.4)
- PromisesObjC (< 3.0, >= 1.2)
- Flutter (1.0.0) - Flutter (1.0.0)
- fluwx (0.0.1): - fluwx (0.0.1):
- Flutter - Flutter
@ -54,16 +22,6 @@ PODS:
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
- GoogleDataTransport (9.1.0):
- GoogleUtilities/Environment (~> 7.2)
- nanopb (~> 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Environment (7.5.1):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.5.1):
- GoogleUtilities/Environment
- GoogleUtilities/UserDefaults (7.5.1):
- GoogleUtilities/Logger
- image_picker (0.0.1): - image_picker (0.0.1):
- Flutter - Flutter
- JCore (2.7.1) - JCore (2.7.1)
@ -74,11 +32,6 @@ PODS:
- JCore (= 2.7.1) - JCore (= 2.7.1)
- JPush (= 3.7.0) - JPush (= 3.7.0)
- MTBBarcodeScanner (5.0.11) - MTBBarcodeScanner (5.0.11)
- nanopb (2.30908.0):
- nanopb/decode (= 2.30908.0)
- nanopb/encode (= 2.30908.0)
- nanopb/decode (2.30908.0)
- nanopb/encode (2.30908.0)
- open_file (0.0.1): - open_file (0.0.1):
- Flutter - Flutter
- package_info (0.0.1): - package_info (0.0.1):
@ -89,7 +42,6 @@ PODS:
- Flutter - Flutter
- "permission_handler (5.1.0+2)": - "permission_handler (5.1.0+2)":
- Flutter - Flutter
- PromisesObjC (1.2.12)
- qr_code_scanner (0.2.0): - qr_code_scanner (0.2.0):
- Flutter - Flutter
- MTBBarcodeScanner - MTBBarcodeScanner
@ -112,8 +64,6 @@ DEPENDENCIES:
- amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`) - amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`)
- amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`) - amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- fluwx (from `.symlinks/plugins/fluwx/ios`) - fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`)
@ -136,19 +86,10 @@ SPEC REPOS:
- AMap3DMap - AMap3DMap
- AMapFoundation - AMapFoundation
- AMapLocation - AMapLocation
- Firebase
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseCrashlytics
- FirebaseInstallations
- FMDB - FMDB
- GoogleDataTransport
- GoogleUtilities
- JCore - JCore
- JPush - JPush
- MTBBarcodeScanner - MTBBarcodeScanner
- nanopb
- PromisesObjC
- WechatOpenSDK - WechatOpenSDK
EXTERNAL SOURCES: EXTERNAL SOURCES:
@ -160,10 +101,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/amap_flutter_map/ios" :path: ".symlinks/plugins/amap_flutter_map/ios"
device_info_plus: device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios" :path: ".symlinks/plugins/device_info_plus/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
firebase_crashlytics:
:path: ".symlinks/plugins/firebase_crashlytics/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
fluwx: fluwx:
@ -204,30 +141,19 @@ SPEC CHECKSUMS:
AMapFoundation: 32e9a0264ee62f5aa2aaf82bdafdda7985ce09c7 AMapFoundation: 32e9a0264ee62f5aa2aaf82bdafdda7985ce09c7
AMapLocation: 3ec0e9bf53800b40cceb313cbd047743f75e2483 AMapLocation: 3ec0e9bf53800b40cceb313cbd047743f75e2483
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
Firebase: 817b9171d0d51dccc458b94a5e8edff6b1dd323d
firebase_core: 72374607c8c6f5a0adc0559e5c5bf57deda975e3
firebase_crashlytics: f5c47b951fb9b494f2bc4212c8aa8de3ed8417cf
FirebaseCore: a6dba751680d7033b9d3831e1cfc95ead0605118
FirebaseCoreDiagnostics: 3721920bde3a9a6d5aa093c1d25e9d3e47f694af
FirebaseCrashlytics: 3d83f2e8a47f476f47c82ff4536b169df6781271
FirebaseInstallations: 0ede6ffcd215b8f93c19d9b06c1c54e2d4107e98
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902 fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GoogleDataTransport: 85fd18ff3019bb85d3f2c551d04c481dedf71fc9
GoogleUtilities: 3df19e3c24f7bbc291d8b5809aa6b0d41e642437
image_picker: 50e7c7ff960e5f58faa4d1f4af84a771c671bc4a image_picker: 50e7c7ff960e5f58faa4d1f4af84a771c671bc4a
JCore: 9d5bda3a172c65bbe14f2806ab0f6246f8a06065 JCore: 9d5bda3a172c65bbe14f2806ab0f6246f8a06065
JPush: 1fd7a326e7e6588eba517659ce1b79a144e54938 JPush: 1fd7a326e7e6588eba517659ce1b79a144e54938
jpush_flutter: d5fd523a73277ed66d453fc7ac1c981d1fa525e2 jpush_flutter: d5fd523a73277ed66d453fc7ac1c981d1fa525e2
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
open_file: 02eb5cb6b21264bd3a696876f5afbfb7ca4f4b7d open_file: 02eb5cb6b21264bd3a696876f5afbfb7ca4f4b7d
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
share: 0b2c3e82132f5888bccca3351c504d0003b3b410 share: 0b2c3e82132f5888bccca3351c504d0003b3b410
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d

@ -180,6 +180,22 @@ class R {
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/commerc.png) /// ![preview](file:///Users/datang/aku_new_community/assets/icons/commerc.png)
static const String ASSETS_ICONS_COMMERC_PNG = 'assets/icons/commerc.png'; static const String ASSETS_ICONS_COMMERC_PNG = 'assets/icons/commerc.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/community_comment.png)
static const String ASSETS_ICONS_COMMUNITY_COMMENT_PNG =
'assets/icons/community_comment.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/community_comment_is.png)
static const String ASSETS_ICONS_COMMUNITY_COMMENT_IS_PNG =
'assets/icons/community_comment_is.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/community_like.png)
static const String ASSETS_ICONS_COMMUNITY_LIKE_PNG =
'assets/icons/community_like.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/community_like_is.png)
static const String ASSETS_ICONS_COMMUNITY_LIKE_IS_PNG =
'assets/icons/community_like_is.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/complaint.png) /// ![preview](file:///Users/datang/aku_new_community/assets/icons/complaint.png)
static const String ASSETS_ICONS_COMPLAINT_PNG = 'assets/icons/complaint.png'; static const String ASSETS_ICONS_COMPLAINT_PNG = 'assets/icons/complaint.png';
@ -425,6 +441,10 @@ class R {
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/icon_more.png) /// ![preview](file:///Users/datang/aku_new_community/assets/icons/icon_more.png)
static const String ASSETS_ICONS_ICON_MORE_PNG = 'assets/icons/icon_more.png'; static const String ASSETS_ICONS_ICON_MORE_PNG = 'assets/icons/icon_more.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/icon_more_black.png)
static const String ASSETS_ICONS_ICON_MORE_BLACK_PNG =
'assets/icons/icon_more_black.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/icon_my_car.png) /// ![preview](file:///Users/datang/aku_new_community/assets/icons/icon_my_car.png)
static const String ASSETS_ICONS_ICON_MY_CAR_PNG = static const String ASSETS_ICONS_ICON_MY_CAR_PNG =
'assets/icons/icon_my_car.png'; 'assets/icons/icon_my_car.png';
@ -489,6 +509,9 @@ class R {
static const String ASSETS_ICONS_ICON_SETTING_PNG = static const String ASSETS_ICONS_ICON_SETTING_PNG =
'assets/icons/icon_setting.png'; 'assets/icons/icon_setting.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/icon_sort.png)
static const String ASSETS_ICONS_ICON_SORT_PNG = 'assets/icons/icon_sort.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/icons/icon_thumbsUp.png) /// ![preview](file:///Users/datang/aku_new_community/assets/icons/icon_thumbsUp.png)
static const String ASSETS_ICONS_ICON_THUMBSUP_PNG = static const String ASSETS_ICONS_ICON_THUMBSUP_PNG =
'assets/icons/icon_thumbsUp.png'; 'assets/icons/icon_thumbsUp.png';
@ -842,6 +865,10 @@ class R {
static const String ASSETS_IMAGES_COMMITMENT_PNG = static const String ASSETS_IMAGES_COMMITMENT_PNG =
'assets/images/commitment.png'; 'assets/images/commitment.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/images/community_my_bg.png)
static const String ASSETS_IMAGES_COMMUNITY_MY_BG_PNG =
'assets/images/community_my_bg.png';
/// ![preview](file:///Users/datang/aku_new_community/assets/images/contact_manager.png) /// ![preview](file:///Users/datang/aku_new_community/assets/images/contact_manager.png)
static const String ASSETS_IMAGES_CONTACT_MANAGER_PNG = static const String ASSETS_IMAGES_CONTACT_MANAGER_PNG =
'assets/images/contact_manager.png'; 'assets/images/contact_manager.png';

@ -1,9 +1,9 @@
class API { class API {
///HOST ///HOST
static const String host = 'http://39.103.177.88:8804'; static const String host = 'http://shop.kaidalai.cn';
/// ///
static const String baseURL = '$host/IntelligentCommunity/app'; static const String baseURL = '$host/api/app';
/// ///
static String get resource => '$host/static'; static String get resource => '$host/static';

@ -64,7 +64,7 @@ class MainInitialize {
}); });
} on PlatformException {} } on PlatformException {}
jpush.setup( jpush.setup(
appKey: "00e20fef79ee804d5c9abb54", appKey: "5f42cbb15abcdda6f8aeb925",
channel: "developer-default", channel: "developer-default",
production: false, production: false,
debug: true, debug: true,

@ -11,9 +11,12 @@ class EventItemModel {
String? gambitTitle; String? gambitTitle;
String? createDate; String? createDate;
List<LikeNames>? likeNames; List<LikeNames>? likeNames;
num? likeNamesNum;
List<ImgModel>? imgUrls; List<ImgModel>? imgUrls;
List<ImgModel>? headSculptureImgUrl; List<ImgModel>? headSculptureImgUrl;
num? gambitThemeCommentNum;
List<GambitThemeCommentVoList>? gambitThemeCommentVoList; List<GambitThemeCommentVoList>? gambitThemeCommentVoList;
num? views;
DateTime? get date => DateUtil.getDateTime(createDate!); DateTime? get date => DateUtil.getDateTime(createDate!);
@ -27,9 +30,10 @@ class EventItemModel {
this.gambitTitle, this.gambitTitle,
this.createDate, this.createDate,
this.likeNames, this.likeNames,
this.likeNamesNum,
this.imgUrls, this.imgUrls,
this.headSculptureImgUrl, this.headSculptureImgUrl,
this.gambitThemeCommentVoList}); this.gambitThemeCommentVoList,this.gambitThemeCommentNum,this.views});
EventItemModel.fromJson(Map<String, dynamic> json) { EventItemModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -40,6 +44,9 @@ class EventItemModel {
content = json['content']; content = json['content'];
gambitTitle = json['gambitTitle']; gambitTitle = json['gambitTitle'];
createDate = json['createDate']; createDate = json['createDate'];
likeNamesNum = json['likeNamesNum'];
views = json['views'];
gambitThemeCommentNum = json['gambitThemeCommentNum'];
if (json['likeNames'] != null) { if (json['likeNames'] != null) {
likeNames = []; likeNames = [];
json['likeNames'].forEach((v) { json['likeNames'].forEach((v) {
@ -80,6 +87,9 @@ class EventItemModel {
data['content'] = this.content; data['content'] = this.content;
data['gambitTitle'] = this.gambitTitle; data['gambitTitle'] = this.gambitTitle;
data['createDate'] = this.createDate; data['createDate'] = this.createDate;
data['likeNamesNum'] = this.likeNamesNum;
data['views'] = this.views;
data['gambitThemeCommentNum'] = this.gambitThemeCommentNum;
if (this.likeNames != null) { if (this.likeNames != null) {
data['likeNames'] = this.likeNames!.map((v) => v.toJson()).toList(); data['likeNames'] = this.likeNames!.map((v) => v.toJson()).toList();
} }

@ -90,14 +90,15 @@ class _SplashPageState extends State<SplashPage> {
// ), // ),
actions: [ actions: [
CupertinoDialogAction(
child: Text('同意'),
onPressed: () => Get.back(result: true),
),
CupertinoDialogAction( CupertinoDialogAction(
child: Text('拒绝'), child: Text('拒绝'),
onPressed: () => Get.back(result: false), onPressed: () => Get.back(result: false),
), ),
CupertinoDialogAction(
child: Text('同意'),
onPressed: () => Get.back(result: true),
),
], ],
); );
}, },

@ -3,6 +3,7 @@ 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/board_model.dart';
import 'package:aku_new_community/model/community/community_topic_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/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/community/swiper_model.dart';
import 'package:aku_new_community/model/good/category_model.dart'; import 'package:aku_new_community/model/good/category_model.dart';
import 'package:aku_new_community/model/good/market_swiper_model.dart'; import 'package:aku_new_community/model/good/market_swiper_model.dart';
@ -26,6 +27,18 @@ class CommunityFunc {
.toList(); .toList();
} }
///
static Future<List<MyEventItemModel>> getMyEventItem() async {
BaseListModel model = await NetUtil().getList(
API.community.myEvent,
params: {'pageNum': 1, 'size': 8},
);
if (model.tableList!.length == 0) return [];
return model.tableList!
.map((e) => MyEventItemModel.fromJson(e))
.toList();
}
/// ///
static Future<List<HotNewsModel>> getHotNews() async { static Future<List<HotNewsModel>> getHotNews() async {
BaseListModel model = await NetUtil().getList( BaseListModel model = await NetUtil().getList(

@ -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_list_model.dart';
import 'package:aku_new_community/utils/network/base_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/utils/network/net_util.dart';
import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -61,8 +62,8 @@ class _CommunityPageState extends State<CommunityPage>
super.initState(); super.initState();
_easyRefreshController = EasyRefreshController(); _easyRefreshController = EasyRefreshController();
final userProvider = Provider.of<UserProvider>(context, listen: false); final userProvider = Provider.of<UserProvider>(context, listen: false);
if (userProvider.isLogin) _tabs = ['最新', '话题', '我的']; if (userProvider.isLogin) _tabs = ['附近社区', '我的动态'];
if (userProvider.isNotLogin) _tabs = ['最新', '话题']; if (userProvider.isNotLogin) _tabs = ['附近社区'];
_tabController = TabController( _tabController = TabController(
vsync: this, vsync: this,
length: _tabs.length, length: _tabs.length,
@ -84,17 +85,41 @@ class _CommunityPageState extends State<CommunityPage>
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
titleSpacing: 10.0, titleSpacing: 10.0,
title: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [ title: Align(
Text( alignment: Alignment.centerLeft,
'附近社区', child: Theme(
style: TextStyle( data: ThemeData(
fontWeight: FontWeight.bold, splashColor: Colors.transparent,
fontSize: 32.sp, highlightColor: Colors.transparent,
color: Color(0xff333333), ),
), child: TabBar(
textAlign: TextAlign.center, onTap: (index) {
setState(() {});
},
controller: _tabController,
indicatorColor: Color(0xffffc40c),
indicatorPadding: EdgeInsets.only(bottom: 15.w),
indicator: const BoxDecoration(),
tabs: _tabs.map((e) => Tab(text: e)).toList(),
labelStyle:
TextStyle(fontSize: 32.sp, fontWeight: FontWeight.bold),
labelColor: Color(0xD9000000),
unselectedLabelStyle: TextStyle(fontSize: 32.sp),
unselectedLabelColor: Color(0x73000000),
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, backgroundColor: Colors.white,
actions: [ actions: [
Padding( Padding(
@ -106,12 +131,10 @@ class _CommunityPageState extends State<CommunityPage>
if (result == true) { if (result == true) {
switch (_tabController!.index) { switch (_tabController!.index) {
case 0: case 0:
newKey.currentState!.refresh(); _easyRefreshController.callRefresh();
break; break;
case 1: case 1:
// topicKey.currentState!.refresh();
break;
case 2:
myKey.currentState!.refresh(); myKey.currentState!.refresh();
break; break;
} }
@ -122,32 +145,65 @@ class _CommunityPageState extends State<CommunityPage>
), ),
) )
], ],
bottom: PreferredSize( // bottom: _tabController!.index==0?PreferredSize(
preferredSize: Size.fromHeight(90.w), child: _geSearch()), // preferredSize: Size.fromHeight(90.w), child: _geSearch()):
), // PreferredSize(
// floatingActionButton: FloatingActionButton( // preferredSize: Size.fromHeight(311.w), child: Container(
// onPressed: () async { // child: Column(
// if (LoginUtil.isNotLogin) return; // crossAxisAlignment: CrossAxisAlignment.center,
// bool? result = await Get.to(() => AddNewEventPage()); // children: [
// if (result == true) { // Image.asset(R.ASSETS_ICONS_ICON_LOGISTICS_PNG,width: 132.w,height: 132.w,),
// switch (_tabController!.index) { // 32.hb,
// case 0: // '吼姆拉'.text.size(32.sp).fontWeight(FontWeight.bold).color(Color(0xD9000000)).make(),
// newKey.currentState!.refresh(); // 12.hb,
// break; // '当一个新时代的天之圣杯'.text.size(24.sp).color(Color(0x73000000)).make(),
// case 1: //
// topicKey.currentState!.refresh(); // ],
// break;
// case 2:
// myKey.currentState!.refresh();
// break;
// }
// }
// },
// heroTag: 'event_add',
// child: Icon(Icons.add),
// ), // ),
// )),
),
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(() {
body: EasyRefresh( });
}
))
.toList()
],
),
),
MyCommunityView(key: myKey),
]
: [
EasyRefresh(
firstRefresh: true, firstRefresh: true,
header: MaterialHeader(), header: MaterialHeader(),
controller: _easyRefreshController, controller: _easyRefreshController,
@ -162,6 +218,7 @@ class _CommunityPageState extends State<CommunityPage>
? SizedBox() ? SizedBox()
: ListView( : ListView(
children: [ children: [
_geSearch(),
2.hb, 2.hb,
_hotNewsModels.isEmpty ? SizedBox() : _getInfo(), _hotNewsModels.isEmpty ? SizedBox() : _getInfo(),
16.hb, 16.hb,
@ -169,12 +226,20 @@ class _CommunityPageState extends State<CommunityPage>
16.hb, 16.hb,
..._newItems ..._newItems
.map((e) => ChatCard( .map((e) => ChatCard(
model: e, model: e,onDelete:() {
_easyRefreshController.callRefresh();
setState(() {
});
}
)) ))
.toList() .toList()
], ],
), ),
), ),
],
controller: _tabController,
),
// ListView( // ListView(
// children: [ // children: [
@ -282,6 +347,8 @@ class _CommunityPageState extends State<CommunityPage>
Spacer(), Spacer(),
GestureDetector( GestureDetector(
onTap: onTap, onTap: onTap,
child: Container(
color: Colors.transparent,
child: Row( child: Row(
children: [ children: [
suffixTitle.text.size(24.sp).color(Color(0xFF999999)).make(), suffixTitle.text.size(24.sp).color(Color(0xFF999999)).make(),
@ -294,6 +361,7 @@ class _CommunityPageState extends State<CommunityPage>
], ],
), ),
), ),
),
//24.wb, //24.wb,
], ],
); );
@ -427,8 +495,8 @@ class _CommunityPageState extends State<CommunityPage>
_geSearch() { _geSearch() {
return Container( return Container(
margin: EdgeInsets.symmetric(horizontal: 32.w), padding: EdgeInsets.only(bottom: 20.w,left: 32.w,right: 32.w),
padding: EdgeInsets.only(bottom: 20.w), color: Colors.white,
child: MaterialButton( child: MaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
height: 74.w, height: 74.w,

@ -1,18 +1,32 @@
import 'dart:math';
import 'package:aku_new_community/constants/api.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/model/community/event_item_model.dart';
import 'package:aku_new_community/ui/community/community_views/widgets/chat_card.dart'; import 'package:aku_new_community/provider/user_provider.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/login_util.dart';
import 'package:aku_new_community/utils/network/base_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/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_scaffold.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/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.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 { class EventDetailPage extends StatefulWidget {
final int? themeId; final int? themeId;
final EventItemModel eventItemModel;
final VoidCallback? onDelete;
EventDetailPage({ EventDetailPage({
Key? key, Key? key,
required this.themeId, required this.themeId,
required this.eventItemModel, this.onDelete,
}) : super(key: key); }) : super(key: key);
@override @override
@ -23,10 +37,89 @@ class _EventDetailPageState extends State<EventDetailPage> {
EasyRefreshController _refreshController = EasyRefreshController(); EasyRefreshController _refreshController = EasyRefreshController();
EventItemModel? _model; EventItemModel? _model;
bool get _isMyself {
final userProvider = Provider.of<UserProvider>(context, listen: false);
return (userProvider.userInfoModel?.id ?? -1) ==
widget.eventItemModel.createId;
}
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '详情', 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 {
if (LoginUtil.isNotLogin) return;
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(
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.themeId},
showMessage: true,
);
if (widget.onDelete != null) {
widget.onDelete!();
Get.back();
}
}
}
},
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),
],
body: EasyRefresh( body: EasyRefresh(
controller: _refreshController, controller: _refreshController,
header: MaterialHeader(), header: MaterialHeader(),
@ -43,7 +136,7 @@ class _EventDetailPageState extends State<EventDetailPage> {
? SizedBox() ? SizedBox()
: ListView( : ListView(
children: [ children: [
ChatCard( ChatCardDetail(
model: _model, model: _model,
hideLine: true, hideLine: true,
canTap: false, canTap: false,
@ -53,4 +146,104 @@ class _EventDetailPageState extends State<EventDetailPage> {
), ),
); );
} }
_bottomButton() {
final userProvider = Provider.of<UserProvider>(context);
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: '不可评论');
},
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,
'评论'
.text
.size(30.sp)
.color(Color(0xFF999999))
.make(),
],
),
),
),
),
Expanded(
child: GestureDetector(
onTap: ()async{
await NetUtil().get(
API.community.like,
params: {'themeId': widget.eventItemModel.id},
showMessage: true,
);
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(),
],
),
),
),
),
],
)
);
}
} }

@ -1,10 +1,21 @@
import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/main_initialize.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/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/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/ui/community/community_views/widgets/my_event_card.dart';
import 'package:aku_new_community/utils/headers.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/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import '../community_func.dart';
class MyCommunityView extends StatefulWidget { class MyCommunityView extends StatefulWidget {
MyCommunityView({Key? key}) : super(key: key); MyCommunityView({Key? key}) : super(key: key);
@ -16,6 +27,8 @@ class MyCommunityView extends StatefulWidget {
class MyCommunityViewState extends State<MyCommunityView> class MyCommunityViewState extends State<MyCommunityView>
with AutomaticKeepAliveClientMixin { with AutomaticKeepAliveClientMixin {
EasyRefreshController _refreshController = EasyRefreshController(); EasyRefreshController _refreshController = EasyRefreshController();
bool _onload = true;
List<MyEventItemModel> _myEventItems = [];
refresh() { refresh() {
_refreshController.callRefresh(); _refreshController.callRefresh();
@ -24,7 +37,93 @@ class MyCommunityViewState extends State<MyCommunityView>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return BeeListView<MyEventItemModel>( return EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
controller: _refreshController,
onRefresh: () async {
// API.community.myEvent
_myEventItems = await CommunityFunc.getMyEventItem();
_onload = false;
setState(() {});
},
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(),
],
),
),
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(),
],
),
);
BeeListView<MyEventItemModel>(
path: API.community.myEvent, path: API.community.myEvent,
controller: _refreshController, controller: _refreshController,
convert: (model) { convert: (model) {
@ -46,6 +145,160 @@ class MyCommunityViewState extends State<MyCommunityView>
); );
}, },
); );
}
Widget _getMoments( MyEventItemModel item){
return Container(
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,
// );
//
// }
},
child: Container(
width: 32.w,
height: 32.w,
child: Image.asset(
R.ASSETS_ICONS_ICON_MORE_PNG,
width: 32.w,
height: 32.w,
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)
],
),
],
),
),
);
}
_renderImage(MyEventItemModel item) {
if (item.imgUrl!.isEmpty) return SizedBox();
if (item.imgUrl!.length == 1)
return MaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: EdgeInsets.zero,
clipBehavior: Clip.antiAlias,
minWidth: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w),
),
onPressed: () {
BeeImagePreview.toPath(
path: ImgModel.first(item.imgUrl),
tag: ImgModel.first(item.imgUrl),
);
},
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: 300.w,
maxWidth: 300.w,
),
child: Hero(
tag: ImgModel.first(item.imgUrl),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(ImgModel.first(item.imgUrl)),
imageErrorBuilder: (context, error, stackTrace) {
return Image.asset(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
height: 300.w,
width: 300.w,
);
},
),
),
),
);
else
return Container(
width: 552.w,
child: BeeGridImageView(
urls: item.imgUrl!.map((e) => e.url).toList()),
);
} }
@override @override

@ -9,6 +9,7 @@ import 'package:aku_new_community/ui/community/community_views/widgets/send_a_ch
import 'package:aku_new_community/utils/bee_date_util.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/headers.dart';
import 'package:aku_new_community/utils/login_util.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/utils/network/net_util.dart';
import 'package:aku_new_community/widget/picker/bee_image_preview.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:aku_new_community/widget/views/bee_grid_image_view.dart';
@ -21,9 +22,9 @@ import 'package:velocity_x/velocity_x.dart';
class ChatCard extends StatefulWidget { class ChatCard extends StatefulWidget {
final EventItemModel? model; final EventItemModel? model;
final VoidCallback? onDelete; final VoidCallback? onDelete;
final bool hideLine; final bool hideLine;
final bool canTap; final bool canTap;
@ -67,8 +68,6 @@ class _ChatCardState extends State<ChatCard> {
maxHeight: 300.w, maxHeight: 300.w,
maxWidth: 300.w, maxWidth: 300.w,
), ),
child: Hero(
tag: ImgModel.first(widget.model!.imgUrls),
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(ImgModel.first(widget.model!.imgUrls)), image: API.image(ImgModel.first(widget.model!.imgUrls)),
@ -80,7 +79,7 @@ class _ChatCardState extends State<ChatCard> {
); );
}, },
), ),
),
), ),
); );
else else
@ -211,6 +210,38 @@ class _ChatCardState extends State<ChatCard> {
}); });
} }
_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() { _renderLike() {
return Padding( return Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w), padding: EdgeInsets.symmetric(horizontal: 16.w),
@ -291,8 +322,13 @@ class _ChatCardState extends State<ChatCard> {
child: MaterialButton( child: MaterialButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: widget.canTap onPressed: widget.canTap
? () { ? () async{
Get.to(() => EventDetailPage(themeId: widget.model!.id)); 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,));
} }
: null, : null,
child: Column( child: Column(
@ -343,11 +379,16 @@ class _ChatCardState extends State<ChatCard> {
), ),
Spacer(), Spacer(),
PopupMenuButton( PopupMenuButton(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w)), borderRadius: BorderRadius.circular(8.w)),
itemBuilder: (context) { itemBuilder: (context) {
return [ return [
_isMyself?
PopupMenuItem( PopupMenuItem(
child: '删除'.text.isIntrinsic.make(),
value: 0,
):PopupMenuItem(
child: '举报'.text.isIntrinsic.make(), child: '举报'.text.isIntrinsic.make(),
value: 0, value: 0,
), ),
@ -355,15 +396,48 @@ class _ChatCardState extends State<ChatCard> {
}, },
onSelected: (dynamic _) async { onSelected: (dynamic _) async {
if (LoginUtil.isNotLogin) return; if (LoginUtil.isNotLogin) return;
if(!_isMyself){
VoidCallback cancel = BotToast.showLoading(); VoidCallback cancel = BotToast.showLoading();
await Future.delayed( await Future.delayed(
Duration(milliseconds: 500 + Random().nextInt(500))); Duration(milliseconds: 500 + Random().nextInt(500)));
cancel(); cancel();
BotToast.showText(text: '举报成功'); BotToast.showText(text: '举报成功');
}else{
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: Container( child: Container(
width: 40.w, width: 80.w,
height: 32.w, height: 80.w,
alignment: Alignment.center,
child: Image.asset( child: Image.asset(
R.ASSETS_ICONS_ICON_MORE_PNG, R.ASSETS_ICONS_ICON_MORE_PNG,
width: 8.w, width: 8.w,
@ -372,6 +446,7 @@ class _ChatCardState extends State<ChatCard> {
)), )),
).paddingOnly(right: 32.w), ).paddingOnly(right: 32.w),
].row(), ].row(),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -406,53 +481,56 @@ class _ChatCardState extends State<ChatCard> {
Divider(height: 1.w, thickness: 1.w), Divider(height: 1.w, thickness: 1.w),
10.hb, 10.hb,
Row( // Row(
children: [ // children: [
64.hb, // // 64.hb,
_isMyself // _isMyself
? TextButton( // ? TextButton(
onPressed: () async { // onPressed: () async {
bool? result = // bool? result =
await Get.dialog(CupertinoAlertDialog( // await Get.dialog(CupertinoAlertDialog(
title: '你确定删除吗'.text.isIntrinsic.make(), // title: '你确定删除吗'.text.isIntrinsic.make(),
actions: [ // actions: [
CupertinoDialogAction( // CupertinoDialogAction(
child: '取消'.text.black.isIntrinsic.make(), // child: '取消'.text.black.isIntrinsic.make(),
onPressed: () => Get.back(), // onPressed: () => Get.back(),
), // ),
CupertinoDialogAction( // CupertinoDialogAction(
child: '确定' // child: '确定'
.text // .text
.color(Colors.orange) // .color(Colors.orange)
.isIntrinsic // .isIntrinsic
.make(), // .make(),
onPressed: () => Get.back(result: true), // onPressed: () => Get.back(result: true),
), // ),
], // ],
)); // ));
//
if (result == true) { // if (result == true) {
await NetUtil().get( // await NetUtil().get(
API.community.deleteMyEvent, // API.community.deleteMyEvent,
params: {'themeId': widget.model!.id}, // params: {'themeId': widget.model!.id},
showMessage: true, // showMessage: true,
); // );
if (widget.onDelete != null) widget.onDelete!(); // if (widget.onDelete != null) widget.onDelete!();
} // }
}, // },
child: '删除'.text.black.size(28.sp).make(), // child: '删除'.text.black.size(28.sp).make(),
) // )
: SizedBox(), // : SizedBox(),
Spacer(), // Spacer(),
_buildMoreButton(), // // _buildLikeAndComment(),
20.wb, // //_buildMoreButton(),
], // 20.wb,
), // ],
// _renderLikeAndComment(), // ),
// 20.hb,
_buildLikeAndComment(),
//_renderLikeAndComment(),
], ],
), ),
], ],
).paddingOnly(top: 24.w, bottom: 32.w), ).paddingOnly(top: 32.w, bottom: 32.w),
), ),
).paddingOnly(bottom: 16.w); ).paddingOnly(bottom: 16.w);
} }

@ -0,0 +1,569 @@
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/common/img_model.dart';
import 'package:aku_new_community/model/community/event_item_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/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: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 ChatCardDetail extends StatefulWidget {
final EventItemModel? model;
final VoidCallback? onDelete;
final bool hideLine;
final bool canTap;
ChatCardDetail({
Key? key,
required this.model,
this.onDelete,
this.hideLine = false,
this.canTap = true,
}) : super(key: key);
@override
_ChatCardDetailState createState() => _ChatCardDetailState();
}
class _ChatCardDetailState extends State<ChatCardDetail> {
bool get _isMyself {
final userProvider = Provider.of<UserProvider>(context, listen: false);
return (userProvider.userInfoModel?.id ?? -1) == widget.model!.createId;
}
_renderImage() {
if (widget.model!.imgUrls!.isEmpty) return SizedBox();
if (widget.model!.imgUrls!.length == 1)
return MaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: EdgeInsets.zero,
clipBehavior: Clip.antiAlias,
minWidth: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w),
),
onPressed: () {
BeeImagePreview.toPath(
path: ImgModel.first(widget.model!.imgUrls),
tag: ImgModel.first(widget.model!.imgUrls),
);
},
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: 300.w,
maxWidth: 300.w,
),
child: Hero(
tag: ImgModel.first(widget.model!.imgUrls),
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,
);
},
),
),
),
);
else
return BeeGridImageView(
urls: widget.model!.imgUrls!.map((e) => e.url).toList());
}
_buildMoreButton() {
return Builder(builder: (context) {
final userProvider = Provider.of<UserProvider>(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(),
),
);
}
@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),
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,
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
('评论'+'${widget.model!.gambitThemeCommentNum!}').text.size(28.sp).black.make(),
Container(
width: 32.w,
height: 2.w,
color: Color(0xCCFFB634),
)
],
),
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(),
],
),
),
),
32.wb,
],
),
_renderLikeAndComment(),
],
),
);
}
_commentWidget(List<ImgModel>? 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,
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(),
],
),
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);
}
}

@ -1,13 +1,18 @@
import 'package:aku_new_community/const/resource.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/model/common/img_model.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/model/community/my_event_item_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/event_detail_page.dart';
import 'package:aku_new_community/utils/bee_date_util.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/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/picker/bee_image_preview.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class MyEventCard extends StatelessWidget { class MyEventCard extends StatelessWidget {
@ -47,6 +52,7 @@ class MyEventCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -60,8 +66,13 @@ class MyEventCard extends StatelessWidget {
.paddingOnly(left: 32.w, top: isFirst ? 0 : 64.w, bottom: 32.w) .paddingOnly(left: 32.w, top: isFirst ? 0 : 64.w, bottom: 32.w)
: SizedBox(), : SizedBox(),
MaterialButton( MaterialButton(
onPressed: () { onPressed: () async{
Get.to(() => EventDetailPage(themeId: model.id)); BaseModel models = await NetUtil().get(
API.community.getEventDetail,
params: {'themeId': model.id},
);
EventItemModel eventItemModel = EventItemModel.fromJson(models.data);
Get.to(() => EventDetailPage(themeId: model.id, eventItemModel: eventItemModel,));
}, },
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

@ -51,27 +51,66 @@ class _SendAChatState extends State<SendAChat> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Container(
height: 120.w,
child: Row(
children: [ children: [
TextField( TextField(
focusNode: widget.node, focusNode: widget.node,
controller: _textEditingController, controller: _textEditingController,
decoration: InputDecoration( decoration: InputDecoration(
border: OutlineInputBorder(), contentPadding: EdgeInsets.only(left: 20.w),
isDense: true, filled: true,
fillColor: Color(0x0F000000),
hintText: '参与评论',
hintStyle: TextStyle(
color: Colors.grey.shade500,
fontSize: 14,
fontWeight: FontWeight.w300),
//
enabledBorder: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(40.w),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(40.w),
),
), ),
).p(16.w).expand(), ).p(16.w).expand(),
16.wb, 16.wb,
MaterialButton( GestureDetector(
color: kPrimaryColor, onTap: (){
onPressed: () {
Get.back(result: _textEditingController.text); Get.back(result: _textEditingController.text);
}, },
minWidth: 64.w, child: Container(
child: '发送'.text.make(), height: 55.w,
width: 120.w,
decoration: BoxDecoration(
color: Color(0xFFFAC058),
borderRadius: BorderRadius.all(Radius.circular(34.w)),
), ),
alignment: Alignment.center,
child: '发布'
.text
.size(28.sp)
.color(Color(0xD9000000))
.make(),
),
),
// MaterialButton(
// color: kPrimaryColor,
//
// onPressed: () {
// Get.back(result: _textEditingController.text);
// },
// minWidth: 64.w,
// child: '发送'.text.make(),
// ),
16.wb, 16.wb,
], ],
).material(color: Colors.white); ).material(color: Colors.white),
);
} }
} }

@ -0,0 +1,46 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/// 线
class VerticalLinePainter extends CustomPainter {
///线
final Color color;
///线
final double width;
///线
final double paddingLeft;
///线
final double paddingTop;
///线
final double paddingBottom;
VerticalLinePainter({
this.color: Colors.grey,
this.width: 1,
this.paddingLeft: 0,
this.paddingTop: 0,
this.paddingBottom: 0,
});
@override
void paint(Canvas canvas, Size size) {
Paint paint = Paint();
paint.style = PaintingStyle.fill;
paint.color = color;
Path path = new Path(); //使线
path.moveTo(paddingLeft, paddingTop);//
path.lineTo(paddingLeft, size.height + paddingTop - paddingBottom);//
path.lineTo(width + paddingLeft, size.height + paddingTop - paddingBottom);//
path.lineTo(width + paddingLeft, paddingTop);//
path.close();
canvas.drawPath(path, paint);
}
///
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}
Loading…
Cancel
Save