From 391a4713b0cfa227c99c61c3852483791e2c8c6d Mon Sep 17 00:00:00 2001 From: laiiihz Date: Sat, 8 May 2021 11:15:03 +0800 Subject: [PATCH] update static lint issue --- .../deto_create_page/deto_create_page.dart | 2 -- .../sign/sign_up/sign_up_verify_page.dart | 5 ---- lib/ui/community/activity/activity_card.dart | 28 +++++++++---------- .../topic/topic_detail_page.dart | 2 +- lib/ui/manager/advice/new_advice_page.dart | 6 ---- lib/utils/bee_parse.dart | 1 - lib/widget/views/application_view.dart | 3 +- 7 files changed, 15 insertions(+), 32 deletions(-) diff --git a/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart b/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart index 52fc5603..7bfd1981 100644 --- a/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart +++ b/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart @@ -389,8 +389,6 @@ class _DetoCreatePageState extends State { bool _canSubmit(int? weight, int approach, DateTime? dateTime, String? item) { if (weight == null) { return false; - } else if (approach == null) { - return false; } else if (dateTime == null) { return false; } else if (item.isEmptyOrNull) { diff --git a/lib/pages/sign/sign_up/sign_up_verify_page.dart b/lib/pages/sign/sign_up/sign_up_verify_page.dart index 0b057dc1..473409a7 100644 --- a/lib/pages/sign/sign_up/sign_up_verify_page.dart +++ b/lib/pages/sign/sign_up/sign_up_verify_page.dart @@ -2,14 +2,12 @@ import 'package:flutter/material.dart'; import 'package:flustars/flustars.dart'; import 'package:get/get.dart'; -import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/pages/sign/sign_func.dart'; import 'package:aku_community/pages/sign/sign_up/sign_up_common_widget.dart'; import 'package:aku_community/pages/tab_navigator.dart'; -import 'package:aku_community/provider/sign_up_provider.dart'; import 'package:aku_community/utils/headers.dart'; class SignUpVerifyPage extends StatefulWidget { @@ -79,9 +77,6 @@ class _SignUpVerifyPageState extends State { disabledColor: kPrimaryColor.withOpacity(0.3), child: '登录'.text.bold.make(), onPressed: () async { - final signUpProvider = - Provider.of(context, listen: false); - if (_formKey.currentState!.validate()) { bool result = await SignFunc.signUp(); if (result) Get.offAll(() => TabNavigator()); diff --git a/lib/ui/community/activity/activity_card.dart b/lib/ui/community/activity/activity_card.dart index c5817bf0..cfa38d06 100644 --- a/lib/ui/community/activity/activity_card.dart +++ b/lib/ui/community/activity/activity_card.dart @@ -37,21 +37,19 @@ class ActivityCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ImgModel.first(model!.imgUrls) == null - ? SizedBox() - : Hero( - tag: ImgModel.first(model!.imgUrls), - child: Material( - color: Colors.grey, - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(ImgModel.first(model!.imgUrls)), - height: 210.w, - width: double.infinity, - fit: BoxFit.cover, - ), - ), - ), + Hero( + tag: ImgModel.first(model!.imgUrls), + child: Material( + color: Colors.grey, + child: FadeInImage.assetNetwork( + placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + image: API.image(ImgModel.first(model!.imgUrls)), + height: 210.w, + width: double.infinity, + fit: BoxFit.cover, + ), + ), + ), model!.title!.text .size(28.sp) .black diff --git a/lib/ui/community/community_views/topic/topic_detail_page.dart b/lib/ui/community/community_views/topic/topic_detail_page.dart index 408bea08..dd1d86e3 100644 --- a/lib/ui/community/community_views/topic/topic_detail_page.dart +++ b/lib/ui/community/community_views/topic/topic_detail_page.dart @@ -41,7 +41,7 @@ class _TopicDetailPageState extends State { heroTag: 'event_add', onPressed: () async { if (LoginUtil.isNotLogin) return; - bool? result = await Get.to(() => AddNewEventPage.topic( + await Get.to(() => AddNewEventPage.topic( topicName: widget.model!.summary, initTopic: widget.model!.id, )); diff --git a/lib/ui/manager/advice/new_advice_page.dart b/lib/ui/manager/advice/new_advice_page.dart index b670b90b..8c7253e5 100644 --- a/lib/ui/manager/advice/new_advice_page.dart +++ b/lib/ui/manager/advice/new_advice_page.dart @@ -41,24 +41,18 @@ class _NewAdvicePageState extends State { switch (widget.type) { case AdviceType.SUGGESTION: return '建议咨询'; - break; case AdviceType.COMPLAIN: return '投诉表扬'; - break; } - return ''; } List get tabs { switch (widget.type) { case AdviceType.SUGGESTION: return ['您的建议', '您的咨询']; - break; case AdviceType.COMPLAIN: return ['您的投诉', '您的表扬']; - break; } - return []; } _buildType(int index, String asset, String title) { diff --git a/lib/utils/bee_parse.dart b/lib/utils/bee_parse.dart index d0f11592..d547fb49 100644 --- a/lib/utils/bee_parse.dart +++ b/lib/utils/bee_parse.dart @@ -22,7 +22,6 @@ class BeeParse { switch (dif) { case -1: return '去年'; - break; case 0: return '今年'; case 1: diff --git a/lib/widget/views/application_view.dart b/lib/widget/views/application_view.dart index 3a2d3164..c0503726 100644 --- a/lib/widget/views/application_view.dart +++ b/lib/widget/views/application_view.dart @@ -18,8 +18,7 @@ class ApplicationView extends StatefulWidget { ApplicationView.custom( {Key? key, required List this.items, this.needAllApp = true}) - : assert(items != null), - super(key: key); + : super(key: key); @override _ApplicationViewState createState() => _ApplicationViewState();