Browse Source

safety

master
fmk 3 years ago
parent
commit
70470d643b
  1. BIN
      assets/riv/finger_tapping.riv
  2. 2
      lib/home/home_page.dart
  3. 4
      lib/mine/recharge_page.dart
  4. 12
      lib/union/store_details_page.dart
  5. 300
      lib/union/union_details_page.dart
  6. 54
      lib/view_widget/classic_header.dart
  7. 4
      lib/view_widget/hot_item.dart
  8. 14
      pubspec.lock
  9. 4
      pubspec.yaml

BIN
assets/riv/finger_tapping.riv

Binary file not shown.

2
lib/home/home_page.dart

@ -344,7 +344,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
offset: Offset(0, 3), offset: Offset(0, 3),
blurRadius: 14, blurRadius: 14,
spreadRadius: 0, spreadRadius: 0,
) ),
], ],
), ),
child: Stack( child: Stack(

4
lib/mine/recharge_page.dart

@ -104,9 +104,7 @@ class _RechargePage extends State<RechargePage> {
), ),
], ],
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.circular(4),
Radius.circular(4),
),
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,

12
lib/union/store_details_page.dart

@ -393,7 +393,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
fontSize: 12.sp, fontSize: 12.sp,
color: Colors.grey, color: Colors.grey,
), ),
) ),
], ],
), ),
), ),
@ -461,7 +461,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
offset: Offset(0, 2), offset: Offset(0, 2),
blurRadius: 14, blurRadius: 14,
spreadRadius: 0, spreadRadius: 0,
) ),
], ],
), ),
child: Column( child: Column(
@ -474,8 +474,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
child: Row( child: Row(
children: [ children: [
Text( Text(
S S.of(context)
.of(context)
.pinglun_(commentTotal.toString()), .pinglun_(commentTotal.toString()),
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
@ -617,9 +616,8 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
spreadRadius: 0, spreadRadius: 0,
), ),
], ],
borderRadius: BorderRadius.only( borderRadius: BorderRadius.vertical(
topLeft: Radius.circular(8.0), top: Radius.circular(8),
topRight: Radius.circular(8.0),
), ),
), ),
child: Row( child: Row(

300
lib/union/union_details_page.dart

@ -109,166 +109,159 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
children: [ children: [
AspectRatio( AspectRatio(
aspectRatio: 1, aspectRatio: 1,
child: GestureDetector( child: Container(
onTap: () {}, margin: EdgeInsets.fromLTRB(16, 20, 16, 8),
child: Container( padding: EdgeInsets.fromLTRB(10, 20, 10, 14),
margin: EdgeInsets.fromLTRB(16, 20, 16, 8), decoration: BoxDecoration(
padding: EdgeInsets.fromLTRB(10, 20, 10, 14), color: Colors.white,
decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8)),
color: Colors.white, boxShadow: [
borderRadius: BorderRadius.all(Radius.circular(8)), BoxShadow(
boxShadow: [ color: Colors.black.withAlpha(25),
BoxShadow( offset: Offset(0, 1),
color: Colors.black.withAlpha(25), blurRadius: 12,
offset: Offset(0, 1), spreadRadius: 0,
blurRadius: 12, ),
spreadRadius: 0, ],
) ),
], child: Column(
), mainAxisAlignment: MainAxisAlignment.spaceAround,
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
crossAxisAlignment: CrossAxisAlignment.start, AspectRatio(
children: [ aspectRatio: 1.8,
AspectRatio( child: buildSwiper(),
aspectRatio: 1.8, ),
child: buildSwiper(), Expanded(
), child: Container(
Expanded( margin: EdgeInsets.only(
child: Container( left: 10.w,
margin: EdgeInsets.only( right: 10.w,
left: 10.w, top: 16.h,
right: 10.w, ),
top: 16.h, child: Column(
), mainAxisAlignment:
child: Column( MainAxisAlignment.spaceBetween,
mainAxisAlignment: crossAxisAlignment:
MainAxisAlignment.spaceBetween, CrossAxisAlignment.start,
crossAxisAlignment: children: [
CrossAxisAlignment.start, Row(
children: [ children: [
Row( Text(
children: [ storeInfo != null
Text( ? storeInfo.storeName
storeInfo != null : "",
? storeInfo.storeName style: TextStyle(
: "", fontSize: 16.sp,
style: TextStyle( color: Colors.black,
fontSize: 16.sp, fontWeight: FontWeight.w500,
color: Colors.black,
fontWeight: FontWeight.w500,
),
), ),
Expanded( ),
child: Container( Expanded(
alignment: Alignment.centerRight, child: Container(
child: Text( alignment: Alignment.centerRight,
S.of(context).ren( child: Text(
storeInfo != null S.of(context).ren(
? storeInfo storeInfo != null
.perCapitaConsumption ? storeInfo
: "", .perCapitaConsumption
), : "",
style: TextStyle( ),
fontSize: 14.sp, style: TextStyle(
fontWeight: FontWeight.w400, fontSize: 14.sp,
color: Color(0xFF353535), fontWeight: FontWeight.w400,
), color: Color(0xFF353535),
), ),
), ),
) ),
],
),
Text(
storeInfo != null
? storeInfo.address
: "",
maxLines: 2,
textAlign: TextAlign.justify,
style: TextStyle(
color: Color(0xFF353535),
fontWeight: FontWeight.w400,
fontSize: 12.sp,
), ),
],
),
Text(
storeInfo != null
? storeInfo.address
: "",
maxLines: 2,
textAlign: TextAlign.justify,
style: TextStyle(
color: Color(0xFF353535),
fontWeight: FontWeight.w400,
fontSize: 12.sp,
), ),
Row( ),
children: itemServer( Row(
storeInfo != null children: itemServer(
? storeInfo.businessService storeInfo != null
: "", ? storeInfo.businessService : "",
),
), ),
Row( ),
mainAxisAlignment: Row(
MainAxisAlignment.spaceBetween, mainAxisAlignment:
crossAxisAlignment: MainAxisAlignment.spaceBetween,
CrossAxisAlignment.end, crossAxisAlignment:
children: [ CrossAxisAlignment.end,
Expanded( children: [
child: Text( Expanded(
S.of(context).yingyeshijian(storeInfo == child: Text(
null S.of(context).yingyeshijian(storeInfo == null
? "" ? "" : (storeInfo.openStartTime == null && storeInfo.openEndTime == null)
: (storeInfo.openStartTime == ? S.of(context).quantian
null && : "${storeInfo.openStartTime.substring(0, storeInfo.openStartTime.lastIndexOf(":"))} "
storeInfo.openEndTime == "- ${storeInfo.openEndTime.substring(0, storeInfo.openEndTime.lastIndexOf(":"))}"),
null)
? S.of(context).quantian
: "${storeInfo.openStartTime.substring(0, storeInfo.openStartTime.lastIndexOf(":"))} - ${storeInfo.openEndTime.substring(0, storeInfo.openEndTime.lastIndexOf(":"))}"),
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 12.sp, fontSize: 12.sp,
), ),
)),
SizedBox(
width: 16.w,
), ),
InkWell( ),
onTap: () { SizedBox(
if (storeInfo == null || width: 16.w,
storeInfo.latitude == null || ),
storeInfo.longitude == null || InkWell(
storeInfo.latitude == "" || onTap: () {
storeInfo.longitude == "") if (storeInfo == null ||
return; storeInfo.latitude == null ||
Navigator.of(context).pushNamed( storeInfo.longitude == null ||
'/router/location_map', storeInfo.latitude == "" ||
arguments: { storeInfo.longitude == "")
"lat": storeInfo.latitude, return;
"lng": storeInfo.longitude, Navigator.of(context).pushNamed(
"storeName": '/router/location_map',
storeInfo.storeName, arguments: {
}); "lat": storeInfo.latitude,
}, "lng": storeInfo.longitude,
child: Image.asset( "storeName":
"assets/image/icon_union_location.png", storeInfo.storeName,
width: 24.w, });
height: 24.h, },
), child: Image.asset(
), "assets/image/icon_union_location.png",
SizedBox( width: 24.w,
width: 16.w, height: 24.h,
), ),
InkWell( ),
onTap: () { SizedBox(
showCallMobile(); width: 16.w,
}, ),
child: Image.asset( InkWell(
"assets/image/icon_union_call.png", onTap: () {
width: 24, showCallMobile();
height: 24, },
), child: Image.asset(
"assets/image/icon_union_call.png",
width: 24,
height: 24,
), ),
], ),
), ],
], ),
), ],
), ),
flex: 1,
), ),
], flex: 1,
), ),
],
), ),
), ),
), ),
@ -336,9 +329,8 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
padding: EdgeInsets.only(top: 16.h, bottom: 16.h), padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isEnable() ? Color(0xFF32A060) : Color(0xFFD8D8D8), color: isEnable() ? Color(0xFF32A060) : Color(0xFFD8D8D8),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.vertical(
topLeft: Radius.circular(4), top: Radius.circular(4),
topRight: Radius.circular(4),
), ),
), ),
alignment: Alignment.center, alignment: Alignment.center,
@ -649,8 +641,6 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
.couponVOList[position] .couponVOList[position]
.discountPercent)) .discountPercent))
: "", : "",
// (storeInfo != null && storeInfo.couponVOList != null) ? storeInfo.couponVOList[position].couponImg : "",
// S.of(context).manlijiandaijinquan(30, 5),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
@ -661,9 +651,12 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
Text( Text(
S.of(context).youxiaoqizhi( S.of(context).youxiaoqizhi(
(storeInfo != null && (storeInfo != null &&
storeInfo.couponVOList != null && storeInfo.couponVOList !=
null &&
// storeInfo.couponVOList[position].useStartTime != null && // storeInfo.couponVOList[position].useStartTime != null &&
storeInfo.couponVOList[position].useEndTime != null) storeInfo.couponVOList[position]
.useEndTime !=
null)
// ? "${storeInfo.couponVOList[position].useStartTime.replaceAll("-", ".").split(" ")[0]}-${storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}" // ? "${storeInfo.couponVOList[position].useStartTime.replaceAll("-", ".").split(" ")[0]}-${storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}"
? "${storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}" ? "${storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}"
: "", : "",
@ -704,14 +697,15 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
0) 0)
? Colors.grey ? Colors.grey
: Color(0xFF32A060), : Color(0xFF32A060),
padding: EdgeInsets.fromLTRB(8, 4, 8, 4), padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 4.h),
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
), ),
], ],
), ),
) ),
], ],
), ),
), ),

