update goods page

hmxc
小赖 4 years ago
parent a1715ffc17
commit 23e9551f51

@ -1,6 +1,6 @@
class API { class API {
///HOST ///HOST
static const String host = 'http://test.akuhotel.com:8804'; static const String host = 'http://test.kaidalai.cn';
/// ///
static const String baseURL = '$host/IntelligentCommunity/app'; static const String baseURL = '$host/IntelligentCommunity/app';

@ -34,6 +34,9 @@ class AppTheme {
elevation: 0, elevation: 0,
centerTitle: true, centerTitle: true,
brightness: Brightness.light, brightness: Brightness.light,
iconTheme: IconThemeData(
color: Color(0xFF333333),
),
textTheme: TextTheme( textTheme: TextTheme(
headline6: TextStyle( headline6: TextStyle(
color: Color(0xFF333333), color: Color(0xFF333333),

@ -1,10 +1,12 @@
import 'package:aku_community/ui/market/goods/goods_card.dart';
import 'package:aku_community/ui/market/goods/goods_list_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:waterfall_flow/waterfall_flow.dart';
@Deprecated('NO NEED THIS CLASS IN FUTURE') @Deprecated('NO NEED THIS CLASS IN FUTURE')
class MarketData { class MarketData {
@ -57,9 +59,7 @@ class MockableMarketWidget extends StatelessWidget {
), ),
onPressed: () { onPressed: () {
Get.to( Get.to(
() => BeeScaffold( () => GoodsListView(),
title: data.name,
),
); );
}, },
); );
@ -80,7 +80,21 @@ class _MockableMarketListState extends State<MockableMarketList> {
return EasyRefresh( return EasyRefresh(
header: MaterialHeader(completeDuration: Duration(milliseconds: 300)), header: MaterialHeader(completeDuration: Duration(milliseconds: 300)),
onRefresh: () async {}, onRefresh: () async {},
child: ListView(), child: WaterfallFlow(
padding: EdgeInsets.all(32.w),
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 20.w,
crossAxisSpacing: 20.w,
),
children: [
GoodsCard(),
GoodsCard(),
GoodsCard(),
GoodsCard(),
GoodsCard(),
],
),
); );
} }
} }

@ -1,4 +1,5 @@
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/headers.dart';
@ -15,7 +16,13 @@ class _CategoryPageState extends State<CategoryPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '', title: '分类',
actions: [
IconButton(
icon: Icon(CupertinoIcons.search),
onPressed: () {},
),
],
bgColor: Colors.white, bgColor: Colors.white,
appBarBottom: PreferredSize( appBarBottom: PreferredSize(
child: Divider(height: 1), child: Divider(height: 1),

@ -0,0 +1,92 @@
import 'package:aku_community/base/base_style.dart';
import 'package:flutter/material.dart';
import 'package:aku_community/utils/headers.dart';
class GoodsCard extends StatelessWidget {
const GoodsCard({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialButton(
color: Colors.white,
elevation: 0,
padding: EdgeInsets.zero,
onPressed: () {},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(
aspectRatio: 1,
child: Stack(
children: [
Image.asset(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
fit: BoxFit.cover,
),
Positioned(
left: 0,
right: 0,
bottom: 0,
child: Container(
height: 38.w,
color: Colors.black54,
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Text(
'分别是紫色烦恼则妇女色泽封闭周四鹅u部分紫色部分',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
),
),
),
),
],
),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 12.w,
vertical: 20.w,
),
child: Text(
'袁隆平水稻大米精选 56kg唇齿流香 无常有机稻花 无常有机稻花',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 24.sp,
),
),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 12.w,
),
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '¥123.45 ',
style: TextStyle(
color: Colors.red,
fontSize: 28.sp,
),
),
TextSpan(
text: '123已付款',
style: TextStyle(
color: ktextSubColor,
fontSize: 20.sp,
),
),
],
),
),
),
16.hb,
],
),
);
}
}

@ -0,0 +1,86 @@
import 'package:aku_community/ui/market/goods/goods_card.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
class GoodsListView extends StatefulWidget {
GoodsListView({Key? key}) : super(key: key);
@override
_GoodsListViewState createState() => _GoodsListViewState();
}
class _GoodsListViewState extends State<GoodsListView> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: 'TEST',
actions: [
IconButton(
icon: Icon(CupertinoIcons.search),
onPressed: () {},
)
],
appBarBottom: PreferredSize(
child: SizedBox(
height: 220.w,
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
scrollDirection: Axis.horizontal,
children: [
GoodsSubTypeButton(),
],
),
),
preferredSize: Size.fromHeight(220.w),
),
body: WaterfallFlow(
padding: EdgeInsets.all(32.w),
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 20.w,
crossAxisSpacing: 20.w,
),
children: [
GoodsCard(),
GoodsCard(),
GoodsCard(),
GoodsCard(),
GoodsCard(),
],
),
);
}
}
class GoodsSubTypeButton extends StatelessWidget {
const GoodsSubTypeButton({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialButton(
minWidth: 136.w,
padding: EdgeInsets.zero,
onPressed: () {},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
width: 100.w,
height: 100.w,
),
20.hb,
Text(
'健康运动',
style: TextStyle(
fontSize: 24.sp,
),
),
],
),
);
}
}

