添加我的车位管理页面

hmxc
小赖 4 years ago
parent adc0960307
commit 87f399aca3

@ -0,0 +1,3 @@
class AppValues {
static const String plotName = '人才公寓智慧小区';
}

@ -0,0 +1,28 @@
import 'package:flustars/flustars.dart';
class CarParkingModel {
String code;
int type;
String effectiveTimeEnd;
DateTime get effectiveDate => DateUtil.getDateTime(effectiveTimeEnd);
bool get outdated {
DateTime now = DateTime.now();
return effectiveDate.isAfter(now);
}
CarParkingModel({this.code, this.type, this.effectiveTimeEnd});
CarParkingModel.fromJson(Map<String, dynamic> json) {
code = json['code'];
type = json['type'];
effectiveTimeEnd = json['effectiveTimeEnd'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['code'] = this.code;
data['type'] = this.type;
data['effectiveTimeEnd'] = this.effectiveTimeEnd;
return data;
}
}

@ -1,3 +1,4 @@
import 'package:akuCommunity/constants/app_values.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -39,7 +40,7 @@ class _AnimateAppBarState extends State<AnimateAppBar> {
Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
return AppBar(
title: Text('人才公寓智慧小区'),
title: Text(AppValues.plotName),
backgroundColor: _bgColor,
leading: Container(
margin: EdgeInsets.only(left: 32.w),

@ -240,7 +240,10 @@ class _SignInPageState extends State<SignInPage> {
controller: _code,
suffix: MaterialButton(
height: 82.w,
shape: StadiumBorder(),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.horizontal(right: Radius.circular(41.w)),
),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
child: Text(
_timer?.isActive ?? false

@ -98,7 +98,7 @@ class _BeeListViewState<T> extends State<BeeListView> {
);
_models = widget.convert(_model);
widget.controller?.resetLoadState();
setState(() {});
if(mounted)setState(() {});
},
firstRefresh: true,
onLoad: () async {

@ -1,3 +1,4 @@
import 'package:akuCommunity/model/user/car_parking_model.dart';
import 'package:akuCommunity/model/user/house_model.dart';
import 'package:flutter/material.dart';
@ -201,4 +202,11 @@ class AppProvider extends ChangeNotifier {
_selectedHouse = model;
notifyListeners();
}
List<CarParkingModel> _carParkingModels = [];
List<CarParkingModel> get carParkingModels => _carParkingModels;
updateCarParkingModels(List<CarParkingModel> models) {
_carParkingModels = models;
notifyListeners();
}
}

@ -1,12 +1,14 @@
import 'package:akuCommunity/constants/app_values.dart';
import 'package:akuCommunity/model/user/car_parking_model.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:flutter/material.dart';
class CarparkingCard extends StatelessWidget {
final bool outdated;
const CarparkingCard({Key key, @required this.outdated}) : super(key: key);
final CarParkingModel model;
const CarparkingCard({Key key, @required this.model}) : super(key: key);
String get _assetImage {
return outdated
return model.outdated
? R.ASSETS_STATIC_PARKING_GREY_WEBP
: R.ASSETS_STATIC_PARKING_YELLOW_WEBP;
}
@ -16,11 +18,39 @@ class CarparkingCard extends StatelessWidget {
return AspectRatio(
aspectRatio: 688 / 286,
child: Container(
padding: EdgeInsets.all(40.w),
child: Column(
children: [],
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'地上车位B0001',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 36.sp,
),
),
Text(
AppValues.plotName,
style: Theme.of(context)
.textTheme
.subtitle2
.copyWith(color: Color(0xFF999999)),
),
Spacer(),
Row(
children: [
Column(
children: [
Text('类型'),
],
),
],
),
],
),
decoration: BoxDecoration(
image: DecorationImage(image: AssetImage(_assetImage)),
borderRadius: BorderRadius.circular(4.w),
),
),
);

@ -0,0 +1,7 @@
import 'package:akuCommunity/model/user/car_parking_model.dart';
class CarParkingFunc {
static Future<CarParkingModel> getCarParkingModels() async {
// return
}
}

@ -1,8 +1,10 @@
import 'package:akuCommunity/provider/app_provider.dart';
import 'package:akuCommunity/ui/profile/car_parking/car_parking_card.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:provider/provider.dart';
class CarParkingPage extends StatefulWidget {
CarParkingPage({Key key}) : super(key: key);
@ -35,6 +37,7 @@ class _CarParkingPageState extends State<CarParkingPage> {
@override
Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
return BeeScaffold(
title: '我的车位',
actions: [
@ -46,14 +49,15 @@ class _CarParkingPageState extends State<CarParkingPage> {
body: EasyRefresh(
onRefresh: () async {},
header: MaterialHeader(),
// emptyWidget: _renderEmptyWidget,
emptyWidget:
appProvider.carParkingModels.isEmpty ? _renderEmptyWidget : null,
child: ListView.separated(
separatorBuilder: (context, index) => 32.hb,
itemBuilder: (context, index) {
return CarparkingCard(outdated: false);
return CarparkingCard(model: appProvider.carParkingModels[index]);
},
padding: EdgeInsets.all(32.w),
itemCount: 2,
itemCount: appProvider.carParkingModels.length,
),
),
);

@ -0,0 +1,16 @@
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
class ManageCarParkingPage extends StatefulWidget {
ManageCarParkingPage({Key key}) : super(key: key);
@override
_ManageCarParkingPageState createState() => _ManageCarParkingPageState();
}
class _ManageCarParkingPageState extends State<ManageCarParkingPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(title: '我的车位');
}
}

@ -0,0 +1,10 @@
import 'package:flutter/material.dart';
class ManageCarParkingCard extends StatelessWidget {
const ManageCarParkingCard({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container();
}
}

@ -1,3 +1,4 @@
import 'package:akuCommunity/constants/app_values.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -170,7 +171,7 @@ class _AddHousePageState extends State<AddHousePage> {
_renderTile(
title: '小区名称',
item: _renderPicker(
text: '人才公寓智慧小区',
text: AppValues.plotName,
hintText: '请选择小区',
//
// TODO

@ -1,4 +1,5 @@
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/constants/app_values.dart';
import 'package:akuCommunity/model/user/house_model.dart';
import 'package:akuCommunity/ui/profile/house/pick_my_house_page.dart';
import 'package:flutter/material.dart';
@ -118,7 +119,7 @@ class HouseCard extends StatelessWidget {
),
12.hb,
Text(
'人才公寓智慧小区',
AppValues.plotName,
style: Theme.of(context).textTheme.headline3,
),
10.hb,

@ -75,11 +75,20 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
),
if (!_emptyHouse) 88.hb,
if (!_haveAuthedHouse)
Stack(
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 75.w),
child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP),
),
Center(child: _houseTitle),
Positioned(
bottom: 100.w,
left: 0,
right: 0,
child: _houseTitle.centered(),
),
],
),
if (_emptyHouse)
Center(
child: ElevatedButton(

@ -1,4 +1,5 @@
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/constants/app_values.dart';
import 'package:akuCommunity/model/user/house_model.dart';
import 'package:akuCommunity/provider/app_provider.dart';
import 'package:akuCommunity/ui/profile/house/add_house_page.dart';
@ -190,7 +191,7 @@ class _HouseCard extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Text(
'人才公寓智慧小区',
AppValues.plotName,
style: Theme.of(context).textTheme.subtitle1.copyWith(
color:
highlight ? Color(0xFFFF8200) : Color(0xFF333333),

Loading…
Cancel
Save