From dae2ff4fdcef017ea26762ec750e0f4789cbbb66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A0=E6=96=87=E8=BD=A9?= <12812285557@qq.com> Date: Mon, 23 Aug 2021 18:19:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E7=A7=92=E6=9D=80=E5=80=92=E8=AE=A1=E6=97=B6=E5=92=8C=E5=A4=B4?= =?UTF-8?q?=E9=83=A8=EF=BC=8C=E4=BF=AE=E5=A4=8D=E7=89=B9=E6=8E=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 4 +- ios/Podfile.lock | 12 ++ ios/Runner.xcodeproj/project.pbxproj | 6 +- ios/Runner/Info.plist | 2 +- lib/main.dart | 5 +- lib/models/promotion_goods_list_model.dart | 2 +- .../home/classify/order_prepay_page.dart | 19 ++- lib/pages/home/home_page.dart | 37 +++-- lib/pages/tabBar/TabbarWidget.dart | 1 + lib/pages/user/setting_page.dart | 14 ++ .../cut_down_time_widget.dart | 110 ++++++++++++++ .../seckill_activity_page.dart | 135 ++++++++++++++++++ .../seckill_activity_widget/live_animate.dart | 65 +++++++++ .../live_animate_Icon.dart | 50 +++++++ .../live_animate_widget.dart | 51 +++++++ pubspec.lock | 63 ++++++++ pubspec.yaml | 9 +- tool/grind.dart | 17 +++ 18 files changed, 569 insertions(+), 33 deletions(-) create mode 100644 lib/seckill_activity/cut_down_time_widget.dart create mode 100644 lib/seckill_activity/seckill_activity_page.dart create mode 100644 lib/widgets/seckill_activity_widget/live_animate.dart create mode 100644 lib/widgets/seckill_activity_widget/live_animate_Icon.dart create mode 100644 lib/widgets/seckill_activity_widget/live_animate_widget.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index 0806305..d2e0053 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -67,7 +67,7 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ndk { //设置支持的SO库架构 - abiFilters 'arm64-v8a'//, 'arm64-v8a', 'x86', 'x86_64' + abiFilters 'arm64-v8a', 'armeabi-v7a'//, 'x86', 'x86_64' // abiFilters 'armeabi-v7a' } manifestPlaceholders = [ @@ -92,7 +92,7 @@ android { minifyEnabled false shrinkResources false ndk{ - abiFilters 'arm64-v8a' + abiFilters 'arm64-v8a','armeabi-v7a' } } } diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 65419c0..bc84ad0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -88,6 +88,9 @@ PODS: - fluwx (0.0.1): - Flutter - WechatOpenSDK (= 1.8.7.1) + - FMDB (2.7.5): + - FMDB/standard (= 2.7.5) + - FMDB/standard (2.7.5) - foundation_fluttify (0.0.1): - Flutter - HandyJSON (5.0.2) @@ -219,6 +222,9 @@ PODS: - mob_sharesdk/ShareSDKRestoreScene - mob_sharesdk/ShareSDKUI - WechatOpenSDK (= 1.8.7.1) + - sqflite (0.0.2): + - Flutter + - FMDB (>= 2.7.5) - SwiftyGif (5.4.0) - tencent_im_plugin (0.0.1): - Flutter @@ -280,6 +286,7 @@ DEPENDENCIES: - raw_toast (from `.symlinks/plugins/raw_toast/ios`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - sharesdk_plugin (from `.symlinks/plugins/sharesdk_plugin/ios`) + - sqflite (from `.symlinks/plugins/sqflite/ios`) - tencent_im_plugin (from `.symlinks/plugins/tencent_im_plugin/ios`) - tencent_live_fluttify (from `.symlinks/plugins/tencent_live_fluttify/ios`) - tobias (from `.symlinks/plugins/tobias/ios`) @@ -298,6 +305,7 @@ SPEC REPOS: - Bugly - DKImagePickerController - DKPhotoGallery + - FMDB - HandyJSON - JCore - JPush @@ -381,6 +389,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/shared_preferences/ios" sharesdk_plugin: :path: ".symlinks/plugins/sharesdk_plugin/ios" + sqflite: + :path: ".symlinks/plugins/sqflite/ios" tencent_im_plugin: :path: ".symlinks/plugins/tencent_im_plugin/ios" tencent_live_fluttify: @@ -421,6 +431,7 @@ SPEC CHECKSUMS: flutter_txugcupload: fd4f7a2a99e5fe30e608bf6f4acf0e7408339816 flutter_union_pay: 47a7bf5a4e987745d4378a8b9fb522d0a434793f fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902 + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a foundation_fluttify: 0c45145e3fad1fb99188e4979daed5b24cd9b278 HandyJSON: 9e4e236f5d2dbefad5155a77417bbea438201c03 image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb @@ -450,6 +461,7 @@ SPEC CHECKSUMS: SDWebImage: 7acbb57630ac7db4a495547fb73916ff3e432f6b shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d sharesdk_plugin: eab284820482d1ca79038b88792d6eb2dc69552a + sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7 tencent_im_plugin: a055ed155fd2cae7f006e756dbec96255b4aa0a3 tencent_live_fluttify: 98821d3233cf13a47eadf1555ebd56b050e0a5ca diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e2ec942..6a714e9 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -396,7 +396,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 307; + CURRENT_PROJECT_VERSION = 312; DEVELOPMENT_TEAM = HV8WM8C68W; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -533,7 +533,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 307; + CURRENT_PROJECT_VERSION = 312; DEVELOPMENT_TEAM = HV8WM8C68W; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -571,7 +571,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 307; + CURRENT_PROJECT_VERSION = 312; DEVELOPMENT_TEAM = HV8WM8C68W; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index a24f767..b5bb513 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -95,7 +95,7 @@ CFBundleVersion - $(CURRENT_PROJECT_VERSION) + $(FLUTTER_BUILD_NUMBER) Infomation Property List LSApplicationQueriesSchemes diff --git a/lib/main.dart b/lib/main.dart index e1ef49a..22e9c86 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -50,7 +50,7 @@ void main() async { // AmapLocation.instance.init(iosKey: 'e8a8057cfedcdcadcf4e8f2c7f8de982'); //初始化腾讯im - + TencentImPlugin.init(appid: '1400435566'); AppConfig.initial( @@ -59,7 +59,8 @@ void main() async { // useEncrypt: true ); // 设置当前是否为测试环境 - const bool isDebug = const bool.fromEnvironment('ISDEBUG',defaultValue: true); + const bool isDebug = + const bool.fromEnvironment('ISDEBUG', defaultValue: true); AppConfig.setDebug(isDebug); diff --git a/lib/models/promotion_goods_list_model.dart b/lib/models/promotion_goods_list_model.dart index 00f0537..d855483 100644 --- a/lib/models/promotion_goods_list_model.dart +++ b/lib/models/promotion_goods_list_model.dart @@ -97,7 +97,7 @@ class PromotionGoodsModel { num price; num primePrice; String priceDesc; - double commission; + num commission; String commissionDesc; Picture picture; int inventory; diff --git a/lib/pages/home/classify/order_prepay_page.dart b/lib/pages/home/classify/order_prepay_page.dart index 40f8251..492caa7 100644 --- a/lib/pages/home/classify/order_prepay_page.dart +++ b/lib/pages/home/classify/order_prepay_page.dart @@ -155,7 +155,7 @@ class _OrderPrepayPageState extends BaseStoreState //TODO 每次应用进入后台返回前台都会进行订单验证操作,这里需要重写 if (state == AppLifecycleState.resumed && !_lifecycleLock) { DPrint.printf("app 进入前台了"); - _fromTo == null ? _verifyPayStatus() : _verifyPayStatusLifang(); + _fromTo == '' ? _verifyPayStatus() : _verifyPayStatusLifang(); _clickPay = false; } } @@ -173,7 +173,7 @@ class _OrderPrepayPageState extends BaseStoreState body: _buildBody(context), ), onWillPop: () { - _fromTo == null + _fromTo != '' ? Alert.show( context, NormalTextDialog( @@ -230,7 +230,7 @@ class _OrderPrepayPageState extends BaseStoreState textAlign: TextAlign.center, style: AppTextStyle.generate(15 * 2.sp, color: Colors.grey), ), - _fromTo != null + _fromTo != '' ? Text( _fromTo, textAlign: TextAlign.center, @@ -689,7 +689,6 @@ class _OrderPrepayPageState extends BaseStoreState HttpResultModel resultModel = await _presenter.verifyOrderPayStatusLifang(_model.data.id); - if (!resultModel.result) { GSDialog.of(_scaffoldKey.currentContext) .showError(_scaffoldKey.currentContext, resultModel.msg); @@ -701,15 +700,15 @@ class _OrderPrepayPageState extends BaseStoreState HttpResultModel resultModel = await _presenter.verifyOrderPayStatusLifang(_model.data.id); if (resultModel.data.status == 0) { - GSDialog.of(_scaffoldKey.currentContext) - .dismiss(_scaffoldKey.currentContext); + GSDialog.of(_scaffoldKey.currentContext) + .dismiss(_scaffoldKey.currentContext); ReToast.err(text: '购票失败'); Navigator.pop(context); Navigator.pop(context); Navigator.pop(context); } else if (resultModel.data.status == 1) { - GSDialog.of(_scaffoldKey.currentContext) - .dismiss(_scaffoldKey.currentContext); + GSDialog.of(_scaffoldKey.currentContext) + .dismiss(_scaffoldKey.currentContext); if (_payNeedModel != null) { print(_payNeedModel); String msg = await PassagerFunc.airOrderPayLifang( @@ -740,8 +739,8 @@ class _OrderPrepayPageState extends BaseStoreState //Navigator.pop(context); } } else if (resultModel.data.status == 1) { - GSDialog.of(_scaffoldKey.currentContext) - .dismiss(_scaffoldKey.currentContext); + GSDialog.of(_scaffoldKey.currentContext) + .dismiss(_scaffoldKey.currentContext); if (_payNeedModel != null) { String msg = await PassagerFunc.airOrderPayLifang( _payNeedModel.lfOrderId, diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 8fe9906..b6d8940 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -27,8 +27,7 @@ import 'package:power_logger/power_logger.dart'; import 'package:recook/models/country_list_model.dart'; import 'package:recook/pages/buy_tickets/choose_tickets_type_page.dart'; import 'package:recook/pages/live/models/king_coin_list_model.dart'; -import 'package:recook/pages/live/pages/discovery_page.dart'; -import 'package:recook/pages/user/functions/user_func.dart'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:recook/utils/storage/hive_store.dart'; import 'package:sharesdk_plugin/sharesdk_plugin.dart'; @@ -1177,17 +1176,22 @@ class _HomePageState extends BaseStoreState height: 10, ), Container( - margin: EdgeInsets.only(top: 5), - width: 48, - height: 48, - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG, - image: icon) - // Image.asset( - // icon, - // fit: BoxFit.fill, - // ), - ), + margin: EdgeInsets.only(top: 5), + width: 48, + height: 48, + child: + // FadeInImage.assetNetwork( + // placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG, + // image: icon) + // Image.asset( + // icon, + // fit: BoxFit.fill, + // ), + CachedNetworkImage( + imageUrl: icon, placeholder: (context,url) => Image.asset( + R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG,fit: BoxFit.fill, + )), + ), Container( margin: EdgeInsets.only(top: 8), child: Text( @@ -1209,6 +1213,13 @@ class _HomePageState extends BaseStoreState ); } + _placeholder() { + return Image.asset( + R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG, + fit: BoxFit.fill, + ); + } + ///首页上方分类功能卡片 _buildGoodsCards() { return SizedBox( diff --git a/lib/pages/tabBar/TabbarWidget.dart b/lib/pages/tabBar/TabbarWidget.dart index 5b7c165..f90a049 100644 --- a/lib/pages/tabBar/TabbarWidget.dart +++ b/lib/pages/tabBar/TabbarWidget.dart @@ -208,6 +208,7 @@ class _TabBarWidgetState extends State tabController: _tabController, ), GoodsHotListPage(), + //秒杀入口(测试待定入口) //AkuCollegePage(),//------akkuxuyaun DiscoveryPage(), // BusinessPage(), diff --git a/lib/pages/user/setting_page.dart b/lib/pages/user/setting_page.dart index 1499177..bf310d8 100644 --- a/lib/pages/user/setting_page.dart +++ b/lib/pages/user/setting_page.dart @@ -6,6 +6,7 @@ import 'package:recook/constants/api.dart'; import 'package:recook/constants/header.dart'; import 'package:recook/manager/user_manager.dart'; import 'package:recook/pages/user/user_info_page.dart'; +import 'package:recook/seckill_activity/seckill_activity_page.dart'; import 'package:recook/widgets/alert.dart'; import 'package:recook/widgets/custom_app_bar.dart'; import 'package:recook/widgets/sc_tile.dart'; @@ -89,6 +90,19 @@ class _SettingItemListViewState extends ResumableState { //push(RouteName.ACCOUNT_AND_SAFETY_PAGE); }), + + + // SCTile.normalTile('秒杀', needDivide: true, + // listener: () { + // Get.to(SeckillActivityPage()); + + // //push(RouteName.ACCOUNT_AND_SAFETY_PAGE); + // }), + + + + + SCTile.normalTile('接收推送通知', needArrow: true, value: perText, listener: () async { JPush().openSettingsForNotification(); diff --git a/lib/seckill_activity/cut_down_time_widget.dart b/lib/seckill_activity/cut_down_time_widget.dart new file mode 100644 index 0000000..2f700a4 --- /dev/null +++ b/lib/seckill_activity/cut_down_time_widget.dart @@ -0,0 +1,110 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; +import 'package:flutter_countdown_timer/current_remaining_time.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; +import 'package:recook/constants/header.dart'; + +class CutDownTimeWidget extends StatefulWidget { + CutDownTimeWidget({ + Key key, + }) : super(key: key); + + @override + _CutDownTimeWidgetState createState() => _CutDownTimeWidgetState(); +} + +class _CutDownTimeWidgetState extends State { + CountdownTimerController controller; + int endTime = DateTime.now().millisecondsSinceEpoch + 1000 * 600; + + void onEnd() { + print('onEnd'); + } + + @override + void initState() { + super.initState(); + controller = CountdownTimerController(endTime: endTime, onEnd: onEnd); + } + + @override + void dispose() { + controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + width: 70.rw, + height: 20.rw, + child: CountdownTimer( + controller: controller, + onEnd: onEnd, + endTime: endTime, + widgetBuilder: (_, CurrentRemainingTime time) { + if (time == null) { + return Container( + width: 70.rw, + height: 20.rw, + child: Row( + children: [ + _time('00'), + Text( + ':', + style: + TextStyle(color: Color(0xFFC92219), fontSize: 14.rsp), + ), + _time('00'), + Text( + ':', + style: + TextStyle(color: Color(0xFFC92219), fontSize: 14.rsp), + ), + _time('00'), + ], + ), + ); + } else + return Container( + width: 70.rw, + height: 20.rw, + child: Row( + children: [ + _time(time.hours != null ? time.hours.toString() : '00'), + Text( + ':', + style: + TextStyle(color: Color(0xFFC92219), fontSize: 14.rsp), + ), + _time(time.min != null ? time.min.toString() : '00'), + Text( + ':', + style: + TextStyle(color: Color(0xFFC92219), fontSize: 14.rsp), + ), + _time(time.sec != null ? time.sec.toString() : '00'), + ], + ), + ); + }, + ), + ); + } + + _time(String time) { + return Container( + alignment: Alignment.center, + width: 20.rw, + height: 20.rw, + decoration: BoxDecoration( + color: Color(0xFFC92219), + borderRadius: BorderRadius.all(Radius.circular(1.rw)), + ), + child: Text( + time.length == 1 ? '0' + time : time, + style: TextStyle(color: Colors.white, fontSize: 14.rsp), + ), + ); + } +} diff --git a/lib/seckill_activity/seckill_activity_page.dart b/lib/seckill_activity/seckill_activity_page.dart new file mode 100644 index 0000000..d5cbc72 --- /dev/null +++ b/lib/seckill_activity/seckill_activity_page.dart @@ -0,0 +1,135 @@ +import 'package:flustars/flustars.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:recook/utils/date/date_utils.dart'; +import 'package:recook/widgets/alert.dart'; +import 'package:recook/widgets/custom_app_bar.dart'; +import 'package:get/get.dart'; +import 'package:recook/constants/styles.dart'; +import 'package:recook/constants/header.dart'; +import 'package:recook/widgets/recook_back_button.dart'; +import 'package:velocity_x/velocity_x.dart'; + +import 'cut_down_time_widget.dart'; + +class SeckillActivityPage extends StatefulWidget { + SeckillActivityPage({ + Key key, + }) : super(key: key); + + @override + _SeckillActivityPageState createState() => _SeckillActivityPageState(); +} + +class _SeckillActivityPageState extends State { + DateTime _dateNow = DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day, 0, 0); + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.frenchColor, + resizeToAvoidBottomInset: false, + appBar: CustomAppBar( + appBackground: Colors.transparent, + flexibleSpace: Container( + width: double.infinity, + height: 124.rw, + decoration: BoxDecoration( + borderRadius: + BorderRadius.only(bottomRight: Radius.circular(104.rw)), + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color(0xFFD9332D), + Color(0xFFE44f37), + ], + ), + ), + ), + leading: RecookBackButton( + white: true, + ), + elevation: 0, + title: Text( + "限时秒杀", + style: TextStyle( + color: Colors.white, + fontSize: 28.rsp, + fontWeight: FontWeight.bold), + ), + bottom: _bottomWidgt(), + ), + + // CustomAppBar( + // appBackground: Color(0xFFF9F9FB), + + // elevation: 0, + // title: '限时秒杀'.text.bold.size(16.rsp).color(Colors.white).make(), + // themeData: AppThemes.themeDataGrey.appBarTheme, + // bottom: _bottomWidgt() + // ), + body: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFFD5101A), + Color(0x03FE2E39), + ], + stops: [0.0, 0.5], + )), + child: _bodyWidget(), + ), + ); + } + + _bodyWidget() { + return Container( + child: Column( + children: [], + ), + ); + } + + Widget _bottomWidgt() { + return PreferredSize( + preferredSize: Size.fromHeight(30.rw), + child: (Container( + margin: EdgeInsets.only(bottom: 10.rw), + width: double.infinity, + height: 30.rw, + color: Color(0xFFFCEEED), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '还差', + style: TextStyle(color: Color(0xFFC92219), fontSize: 14.rw), + ), + 16.wb, + CutDownTimeWidget(), + 16.wb, + Text( + '活动开始', + style: TextStyle(color: Color(0xFFC92219), fontSize: 14.rw), + ), + ], + ), + )), + ); + } +} diff --git a/lib/widgets/seckill_activity_widget/live_animate.dart b/lib/widgets/seckill_activity_widget/live_animate.dart new file mode 100644 index 0000000..959e23d --- /dev/null +++ b/lib/widgets/seckill_activity_widget/live_animate.dart @@ -0,0 +1,65 @@ +import 'package:flutter/material.dart'; + +import 'live_animate_Icon.dart'; + +class LiveAnimate extends StatefulWidget { + final double size; + final double strokeWidth; + final int place; + final Duration delay; + final Duration duration; + + const LiveAnimate( + {Key key, + @required this.size, + @required this.strokeWidth, + @required this.place, + @required this.delay, + @required this.duration}) + : super(key: key); + + @override + _LiveAnimateState createState() => _LiveAnimateState(); +} + +class _LiveAnimateState extends State + with TickerProviderStateMixin { + AnimationController _controller; + Animation _animation; + + @override + void initState() { + _controller = AnimationController(vsync: this, duration: widget.duration); + + _animation = CurveTween(curve: Curves.easeInOut).animate(_controller); + Future.delayed(widget.delay, () async { + try { + await _controller.forward().orCancel; + await _controller.reverse().orCancel; + await _controller.repeat(reverse: true).orCancel; + } on TickerCanceled { + print('animate stopped ${widget.place}'); + } + }); + super.initState(); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AnimatedBuilder( + animation: _animation, + builder: (context, child) { + return CustomPaint( + painter: LiveAnimateIcon( + _animation.value, widget.strokeWidth, widget.place), + size: Size(widget.size / 3, widget.size * 0.5), + ); + }); + } +} diff --git a/lib/widgets/seckill_activity_widget/live_animate_Icon.dart b/lib/widgets/seckill_activity_widget/live_animate_Icon.dart new file mode 100644 index 0000000..0de72fa --- /dev/null +++ b/lib/widgets/seckill_activity_widget/live_animate_Icon.dart @@ -0,0 +1,50 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class LiveAnimateIcon extends CustomPainter { + final double strokeWidth; + final double value; + final int palce; + + LiveAnimateIcon( + this.value, + this.strokeWidth, + this.palce, + ); + + @override + void paint(Canvas canvas, Size size) { + double offset = size.height * (value * 0.3 + 0.2); + Paint paint = Paint() + ..strokeWidth = this.strokeWidth + ..style = PaintingStyle.stroke + ..strokeCap = StrokeCap.round + ..color = Colors.white; + Path path = Path(); + path.moveTo( + this.palce == 0 + ? size.width * 0.8 + : this.palce == 2 + ? size.width * 0.2 + : size.width / 2, + offset); + path.lineTo( + this.palce == 0 + ? size.width * 0.8 + : this.palce == 2 + ? size.width * 0.2 + : size.width / 2, + size.height - offset); + canvas.drawPath(path, paint); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) { + return true; + } + + @override + bool shouldRebuildSemantics(covariant CustomPainter oldDelegate) { + return true; + } +} \ No newline at end of file diff --git a/lib/widgets/seckill_activity_widget/live_animate_widget.dart b/lib/widgets/seckill_activity_widget/live_animate_widget.dart new file mode 100644 index 0000000..7c3f9f1 --- /dev/null +++ b/lib/widgets/seckill_activity_widget/live_animate_widget.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import 'live_animate.dart'; + +class LiveAnimateWidget extends StatefulWidget { + final double size; + final double strokeWidth; + + const LiveAnimateWidget({Key key, this.size, this.strokeWidth}) + : super(key: key); + + @override + _LiveAnimateWidgetState createState() => _LiveAnimateWidgetState(); +} + +class _LiveAnimateWidgetState extends State { + @override + Widget build(BuildContext context) { + return Container( + width: widget.size ?? 50.w, + height: widget.size ?? 50.w, + color: Colors.transparent, + // decoration: BoxDecoration( + // color: Colors.red, + // borderRadius: BorderRadius.circular((widget.size ?? 50.w) / 2), + // ), + child: Row( + children: [ + LiveAnimate( + size: widget.size ?? 50.w, + duration: Duration(milliseconds: 800), + strokeWidth: widget.strokeWidth ?? 5.w, + place: 0, + delay: Duration(milliseconds: 0)), + LiveAnimate( + size: widget.size ?? 50.w, + duration: Duration(milliseconds: 800), + strokeWidth: widget.strokeWidth ?? 5.w, + place: 1, + delay: Duration(milliseconds: 200)), + LiveAnimate( + size: widget.size ?? 50.w, + duration: Duration(milliseconds: 800), + strokeWidth: widget.strokeWidth ?? 5.w, + place: 2, + delay: Duration(milliseconds: 400)), + ], + )); + } +} diff --git a/pubspec.lock b/pubspec.lock index e6a0e85..59590dd 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -155,6 +155,27 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "8.1.1" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.0" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.0" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.1" camera: dependency: "direct main" description: @@ -447,6 +468,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.6.0" flutter_bugly: dependency: "direct main" description: @@ -454,6 +482,20 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.2.8" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.2" + flutter_countdown_timer: + dependency: "direct main" + description: + name: flutter_countdown_timer + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.1.0" flutter_custom_calendar: dependency: "direct main" description: @@ -881,6 +923,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" + octo_image: + dependency: transitive + description: + name: octo_image + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.0+1" oktoast: dependency: "direct main" description: @@ -1289,6 +1338,20 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "4.0.2" + sqflite: + dependency: transitive + description: + name: sqflite + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.0+3" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.0+2" stack_trace: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e6ef3e7..66efe02 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,11 +2,12 @@ name: recook description: Recook Market App. publish_to: "none" -version: 1.11.1-dev+309 +version: 1.11.3-dev+312 environment: sdk: ">=2.10.0 <3.0.0" module: + androidX: true dependencies: @@ -236,6 +237,12 @@ dependencies: #flutter 使用原生android的几个生命周期 need_resume: ^1.0.6 + #缓存图片 解决金刚区图加载缓慢的问题 + cached_network_image: ^3.1.0 + + #倒计时组件 + flutter_countdown_timer: ^4.1.0 + scrollable_positioned_list: ^0.1.7 flutter_markdown: diff --git a/tool/grind.dart b/tool/grind.dart index 219cff1..22008df 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -142,6 +142,23 @@ buildApk() async { ]); } +@Task() +buildApk32() async { + await runAsync('fvm', arguments: [ + 'flutter', + 'build', + 'apk', + '--target-platform=android-armeabi-v7a', + '--dart-define', + 'ISDEBUG=false' + ]); + String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm'); + String version = await getVersion(); + await runAsync('mv', arguments: [ + Config.buildPath, + '${Config.buildDir}/${Config.packageName}_${version}_release_$date.apk' + ]); +} @Task() @Depends(getVersion) buildApkDev() async {