对接消息列表

hmxc
小赖 4 years ago
parent d47e9a97e7
commit c0e8ae635a

@ -0,0 +1,21 @@
class CommentMessageItemModel {
int id;
int type;
int relationId;
CommentMessageItemModel({this.id, this.type, this.relationId});
CommentMessageItemModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
relationId = json['relationId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['type'] = this.type;
data['relationId'] = this.relationId;
return data;
}
}

@ -0,0 +1,21 @@
class SystemMessageItemModel {
int id;
int type;
int relationId;
SystemMessageItemModel({this.id, this.type, this.relationId});
SystemMessageItemModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
relationId = json['relationId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['type'] = this.type;
data['relationId'] = this.relationId;
return data;
}
}

@ -1,8 +1,12 @@
// Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/message/comment_message_item_model.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
// Project imports:
@ -18,6 +22,7 @@ class CommentMessage extends StatefulWidget {
}
class _CommentMessageState extends State<CommentMessage> {
EasyRefreshController _refreshController = EasyRefreshController();
Widget _messageList(
String date,
String name,
@ -112,9 +117,7 @@ class _CommentMessageState extends State<CommentMessage> {
],
),
SizedBox(height: 16.w),
Divider(
height: 1.w,
),
Divider(height: 1.w),
AkuButton(
onPressed: () {},
child: Container(
@ -145,12 +148,18 @@ class _CommentMessageState extends State<CommentMessage> {
Widget build(BuildContext context) {
return AkuScaffold(
title: '评论消息',
body: ListView(
body: BeeListView(
controller: _refreshController,
path: API.message.commentList,
convert: (model) => model.tableList
.map((e) => CommentMessageItemModel.fromJson(e))
.toList(),
builder: (items) {
return ListView(
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w),
children: [
_messageList('2020-10-23 10:00', '杨建', '四星'),
_messageList('2020-10-24 11:00', '刘能', '四星'),
],
children: [],
);
},
),
);
}

@ -1,8 +1,12 @@
// Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/message/system_message_item_model.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:aku_ui/aku_ui.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
// Project imports:
@ -19,6 +23,8 @@ class SystemMessage extends StatefulWidget {
}
class _SystemMessageState extends State<SystemMessage> {
EasyRefreshController _refreshController = EasyRefreshController();
Widget _messageList(String date, String name, String phone, String area) {
return Column(
children: [
@ -163,12 +169,18 @@ class _SystemMessageState extends State<SystemMessage> {
Widget build(BuildContext context) {
return AkuScaffold(
title: '系统消息',
body: ListView(
body: BeeListView(
controller: _refreshController,
builder: (items) {
return ListView(
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w),
children: [
_messageList('2020-10-23 10:00', '杨建', '17867665666', '共区'),
_messageList('2020-10-22 10:00', '刘能', '17855823545', '共区'),
],
children: [],
);
},
path: API.message.systemList,
convert: (model) => model.tableList
.map((e) => SystemMessageItemModel.fromJson(e))
.toList(),
),
);
}

@ -1,4 +1,5 @@
// Flutter imports:
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/utils/network/base_list_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:flutter/material.dart';
@ -6,7 +7,6 @@ import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_easyrefresh/easy_refresh.dart';
/// ## BeeListView
///```dart
///BeeListView(
@ -90,7 +90,9 @@ class _BeeListViewState<T> extends State<BeeListView> {
Widget build(BuildContext context) {
return EasyRefresh(
controller: widget.controller,
header: MaterialHeader(),
header: MaterialHeader(
valueColor: AlwaysStoppedAnimation(AppStyle.primaryColor),
),
footer: MaterialFooter(),
onRefresh: () async {
_pageNum = 1;

Loading…
Cancel
Save