After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1,69 @@
|
||||
import 'package:akuCommunity/const/resource.dart';
|
||||
import 'package:akuCommunity/pages/convenient_phone/convenient_phone_page.dart';
|
||||
import 'package:akuCommunity/pages/fitup_manage/fitup_manage_page.dart';
|
||||
import 'package:akuCommunity/pages/goods_deto_page/goods_deto_page.dart';
|
||||
import 'package:akuCommunity/pages/goods_manage_page/goods_manage_page.dart';
|
||||
import 'package:akuCommunity/pages/industry_committee/industry_committee_page.dart';
|
||||
import 'package:akuCommunity/pages/life_pay/life_pay_page.dart';
|
||||
import 'package:akuCommunity/pages/open_door_page/open_door_page.dart';
|
||||
import 'package:akuCommunity/pages/opening_code_page/opening_code_page.dart';
|
||||
import 'package:akuCommunity/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart';
|
||||
import 'package:akuCommunity/pages/things_page/fixed_submit_page.dart';
|
||||
import 'package:akuCommunity/pages/visitor_access_page/visitor_access_page.dart';
|
||||
import 'package:akuCommunity/ui/home/application/all_application.dart';
|
||||
import 'package:akuCommunity/ui/manager/advice/advice_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
///应用对象
|
||||
///Application Object
|
||||
class AO {
|
||||
String title = '';
|
||||
String path = '';
|
||||
Widget page = Scaffold();
|
||||
|
||||
AO(
|
||||
this.title,
|
||||
this.path,
|
||||
this.page,
|
||||
);
|
||||
|
||||
AO.fromRaw(String raw) {
|
||||
appObjects.forEach((element) {
|
||||
if (element.title == raw) {
|
||||
this.title = element.title;
|
||||
this.path = element.path;
|
||||
this.page = element.page;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is AO && runtimeType == other.runtimeType && title == other.title;
|
||||
|
||||
@override
|
||||
int get hashCode => title.hashCode;
|
||||
}
|
||||
|
||||
List<AO> appObjects = [
|
||||
AO('一键开门', R.ASSETS_APPLICATIONS_OEPN_DOOR_PNG, OpenDoorPage()),
|
||||
AO('开门码', R.ASSETS_APPLICATIONS_DOOR_CODE_PNG, OpeningCodePage()),
|
||||
AO('访客邀请', R.ASSETS_APPLICATIONS_VISITOR_INVITE_PNG, VisitorAccessPage()),
|
||||
AO('报事报修', R.ASSETS_APPLICATIONS_FIX_PNG, FixedSubmitPage()),
|
||||
AO('生活缴费', R.ASSETS_APPLICATIONS_PAYMENT_PNG, LifePayPage()),
|
||||
AO('业委会', R.ASSETS_APPLICATIONS_COMMITTEE_PNG, IndustryCommitteePage()),
|
||||
AO('建议咨询', R.ASSETS_APPLICATIONS_ADVICE_PNG,
|
||||
AdvicePage(type: AdviceType.SUGGESTION)),
|
||||
AO('便民电话', R.ASSETS_APPLICATIONS_COMMUNITY_PHONE_PNG, ConvenientPhonePage()),
|
||||
AO('活动投票', R.ASSETS_APPLICATIONS_VOTE_PNG, SizedBox()),
|
||||
AO('物品出门', R.ASSETS_APPLICATIONS_GOODS_OUT_PNG, GoodsDetoPage()),
|
||||
AO('投诉表扬', R.ASSETS_APPLICATIONS_COMPLAINT_PNG,
|
||||
AdvicePage(type: AdviceType.COMPLAIN)),
|
||||
AO('问卷调查', R.ASSETS_APPLICATIONS_QUESTION_PNG, QuestionnaireDetailsPage()),
|
||||
AO('装修管理', R.ASSETS_APPLICATIONS_DECORATION_PNG, FitupManagePage()),
|
||||
AO('借还管理', R.ASSETS_APPLICATIONS_BORROW_PNG, GoodsManagePage()),
|
||||
];
|
||||
|
||||
AO allApp = AO('全部应用', R.ASSETS_APPLICATIONS_ALL_APP_PNG, AllApplicationPage());
|
@ -0,0 +1,42 @@
|
||||
import 'package:akuCommunity/constants/application_objects.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppProvider extends ChangeNotifier {
|
||||
///初始值为
|
||||
///
|
||||
///```
|
||||
///'一键开门',
|
||||
/// '访客邀请',
|
||||
/// '报事报修',
|
||||
/// '生活缴费',
|
||||
/// '业委会',
|
||||
/// '建议投诉',
|
||||
/// '便民电话',
|
||||
///```
|
||||
List<AO> _myApplications = [
|
||||
'一键开门',
|
||||
'访客邀请',
|
||||
'报事报修',
|
||||
'生活缴费',
|
||||
'业委会',
|
||||
'建议咨询',
|
||||
'便民电话',
|
||||
].map((e) => AO.fromRaw(e)).toList();
|
||||
|
||||
///我的应用
|
||||
List<AO> get myApplications {
|
||||
return _myApplications;
|
||||
}
|
||||
|
||||
///添加我的应用
|
||||
insertApplication(AO app) {
|
||||
if (!_myApplications.contains(app) && _myApplications.length < 7)
|
||||
_myApplications.insert(0, app);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
///移除我的应用
|
||||
removeApplication(AO obj) {
|
||||
if (_myApplications.remove(obj)) notifyListeners();
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/widget/bee_back_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class AllApplicationPage extends StatefulWidget {
|
||||
AllApplicationPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AllApplicationPageState createState() => _AllApplicationPageState();
|
||||
}
|
||||
|
||||
class _AllApplicationPageState extends State<AllApplicationPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Color(0xFFF4F4F4),
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
leading: BeeBackButton(),
|
||||
title: MaterialButton(
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
height: 72.w,
|
||||
shape: StadiumBorder(),
|
||||
elevation: 0,
|
||||
minWidth: double.infinity,
|
||||
color: Color(0xFFF3F3F3),
|
||||
onPressed: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.search,
|
||||
size: 32.w,
|
||||
color: Color(0xFF666666),
|
||||
),
|
||||
10.wb,
|
||||
'搜索商品、活动、帖子、应用'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(ktextSubColor)
|
||||
.make()
|
||||
.expand(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// body: ,
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/constants/application_objects.dart';
|
||||
import 'package:akuCommunity/provider/app_provider.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class ApplicationView extends StatefulWidget {
|
||||
ApplicationView({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ApplicationViewState createState() => _ApplicationViewState();
|
||||
}
|
||||
|
||||
class _ApplicationViewState extends State<ApplicationView> {
|
||||
_buildTile(AO object) {
|
||||
return MaterialButton(
|
||||
shape: StadiumBorder(),
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: () => Get.to(object.page),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
object.path,
|
||||
height: 75.w,
|
||||
width: 75.w,
|
||||
),
|
||||
8.hb,
|
||||
object.title.text.size(24.sp).make(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appProvider = Provider.of<AppProvider>(context);
|
||||
return GridView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
|
||||
itemBuilder: (context, index) {
|
||||
if (index == appProvider.myApplications.length)
|
||||
return _buildTile(allApp);
|
||||
return _buildTile(appProvider.myApplications[index]);
|
||||
},
|
||||
itemCount: appProvider.myApplications.length + 1,
|
||||
shrinkWrap: true,
|
||||
);
|
||||
}
|
||||
}
|