diff --git a/assets/static/parking_grey.webp b/assets/static/parking_grey.webp new file mode 100644 index 00000000..bed273e0 Binary files /dev/null and b/assets/static/parking_grey.webp differ diff --git a/assets/static/parking_yellow.webp b/assets/static/parking_yellow.webp new file mode 100644 index 00000000..d0d81de6 Binary files /dev/null and b/assets/static/parking_yellow.webp differ diff --git a/lib/const/resource.dart b/lib/const/resource.dart index 5484bd54..470e8a49 100644 --- a/lib/const/resource.dart +++ b/lib/const/resource.dart @@ -474,6 +474,10 @@ class R { /// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/json/zbbj.json) static const String ASSETS_JSON_ZBBJ_JSON = 'assets/json/zbbj.json'; + /// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/static/car_park_empty.webp) + static const String ASSETS_STATIC_CAR_PARK_EMPTY_WEBP = + 'assets/static/car_park_empty.webp'; + /// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/static/house_auth_fail.webp) static const String ASSETS_STATIC_HOUSE_AUTH_FAIL_WEBP = 'assets/static/house_auth_fail.webp'; @@ -482,6 +486,18 @@ class R { static const String ASSETS_STATIC_HOUSE_AUTH_SUCCESS_WEBP = 'assets/static/house_auth_success.webp'; + /// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/static/parking_grey.webp) + static const String ASSETS_STATIC_PARKING_GREY_WEBP = + 'assets/static/parking_grey.webp'; + + /// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/static/parking_yellow.webp) + static const String ASSETS_STATIC_PARKING_YELLOW_WEBP = + 'assets/static/parking_yellow.webp'; + + /// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/static/review_fail.webp) + static const String ASSETS_STATIC_REVIEW_FAIL_WEBP = + 'assets/static/review_fail.webp'; + /// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/static/reviewing.webp) static const String ASSETS_STATIC_REVIEWING_WEBP = 'assets/static/reviewing.webp'; diff --git a/lib/ui/profile/car_parking/car_parking_card.dart b/lib/ui/profile/car_parking/car_parking_card.dart new file mode 100644 index 00000000..3e62b740 --- /dev/null +++ b/lib/ui/profile/car_parking/car_parking_card.dart @@ -0,0 +1,28 @@ +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); + + String get _assetImage { + return 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( + child: Column( + children: [], + ), + decoration: BoxDecoration( + image: DecorationImage(image: AssetImage(_assetImage)), + ), + ), + ); + } +} diff --git a/lib/ui/profile/car_parking/car_parking_page.dart b/lib/ui/profile/car_parking/car_parking_page.dart index 1bf2b1f7..3e52bbd5 100644 --- a/lib/ui/profile/car_parking/car_parking_page.dart +++ b/lib/ui/profile/car_parking/car_parking_page.dart @@ -1,3 +1,5 @@ +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'; @@ -10,6 +12,27 @@ class CarParkingPage extends StatefulWidget { } class _CarParkingPageState extends State { + 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) { return BeeScaffold( @@ -22,7 +45,16 @@ class _CarParkingPageState extends State { ], body: EasyRefresh( onRefresh: () async {}, - child: ListView(), + header: MaterialHeader(), + // emptyWidget: _renderEmptyWidget, + child: ListView.separated( + separatorBuilder: (context, index) => 32.hb, + itemBuilder: (context, index) { + return CarparkingCard(outdated: false); + }, + padding: EdgeInsets.all(32.w), + itemCount: 2, + ), ), ); }