54
lib/view_widget/classic_header.dart

@ -1,15 +1,20 @@
import 'package:flare_flutter/flare_actor.dart';
import 'package:flare_flutter/flare_controller.dart';
import 'package:flare_flutter/flare_controls.dart';
import 'package:flare_flutter/provider/asset_flare.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart' import 'package:flutter/material.dart'
hide RefreshIndicator, RefreshIndicatorState; hide RefreshIndicator, RefreshIndicatorState;
import 'package:huixiang/generated/l10n.dart'; import 'package:flutter/services.dart';
import 'package:huixiang/view_widget/rotate_container.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:rive/rive.dart';
class MyHeader extends StatelessWidget { class MyHeader extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MyClassicHeader( return CustomHeader();
/*MyClassicHeader(
completeIcon: const Icon(Icons.done, color: Color(0xFF32A060)), completeIcon: const Icon(Icons.done, color: Color(0xFF32A060)),
completeText: S.of(context).shuaxinchenggong, completeText: S.of(context).shuaxinchenggong,
failedText: S.of(context).shuaxinshibai, failedText: S.of(context).shuaxinshibai,
@ -25,6 +30,49 @@ class MyHeader extends StatelessWidget {
height: 24, height: 24,
), ),
), ),
);*/
}
}
class CustomHeader extends RefreshIndicator {
@override
State<StatefulWidget> createState() {
return _CustomHeader();
}
}
class _CustomHeader extends RefreshIndicatorState<CustomHeader> {
String _animation = "loading";
FlareControls flareController = FlareControls();
Artboard _riveArtboard;
RiveAnimationController _controllerIdle;
@override
void initState() {
super.initState();
rootBundle.load("assets/riv/finger_tapping.riv").then((value) async {
final riveFile = RiveFile();
riveFile.import(value);
final artboard = riveFile.mainArtboard;
artboard.addController(_controllerIdle = SimpleAnimation("Idle_1"));
setState(() {
_riveArtboard = artboard;
});
});
}
@override
Widget buildContent(BuildContext context, RefreshStatus mode) {
return Container(
height: 50,
child: Rive(
artboard: _riveArtboard,
alignment: Alignment.center,
fit: BoxFit.contain,
),
); );
} }
} }

