|
@@ -1,5 +1,6 @@
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
+import 'package:taskservice/Common/JXColors.dart';
|
|
import 'package:taskservice/Model/JXMemberModel.dart';
|
|
import 'package:taskservice/Model/JXMemberModel.dart';
|
|
import 'package:taskservice/database/DataBase.dart';
|
|
import 'package:taskservice/database/DataBase.dart';
|
|
import 'package:taskservice/src/custom_widgets.dart';
|
|
import 'package:taskservice/src/custom_widgets.dart';
|
|
@@ -12,30 +13,37 @@ class AccountListPage extends StatefulWidget {
|
|
class _AccountListPageState extends State<AccountListPage> {
|
|
class _AccountListPageState extends State<AccountListPage> {
|
|
List<JXMemberModel> members = [];
|
|
List<JXMemberModel> members = [];
|
|
@override
|
|
@override
|
|
- Future<void> initState() async {
|
|
|
|
|
|
+ initState() {
|
|
super.initState();
|
|
super.initState();
|
|
- var db = await MyDataBase.database;
|
|
|
|
- members.addAll(await db.queryAllMembers());
|
|
|
|
- setState(() {});
|
|
|
|
|
|
+ MyDataBase.database.then((db) async {
|
|
|
|
+ members.addAll(await db.queryAllMembers());
|
|
|
|
+ setState(() {});
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
return MyScaffold(title: '会员列表', body: Column(children: <Widget>[
|
|
return MyScaffold(title: '会员列表', body: Column(children: <Widget>[
|
|
SearchBar(hint: '快速筛选', onTextChanged: (value) {},),
|
|
SearchBar(hint: '快速筛选', onTextChanged: (value) {},),
|
|
- Expanded(child: ListView.builder(itemBuilder: (context, index) {
|
|
|
|
- if(index < members.length - 1) {
|
|
|
|
|
|
+ buildItems()
|
|
|
|
+ ],
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Expanded buildItems() {
|
|
|
|
+ return Expanded(child: Container(color: JXColors.kF0F0F0,
|
|
|
|
+ child: ListView.builder(physics:BouncingScrollPhysics(), itemBuilder: (context, index) {
|
|
|
|
+ if(index <= members.length - 1) {
|
|
JXMemberModel member = members[index];
|
|
JXMemberModel member = members[index];
|
|
- return Container(child: Column(children: <Widget>[
|
|
|
|
- Row(children: <Widget>[
|
|
|
|
|
|
+ return Container(decoration:BoxDecoration(color: JXColors.kFFFFFF, borderRadius: BorderRadius.circular(8)),margin: EdgeInsets.only(left: 12, right: 12, bottom: 12),padding: EdgeInsets.all(12), child: Column(children: <Widget>[
|
|
|
|
+ Row(mainAxisAlignment:MainAxisAlignment.spaceBetween,children: <Widget>[
|
|
Text(member.name),
|
|
Text(member.name),
|
|
Text(member.tel),
|
|
Text(member.tel),
|
|
],)
|
|
],)
|
|
],),);
|
|
],),);
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
- }),)
|
|
|
|
- ],
|
|
|
|
- ));
|
|
|
|
|
|
+ }),
|
|
|
|
+ ),);
|
|
}
|
|
}
|
|
}
|
|
}
|