@ -1,8 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/constants/app_theme.dart'; import 'package:aku_community/constants/app_theme.dart';
import 'package:aku_community/widget/bee_back_button.dart'; import 'package:aku_community/widget/bee_back_button.dart';
@ -51,13 +49,20 @@ class BeeScaffold extends StatelessWidget {
}) : this.bodyColor = Colors.white, }) : this.bodyColor = Colors.white,
super(key: key); super(key: key);
Widget? get _titleWidget {
if (title == null) return null;
if (title is String) return Text(title!);
if (title is Widget) return title as Widget;
return null;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget? appBar; Widget? appBar;
if (title != null) if (title != null)
appBar = AppBar( appBar = AppBar(
backgroundColor: bgColor, backgroundColor: bgColor,
title: title!.text.make(), title: _titleWidget,
leading: leading ?? BeeBackButton(), leading: leading ?? BeeBackButton(),
actions: actions, actions: actions,
bottom: appBarBottom, bottom: appBarBottom,

@ -1,4 +1,6 @@
PODS: PODS:
- device_info_plus_macos (0.0.1):
- FlutterMacOS
- Firebase/CoreOnly (7.11.0): - Firebase/CoreOnly (7.11.0):
- FirebaseCore (= 7.11.0) - FirebaseCore (= 7.11.0)
- Firebase/Crashlytics (7.11.0): - Firebase/Crashlytics (7.11.0):
@ -50,6 +52,8 @@ PODS:
- nanopb/encode (2.30908.0) - nanopb/encode (2.30908.0)
- package_info (0.0.1): - package_info (0.0.1):
- FlutterMacOS - FlutterMacOS
- package_info_plus_macos (0.0.1):
- FlutterMacOS
- path_provider_macos (0.0.1): - path_provider_macos (0.0.1):
- FlutterMacOS - FlutterMacOS
- PromisesObjC (1.2.12) - PromisesObjC (1.2.12)
@ -59,10 +63,12 @@ PODS:
- FlutterMacOS - FlutterMacOS
DEPENDENCIES: DEPENDENCIES:
- device_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus_macos/macos`)
- firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`) - firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`)
- firebase_crashlytics (from `Flutter/ephemeral/.symlinks/plugins/firebase_crashlytics/macos`) - firebase_crashlytics (from `Flutter/ephemeral/.symlinks/plugins/firebase_crashlytics/macos`)
- FlutterMacOS (from `Flutter/ephemeral`) - FlutterMacOS (from `Flutter/ephemeral`)
- package_info (from `Flutter/ephemeral/.symlinks/plugins/package_info/macos`) - package_info (from `Flutter/ephemeral/.symlinks/plugins/package_info/macos`)
- package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`)
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`) - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
- shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`) - shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
@ -80,6 +86,8 @@ SPEC REPOS:
- PromisesObjC - PromisesObjC
EXTERNAL SOURCES: EXTERNAL SOURCES:
device_info_plus_macos:
:path: Flutter/ephemeral/.symlinks/plugins/device_info_plus_macos/macos
firebase_core: firebase_core:
:path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos :path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos
firebase_crashlytics: firebase_crashlytics:
@ -88,6 +96,8 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral :path: Flutter/ephemeral
package_info: package_info:
:path: Flutter/ephemeral/.symlinks/plugins/package_info/macos :path: Flutter/ephemeral/.symlinks/plugins/package_info/macos
package_info_plus_macos:
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos
path_provider_macos: path_provider_macos:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos :path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
shared_preferences_macos: shared_preferences_macos:
@ -96,6 +106,7 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
SPEC CHECKSUMS: SPEC CHECKSUMS:
device_info_plus_macos: 1ad388a1ef433505c4038e7dd9605aadd1e2e9c7
Firebase: c121feb35e4126c0b355e3313fa9b487d47319fd Firebase: c121feb35e4126c0b355e3313fa9b487d47319fd
firebase_core: 9e45a9c5ba9dbcb8973b3a68e6ff43ecf2dcf206 firebase_core: 9e45a9c5ba9dbcb8973b3a68e6ff43ecf2dcf206
firebase_crashlytics: 4ab08e6b22a4f6ec909cc1f0a046eac2d1b2925c firebase_crashlytics: 4ab08e6b22a4f6ec909cc1f0a046eac2d1b2925c
@ -108,6 +119,7 @@ SPEC CHECKSUMS:
GoogleUtilities: 284cddc7fffc14ae1907efb6f78ab95c1fccaedc GoogleUtilities: 284cddc7fffc14ae1907efb6f78ab95c1fccaedc
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
package_info: 6eba2fd8d3371dda2d85c8db6fe97488f24b74b2 package_info: 6eba2fd8d3371dda2d85c8db6fe97488f24b74b2
package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c
path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
shared_preferences_macos: 480ce071d0666e37cef23fe6c702293a3d21799e shared_preferences_macos: 480ce071d0666e37cef23fe6c702293a3d21799e

@ -302,6 +302,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.0.0" version: "4.0.0"
extended_list_library:
dependency: transitive
description:
name: extended_list_library
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
@ -1124,6 +1131,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
waterfall_flow:
dependency: "direct main"
description:
name: waterfall_flow
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.1"
web_socket_channel: web_socket_channel:
dependency: transitive dependency: transitive
description: description:

@ -66,6 +66,7 @@ dependencies:
share: ^2.0.1 share: ^2.0.1
collection: ^1.15.0 collection: ^1.15.0
json_annotation: ^4.0.1 json_annotation: ^4.0.1
waterfall_flow: ^3.0.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save