parent
87f399aca3
commit
b4f692fd29
@ -0,0 +1,88 @@
|
||||
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 CarManageCard extends StatelessWidget {
|
||||
final CarParkingModel model;
|
||||
const CarManageCard({Key key, @required this.model}) : super(key: key);
|
||||
|
||||
String get _assetImage {
|
||||
return model.outdated
|
||||
? R.ASSETS_STATIC_PARKING_GREY_WEBP
|
||||
: R.ASSETS_STATIC_PARKING_YELLOW_WEBP;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AspectRatio(
|
||||
aspectRatio: 688 / 286,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(40.w),
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(image: AssetImage(_assetImage)),
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
model.code,
|
||||
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(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'类型',
|
||||
style: Theme.of(context).textTheme.bodyText1.copyWith(
|
||||
color: Color(0xFF666666),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
model.typeName,
|
||||
style: Theme.of(context).textTheme.subtitle2.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
).expand(),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'到期时间',
|
||||
style: Theme.of(context).textTheme.bodyText1.copyWith(
|
||||
color: Color(0xFF666666),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
model.dateName,
|
||||
style: Theme.of(context).textTheme.subtitle2.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
).expand(),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
import 'package:akuCommunity/provider/app_provider.dart';
|
||||
import 'package:akuCommunity/ui/profile/car/car_manage_card.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 CarManagePage extends StatefulWidget {
|
||||
CarManagePage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CarManagePageState createState() => _CarManagePageState();
|
||||
}
|
||||
|
||||
class _CarManagePageState extends State<CarManagePage> {
|
||||
Widget get _renderEmptyWidget {
|
||||
return Center(
|
||||
child: Stack(
|
||||
children: [
|
||||
Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP).pSymmetric(h: 75.w),
|
||||
Positioned(
|
||||
bottom: 100.w,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Text(
|
||||
'还没有车辆',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF999999),
|
||||
),
|
||||
).centered(),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appProvider = Provider.of<AppProvider>(context);
|
||||
return BeeScaffold(
|
||||
title: '我的车位',
|
||||
actions: [
|
||||
// TextButton(
|
||||
// onPressed: () {},
|
||||
// child: Text('管理车位'),
|
||||
// ),
|
||||
],
|
||||
body: EasyRefresh(
|
||||
firstRefresh: true,
|
||||
onRefresh: () async {
|
||||
await appProvider.updateCarModels();
|
||||
},
|
||||
header: MaterialHeader(),
|
||||
emptyWidget: appProvider.carModels.isEmpty ? _renderEmptyWidget : null,
|
||||
child: ListView.separated(
|
||||
separatorBuilder: (context, index) => 32.hb,
|
||||
itemBuilder: (context, index) {
|
||||
return CarManageCard(model: appProvider.carModels[index]);
|
||||
},
|
||||
padding: EdgeInsets.all(32.w),
|
||||
itemCount: appProvider.carModels.length,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
import 'package:akuCommunity/model/user/car_parking_model.dart';
|
||||
|
||||
class CarParkingFunc {
|
||||
static Future<CarParkingModel> getCarParkingModels() async {
|
||||
// return
|
||||
}
|
||||
}
|
Loading…
Reference in new issue