hmxc
小赖 4 years ago
parent a9d5ae7a39
commit e26b7712a0

@ -2,6 +2,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:equatable/equatable.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
import 'package:aku_community/pages/convenient_phone/convenient_phone_page.dart'; import 'package:aku_community/pages/convenient_phone/convenient_phone_page.dart';
import 'package:aku_community/pages/event_activity/event_voting_page.dart'; import 'package:aku_community/pages/event_activity/event_voting_page.dart';
@ -26,7 +28,7 @@ import 'package:aku_community/ui/profile/house/house_owners_page.dart';
/// ///
///Application Object ///Application Object
class AO { class AO extends Equatable {
String title = ''; String title = '';
String path = ''; String path = '';
dynamic page = () => Scaffold(); dynamic page = () => Scaffold();
@ -48,17 +50,14 @@ class AO {
} }
@override @override
bool operator ==(Object other) => List<Object?> get props => [title];
other is AO && runtimeType == other.runtimeType && title == other.title;
@override
int get hashCode => title.hashCode;
} }
/// ///
List<AO> appObjects = [ List<AO> appObjects = [
AO('一键开门', R.ASSETS_APPLICATIONS_OEPN_DOOR_PNG, () => Scaffold()), if (false) AO('一键开门', R.ASSETS_APPLICATIONS_OEPN_DOOR_PNG, () => Scaffold()),
AO('开门码', R.ASSETS_APPLICATIONS_DOOR_CODE_PNG, () => OpeningCodePage()), if (false)
AO('开门码', R.ASSETS_APPLICATIONS_DOOR_CODE_PNG, () => OpeningCodePage()),
AO('访客邀请', R.ASSETS_APPLICATIONS_VISITOR_INVITE_PNG, AO('访客邀请', R.ASSETS_APPLICATIONS_VISITOR_INVITE_PNG,
() => VisitorAccessPage()), () => VisitorAccessPage()),
AO('报事报修', R.ASSETS_APPLICATIONS_FIX_PNG, () => FixedSubmitPage()), AO('报事报修', R.ASSETS_APPLICATIONS_FIX_PNG, () => FixedSubmitPage()),
@ -110,10 +109,10 @@ List<AO> userAppObjects = [
AO('我的车位', R.ASSETS_ICONS_USER_ICON_WDCW_PNG, () => CarParkingPage()), AO('我的车位', R.ASSETS_ICONS_USER_ICON_WDCW_PNG, () => CarParkingPage()),
AO('我的车', R.ASSETS_ICONS_USER_ICON_WDC_PNG, () => CarManagePage()), AO('我的车', R.ASSETS_ICONS_USER_ICON_WDC_PNG, () => CarManagePage()),
AO('社区活动', R.ASSETS_ICONS_USER_ICON_WDSQHD_PNG, () => ActivityListPage()), AO('社区活动', R.ASSETS_ICONS_USER_ICON_WDSQHD_PNG, () => ActivityListPage()),
AO('我的缴费', R.ASSETS_ICONS_USER_ICON_WDJF_PNG, () => LifePayPage()), // AO('我的缴费', R.ASSETS_ICONS_USER_ICON_WDJF_PNG, () => LifePayPage()),
AO('我的报修', R.ASSETS_ICONS_USER_ICON_WDBX_PNG, () => FixedSubmitPage()), // AO('我的报修', R.ASSETS_ICONS_USER_ICON_WDBX_PNG, () => FixedSubmitPage()),
AO('我的地址', R.ASSETS_ICONS_USER_ICON_WDDZ_PNG, () => Scaffold()), // AO('我的地址', R.ASSETS_ICONS_USER_ICON_WDDZ_PNG, () => Scaffold()),
AO('我的管家', R.ASSETS_ICONS_USER_ICON_WDGJ_PNG, () => Scaffold()), // AO('我的管家', R.ASSETS_ICONS_USER_ICON_WDGJ_PNG, () => Scaffold()),
AO('我的访客', R.ASSETS_ICONS_USER_ICON_WDFK_PNG, () => VisitorAccessPage()), AO('我的访客', R.ASSETS_ICONS_USER_ICON_WDFK_PNG, () => VisitorAccessPage()),
AO('设置', R.ASSETS_ICONS_USER_ICON_SZ_PNG, () => SettingsPage()), AO('设置', R.ASSETS_ICONS_USER_ICON_SZ_PNG, () => SettingsPage()),
]; ];
@ -124,7 +123,7 @@ AO allApp =
/// original value /// original value
List<String> _recommendApp = [ List<String> _recommendApp = [
'一键开门', if (false) '一键开门',
'访客邀请', '访客邀请',
'报事报修', '报事报修',
'建议咨询', '建议咨询',

@ -6,12 +6,13 @@
import 'package:device_info_plus_web/device_info_plus_web.dart'; import 'package:device_info_plus_web/device_info_plus_web.dart';
import 'package:firebase_core_web/firebase_core_web.dart'; import 'package:firebase_core_web/firebase_core_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart'; import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:package_info_plus_web/package_info_plus_web.dart'; import 'package:package_info_plus_web/package_info_plus_web.dart';
import 'package:shared_preferences_web/shared_preferences_web.dart'; import 'package:shared_preferences_web/shared_preferences_web.dart';
import 'package:url_launcher_web/url_launcher_web.dart'; import 'package:url_launcher_web/url_launcher_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs // ignore: public_member_api_docs
void registerPlugins(Registrar registrar) { void registerPlugins(Registrar registrar) {
DeviceInfoPlusPlugin.registerWith(registrar); DeviceInfoPlusPlugin.registerWith(registrar);

@ -191,6 +191,42 @@ class _PersonalIndexState extends State<PersonalIndex>
Widget build(BuildContext context) { Widget build(BuildContext context) {
final double _statusHeight = MediaQuery.of(context).padding.top; final double _statusHeight = MediaQuery.of(context).padding.top;
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
var orderWidget = SliverToBoxAdapter(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_containerBar('我的订单'),
GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 5,
),
shrinkWrap: true,
children: [
_orderButton(
name: '待付款',
path: R.ASSETS_ICONS_USER_ICON_DFK_PNG,
index: 1,
),
_orderButton(
name: '待收货',
path: R.ASSETS_ICONS_USER_ICON_DSH_PNG,
index: 2,
),
_orderButton(
name: '待评价',
path: R.ASSETS_ICONS_USER_ICON_DPJ_PNG,
index: 3,
),
_orderButton(
name: '售后',
path: R.ASSETS_ICONS_USER_ICON_SH_PNG,
index: 4,
),
],
),
],
),
);
return Scaffold( return Scaffold(
body: EasyRefresh( body: EasyRefresh(
header: MaterialHeader(), header: MaterialHeader(),
@ -201,42 +237,7 @@ class _PersonalIndexState extends State<PersonalIndex>
child: CustomScrollView( child: CustomScrollView(
slivers: <Widget>[ slivers: <Widget>[
_sliverAppBar(_statusHeight), _sliverAppBar(_statusHeight),
SliverToBoxAdapter( // orderWidget,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_containerBar('我的订单'),
GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 5,
),
shrinkWrap: true,
children: [
_orderButton(
name: '待付款',
path: R.ASSETS_ICONS_USER_ICON_DFK_PNG,
index: 1,
),
_orderButton(
name: '待收货',
path: R.ASSETS_ICONS_USER_ICON_DSH_PNG,
index: 2,
),
_orderButton(
name: '待评价',
path: R.ASSETS_ICONS_USER_ICON_DPJ_PNG,
index: 3,
),
_orderButton(
name: '售后',
path: R.ASSETS_ICONS_USER_ICON_SH_PNG,
index: 4,
),
],
),
],
),
),
SliverToBoxAdapter( SliverToBoxAdapter(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(

@ -1,3 +1,6 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:amap_flutter_location/amap_flutter_location.dart'; import 'package:amap_flutter_location/amap_flutter_location.dart';
@ -31,7 +34,7 @@ class AppProvider extends ChangeNotifier {
/// '便民电话', /// '便民电话',
///``` ///```
List<AO> _myApplications = [ List<AO> _myApplications = [
'一键开门', // '一键开门',
'访客邀请', '访客邀请',
'报事报修', '报事报修',
'生活缴费', '生活缴费',
@ -141,6 +144,7 @@ class AppProvider extends ChangeNotifier {
late AMapFlutterLocation _aMapFlutterLocation; late AMapFlutterLocation _aMapFlutterLocation;
startLocation() { startLocation() {
if (kIsWeb || Platform.isMacOS) return;
_aMapFlutterLocation = AMapFlutterLocation(); _aMapFlutterLocation = AMapFlutterLocation();
_aMapFlutterLocation.onLocationChanged().listen((event) { _aMapFlutterLocation.onLocationChanged().listen((event) {
_location = event; _location = event;
@ -155,6 +159,7 @@ class AppProvider extends ChangeNotifier {
} }
stopLocation() { stopLocation() {
if (kIsWeb || Platform.isMacOS) return;
_aMapFlutterLocation.stopLocation(); _aMapFlutterLocation.stopLocation();
_aMapFlutterLocation.destroy(); _aMapFlutterLocation.destroy();
} }

@ -1,3 +1,4 @@
import 'package:aku_community/base/base_style.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -25,6 +26,11 @@ class _MarketPageState extends State<MarketPage>
with AutomaticKeepAliveClientMixin, TickerProviderStateMixin { with AutomaticKeepAliveClientMixin, TickerProviderStateMixin {
late TabController _tabController; late TabController _tabController;
List<MarketCategoryModel> _marketModels = []; List<MarketCategoryModel> _marketModels = [];
Future updateMarketInfo() async {
// List<Market>
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -75,12 +81,27 @@ class _MarketPageState extends State<MarketPage>
], ],
body: NestedScrollView( body: NestedScrollView(
headerSliverBuilder: (context, value) { headerSliverBuilder: (context, value) {
var gridItems = Material(
color: Colors.white,
clipBehavior: Clip.antiAlias,
borderRadius: BorderRadius.circular(8.w),
child: GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
childAspectRatio: 1,
),
shrinkWrap: true,
children:
_marketModels.map((e) => CategoryCard(model: e)).toList(),
),
);
return [ return [
SliverAppBar( SliverAppBar(
//AppBar top Widget height //AppBar top Widget height
//bottom height: 48 //bottom height: 48
// flexibleSpace ( - )/4*2 + + bottom // flexibleSpace ( - )/4*2 + + bottom + top
expandedHeight: (mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2 + 48, expandedHeight:
(mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2 + 48 + 68.w,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
elevation: 0, elevation: 0,
flexibleSpace: FlexibleSpaceBar( flexibleSpace: FlexibleSpaceBar(
@ -92,20 +113,45 @@ class _MarketPageState extends State<MarketPage>
right: 32.w, right: 32.w,
bottom: 16.w + 48, //bottom bottom: 16.w + 48, //bottom
), ),
child: Material( child: Column(
color: Colors.white, children: [
clipBehavior: Clip.antiAlias, SizedBox(
borderRadius: BorderRadius.circular(8.w), height: 58.w,
child: GridView( child: Row(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( children: [
crossAxisCount: 4, Text(
childAspectRatio: 1, '热搜:',
style: TextStyle(
fontSize: 20.sp,
),
),
ListView.separated(
scrollDirection: Axis.horizontal,
separatorBuilder: (_, __) => 20.wb,
itemBuilder: (context, index) {
return MaterialButton(
padding:
EdgeInsets.symmetric(horizontal: 40.w),
minWidth: 0,
shape: StadiumBorder(
side: BorderSide(
color: ktextSubColor,
),
),
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
onPressed: () {},
child: Text('123'),
);
},
itemCount: 10,
).expand(),
],
),
), ),
shrinkWrap: true, 10.hb,
children: _marketModels gridItems.expand(),
.map((e) => CategoryCard(model: e)) ],
.toList(),
),
), ),
), ),
), ),

@ -96,3 +96,5 @@ flutter:
import_sorter: import_sorter:
emojis: true emojis: true
comments: false comments: false
ignored_files:
- \*\/generated_plugin_registrant.dart

Loading…
Cancel
Save