4
lib/view_widget/hot_item.dart

@ -46,7 +46,7 @@ class _HotArticleItem extends State<HotArticleItem> {
color: Colors.white, color: Colors.white,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.green.withAlpha(12), color: Colors.grey.withAlpha(12),
offset: Offset(0, 3), offset: Offset(0, 3),
blurRadius: 14, blurRadius: 14,
spreadRadius: 0, spreadRadius: 0,
@ -270,7 +270,7 @@ class _HotArticleItem extends State<HotArticleItem> {
child: MImage( child: MImage(
widget.article != null ? widget.article.coverImg : "", widget.article != null ? widget.article.coverImg : "",
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.circular(4), radius: BorderRadius.vertical(top: Radius.circular(4)),
width: MediaQuery.of(context).size.width - 32.w, width: MediaQuery.of(context).size.width - 32.w,
height: 150.h, height: 150.h,
), ),

14
pubspec.lock

@ -274,6 +274,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.10.11" version: "0.10.11"
flare_flutter:
dependency: "direct main"
description:
name: flare_flutter
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.2"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -749,6 +756,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.4.1+3" version: "1.4.1+3"
rive:
dependency: "direct main"
description:
name: rive
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.8"
rxdart: rxdart:
dependency: "direct main" dependency: "direct main"
description: description:

4
pubspec.yaml

@ -86,6 +86,9 @@ dependencies:
sharesdk_plugin: ^1.3.0 sharesdk_plugin: ^1.3.0
rive: ^0.6.8
flare_flutter: ^3.0.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
@ -101,6 +104,7 @@ flutter:
assets: assets:
- assets/image/ - assets/image/
- assets/map_style/ - assets/map_style/
- assets/riv/
flutter_intl: flutter_intl:
enabled: true enabled: true

Loading…
Cancel
Save