diff --git a/lib/dialog/image_viewer.dart b/lib/dialog/image_viewer.dart index a745584..920d83a 100644 --- a/lib/dialog/image_viewer.dart +++ b/lib/dialog/image_viewer.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:photo_view/photo_view.dart'; class ImageViewer extends StatefulWidget { - final Key key; + final Key? key; final ImageProvider imageProvider; ImageViewer(this.imageProvider, {this.key}) : diff --git a/lib/pages/attribute_selection.dart b/lib/pages/attribute_selection.dart index a977d1a..8f9ad3a 100644 --- a/lib/pages/attribute_selection.dart +++ b/lib/pages/attribute_selection.dart @@ -10,7 +10,7 @@ class AttributeSelection extends StatelessWidget { final Business business; final GlobalKey startKey; - const AttributeSelection({Key key, this.product, this.business, this.startKey}) : super(key: key); + const AttributeSelection({Key? key, this.product, this.business, this.startKey}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/blog.dart b/lib/pages/blog.dart index 8ef70ef..116f580 100644 --- a/lib/pages/blog.dart +++ b/lib/pages/blog.dart @@ -8,7 +8,7 @@ import '../widgets/desktop/desktop_blog.dart'; import '../widgets/mobile/mobile_blog.dart'; class Blog extends StatelessWidget { - final Key key; + final Key? key; final int businessId; const Blog({this.key, int businessId}) : diff --git a/lib/pages/buy_service.dart b/lib/pages/buy_service.dart index 3205867..7d946f9 100644 --- a/lib/pages/buy_service.dart +++ b/lib/pages/buy_service.dart @@ -22,7 +22,7 @@ class BuyService extends StatefulWidget { final String domain; final int sid; - const BuyService(this.gid, this.serviceName, {Key key, this.domain, this.sid = 0}) : + const BuyService(this.gid, this.serviceName, {Key? key, this.domain, this.sid = 0}) : super(key: key); @override diff --git a/lib/pages/change_mobile_or_email.dart b/lib/pages/change_mobile_or_email.dart index 63ec9c7..4937a63 100644 --- a/lib/pages/change_mobile_or_email.dart +++ b/lib/pages/change_mobile_or_email.dart @@ -15,7 +15,7 @@ import '../widgets/mobile/mobile_change_mobile_or_email.dart'; class ChangeMobileOrEmail extends StatelessWidget { final bool isMobile; - const ChangeMobileOrEmail(this.isMobile, {Key key}) : super(key: key); + const ChangeMobileOrEmail(this.isMobile, {Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/checkout.dart b/lib/pages/checkout.dart index da5f521..fad7dab 100644 --- a/lib/pages/checkout.dart +++ b/lib/pages/checkout.dart @@ -11,7 +11,7 @@ import '../widgets/mobile/mobile_checkout.dart'; class Checkout extends StatelessWidget { final int businessId; - const Checkout(this.businessId, {Key key}) : + const Checkout(this.businessId, {Key? key}) : super(key: key); @override diff --git a/lib/pages/contact_us.dart b/lib/pages/contact_us.dart index 1d67451..732e460 100644 --- a/lib/pages/contact_us.dart +++ b/lib/pages/contact_us.dart @@ -14,7 +14,7 @@ import '../widgets/mobile/mobile_contact_us.dart'; class ContactUs extends StatefulWidget { final int businessId; - const ContactUs({this.businessId, Key key}) : + const ContactUs({this.businessId, Key? key}) : super(key: key); @override diff --git a/lib/pages/coupons.dart b/lib/pages/coupons.dart index 666cb4d..f8beca1 100644 --- a/lib/pages/coupons.dart +++ b/lib/pages/coupons.dart @@ -10,7 +10,7 @@ import '../widgets/mobile/mobile_coupons.dart'; class Coupons extends StatelessWidget { final int contactId; - const Coupons(this.contactId, {Key key}) : + const Coupons(this.contactId, {Key? key}) : super(key: key); diff --git a/lib/pages/create_online_store_1.dart b/lib/pages/create_online_store_1.dart index f4f600f..64e0e25 100644 --- a/lib/pages/create_online_store_1.dart +++ b/lib/pages/create_online_store_1.dart @@ -11,7 +11,7 @@ import '../widgets/mobile/create_online_store_1.dart' as mobile; class CreateOnlineStore1 extends StatefulWidget { - const CreateOnlineStore1({Key key}) : + const CreateOnlineStore1({Key? key}) : super(key: key); @override diff --git a/lib/pages/edit_address.dart b/lib/pages/edit_address.dart index 3324ae9..42154b6 100644 --- a/lib/pages/edit_address.dart +++ b/lib/pages/edit_address.dart @@ -13,7 +13,7 @@ import '../widgets/general/navigationbar.dart'; import '../widgets/mobile/MobileBottomNav.dart'; class EditAddress extends StatelessWidget { - final Key key; + final Key? key; final Address address; final int businessId; const EditAddress(this.address, {this.key, int businessId}) : diff --git a/lib/pages/forgot_password.dart b/lib/pages/forgot_password.dart index 7542cc1..bf4c016 100644 --- a/lib/pages/forgot_password.dart +++ b/lib/pages/forgot_password.dart @@ -12,7 +12,7 @@ import '../widgets/general/navigationbar.dart'; import '../widgets/mobile/MobileBottomNav.dart'; class ForgotPassword extends StatelessWidget { - const ForgotPassword({Key key}) : super(key: key); + const ForgotPassword({Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/igoshow_learn_more.dart b/lib/pages/igoshow_learn_more.dart index 8be0e9b..c131b54 100644 --- a/lib/pages/igoshow_learn_more.dart +++ b/lib/pages/igoshow_learn_more.dart @@ -16,7 +16,7 @@ import '../widgets/mobile/MobileBottomNav.dart'; import '../widgets/mobile/mobile_igoshow_learn_more.dart'; class IGoShowLearnMore extends StatefulWidget { - const IGoShowLearnMore({Key key}) : super(key: key); + const IGoShowLearnMore({Key? key}) : super(key: key); @override State createState() { diff --git a/lib/pages/login.dart b/lib/pages/login.dart index 6b18ab7..ab20548 100644 --- a/lib/pages/login.dart +++ b/lib/pages/login.dart @@ -14,7 +14,7 @@ import '../widgets/mobile/MobileBottomNav.dart'; import '../widgets/mobile/mobile_login.dart'; class Login extends StatefulWidget { - final Key key; + final Key? key; const Login({this.key}) : super(key: key); diff --git a/lib/pages/me.dart b/lib/pages/me.dart index 39c8a7a..0af4860 100644 --- a/lib/pages/me.dart +++ b/lib/pages/me.dart @@ -15,7 +15,7 @@ import '../widgets/mobile/MobileBottomNav.dart'; import '../widgets/mobile/mobile_me.dart'; class Me extends StatefulWidget { - final Key key; + final Key? key; const Me({this.key}) : super(key: key); diff --git a/lib/pages/minipos_learn_more.dart b/lib/pages/minipos_learn_more.dart index a6d886a..4c13c5f 100644 --- a/lib/pages/minipos_learn_more.dart +++ b/lib/pages/minipos_learn_more.dart @@ -16,7 +16,7 @@ import '../widgets/mobile/MobileBottomNav.dart'; import '../widgets/mobile/mobile_minipos_learn_more.dart'; class MiniPosLearnMore extends StatefulWidget { - const MiniPosLearnMore({Key key}) : super(key: key); + const MiniPosLearnMore({Key? key}) : super(key: key); @override State createState() { diff --git a/lib/pages/my_addresses.dart b/lib/pages/my_addresses.dart index 70967de..0b6248b 100644 --- a/lib/pages/my_addresses.dart +++ b/lib/pages/my_addresses.dart @@ -8,7 +8,7 @@ import '../widgets/desktop/desktop_my_addresses.dart'; import '../widgets/mobile/mobile_my_addresses.dart'; class MyAddresses extends StatelessWidget { - final Key key; + final Key? key; final int businessId; const MyAddresses({this.key, int businessId}) : diff --git a/lib/pages/my_support.dart b/lib/pages/my_support.dart index 908b3d2..86f544f 100644 --- a/lib/pages/my_support.dart +++ b/lib/pages/my_support.dart @@ -8,7 +8,7 @@ import '../widgets/desktop/desktop_my_support.dart'; import '../widgets/mobile/mobile_my_support.dart'; class MySupport extends StatelessWidget { - final Key key; + final Key? key; final int businessId; const MySupport({this.key, int businessId}) : diff --git a/lib/pages/new_address.dart b/lib/pages/new_address.dart index 08044cf..8381329 100644 --- a/lib/pages/new_address.dart +++ b/lib/pages/new_address.dart @@ -7,7 +7,7 @@ import '../widgets/desktop/desktop_new_address.dart'; import '../widgets/mobile/mobile_new_address.dart'; class NewAddress extends StatelessWidget { - final Key key; + final Key? key; final LocatedAddress locatedAddress; final int businessId; const NewAddress({this.key, this.locatedAddress, this.businessId}) : super(key: key); diff --git a/lib/pages/new_comment.dart b/lib/pages/new_comment.dart index 1770d87..0622aaf 100644 --- a/lib/pages/new_comment.dart +++ b/lib/pages/new_comment.dart @@ -10,7 +10,7 @@ import '../widgets/mobile/mobile_new_comment.dart'; class NewComment extends StatelessWidget { final int orderId; - const NewComment(this.orderId, {Key key}) : + const NewComment(this.orderId, {Key? key}) : super(key: key); diff --git a/lib/pages/new_ticket.dart b/lib/pages/new_ticket.dart index 064d4c8..16a5954 100644 --- a/lib/pages/new_ticket.dart +++ b/lib/pages/new_ticket.dart @@ -14,7 +14,7 @@ import '../widgets/mobile/MobileBottomNav.dart'; import '../widgets/mobile/mobile_new_ticket.dart'; class NewTicket extends StatefulWidget { - final Key key; + final Key? key; final int businessId; const NewTicket({this.key, int businessId}) : diff --git a/lib/pages/new_user.dart b/lib/pages/new_user.dart index dae15d2..6636cc9 100644 --- a/lib/pages/new_user.dart +++ b/lib/pages/new_user.dart @@ -12,7 +12,7 @@ import '../widgets/mobile/MobileBottomNav.dart'; import '../widgets/mobile/mobile_new_user.dart'; class NewUser extends StatelessWidget { - const NewUser({Key key}) : super(key: key); + const NewUser({Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/order_detail.dart b/lib/pages/order_detail.dart index 40d9a6a..1694309 100644 --- a/lib/pages/order_detail.dart +++ b/lib/pages/order_detail.dart @@ -11,7 +11,7 @@ class OrderDetail extends StatelessWidget { final int orderId; final bool fromOrders; - const OrderDetail(this.orderId, {this.fromOrders = false, Key key}) : + const OrderDetail(this.orderId, {this.fromOrders = false, Key? key}) : super(key: key); @override diff --git a/lib/pages/pay_now.dart b/lib/pages/pay_now.dart index 6096f33..c9a5bcc 100644 --- a/lib/pages/pay_now.dart +++ b/lib/pages/pay_now.dart @@ -10,7 +10,7 @@ import '../widgets/mobile/mobile_pay_now.dart'; class PayNow extends StatelessWidget { final int orderId; - const PayNow(this.orderId, {Key key}) : + const PayNow(this.orderId, {Key? key}) : super(key: key); diff --git a/lib/pages/plain_page.dart b/lib/pages/plain_page.dart index 5fc2a1b..369d879 100644 --- a/lib/pages/plain_page.dart +++ b/lib/pages/plain_page.dart @@ -15,7 +15,7 @@ class PlainPage extends StatefulWidget { final int businessId; final String slug; - const PlainPage(this.slug, {this.businessId, Key key}) : + const PlainPage(this.slug, {this.businessId, Key? key}) : super(key: key); @override diff --git a/lib/pages/product_detail_page.dart b/lib/pages/product_detail_page.dart index 995b755..dc330bc 100644 --- a/lib/pages/product_detail_page.dart +++ b/lib/pages/product_detail_page.dart @@ -13,7 +13,7 @@ class ProductDetailPage extends StatelessWidget { final Business business; final Product product; - const ProductDetailPage({this.business, this.product, Key key}) : + const ProductDetailPage({this.business, this.product, Key? key}) : super(key: key); diff --git a/lib/pages/product_search.dart b/lib/pages/product_search.dart index 408c4b0..3cac378 100644 --- a/lib/pages/product_search.dart +++ b/lib/pages/product_search.dart @@ -9,7 +9,7 @@ import '../widgets/mobile/product_search.dart' as mobile; class ProductSearch extends StatelessWidget { final Business business; - const ProductSearch(this.business, {Key key}) : super(key: key); + const ProductSearch(this.business, {Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/renew_license.dart b/lib/pages/renew_license.dart index 0a7d395..7153e1b 100644 --- a/lib/pages/renew_license.dart +++ b/lib/pages/renew_license.dart @@ -12,7 +12,7 @@ import '../widgets/mobile/mobile_renew_license.dart'; class RenewLicense extends StatefulWidget { - const RenewLicense({Key key}) : + const RenewLicense({Key? key}) : super(key: key); @override diff --git a/lib/pages/renew_minioffice.dart b/lib/pages/renew_minioffice.dart index c9b4c34..1a0e3de 100644 --- a/lib/pages/renew_minioffice.dart +++ b/lib/pages/renew_minioffice.dart @@ -17,7 +17,7 @@ import '../widgets/mobile/mobile_renew_license.dart'; class RenewMiniOffice extends StatefulWidget { final int gid; - const RenewMiniOffice(this.gid, {Key key}) : + const RenewMiniOffice(this.gid, {Key? key}) : super(key: key); @override diff --git a/lib/pages/reset_password.dart b/lib/pages/reset_password.dart index 6ae09b7..4220688 100644 --- a/lib/pages/reset_password.dart +++ b/lib/pages/reset_password.dart @@ -14,7 +14,7 @@ import '../widgets/mobile/mobile_reset_password.dart'; class ResetPassword extends StatelessWidget { final String mobile; final String code; - const ResetPassword(this.mobile, {Key key, this.code}) : super(key: key); + const ResetPassword(this.mobile, {Key? key, this.code}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/search_place.dart b/lib/pages/search_place.dart index 158e68f..0b1309f 100644 --- a/lib/pages/search_place.dart +++ b/lib/pages/search_place.dart @@ -5,7 +5,7 @@ import '../widgets/mobile/mobile_search_place.dart'; import 'package:responsive_builder/responsive_builder.dart'; class SearchPlace extends StatelessWidget { - final Key key; + final Key? key; final int businessId; const SearchPlace(this.businessId, {this.key}) : super(key: key); diff --git a/lib/pages/set_password.dart b/lib/pages/set_password.dart index 1d30b5d..7828f9c 100644 --- a/lib/pages/set_password.dart +++ b/lib/pages/set_password.dart @@ -14,7 +14,7 @@ import '../widgets/mobile/mobile_set_password.dart'; class SetPassword extends StatelessWidget { final String mobile; final String code; - const SetPassword(this.mobile, {Key key, this.code}) : super(key: key); + const SetPassword(this.mobile, {Key? key, this.code}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/shop.dart b/lib/pages/shop.dart index fc8751b..1d2033f 100644 --- a/lib/pages/shop.dart +++ b/lib/pages/shop.dart @@ -10,7 +10,7 @@ import '../widgets/mobile/shop.dart' as mobile; class Shop extends StatefulWidget { final int businessId; - const Shop({this.businessId, Key key}) : super(key: key); + const Shop({this.businessId, Key? key}) : super(key: key); @override State createState() => ShopState(); diff --git a/lib/pages/store_product_search.dart b/lib/pages/store_product_search.dart index 434bcdb..19223b0 100644 --- a/lib/pages/store_product_search.dart +++ b/lib/pages/store_product_search.dart @@ -15,7 +15,7 @@ import '../widgets/mobile/mobile_store_product_search.dart'; class StoreProductSearch extends StatelessWidget { final Business business; - const StoreProductSearch(this.business, {Key key}) : super(key: key); + const StoreProductSearch(this.business, {Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/user_profile.dart b/lib/pages/user_profile.dart index a642db7..47b6597 100644 --- a/lib/pages/user_profile.dart +++ b/lib/pages/user_profile.dart @@ -13,7 +13,7 @@ import '../widgets/mobile/MobileBottomNav.dart'; import '../widgets/mobile/mobile_user_profile.dart'; class UserProfile extends StatelessWidget { - const UserProfile({Key key}) : super(key: key); + const UserProfile({Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/view_blog.dart b/lib/pages/view_blog.dart index 1727713..9dbd43b 100644 --- a/lib/pages/view_blog.dart +++ b/lib/pages/view_blog.dart @@ -14,7 +14,7 @@ import '../widgets/mobile/MobileBottomNav.dart'; import '../widgets/mobile/mobile_view_blog.dart'; class ViewBlog extends StatefulWidget { - final Key key; + final Key? key; final int bid; const ViewBlog(this.bid, {this.key}) : super(key: key); diff --git a/lib/pages/view_ticket.dart b/lib/pages/view_ticket.dart index 9f5c935..21aa003 100644 --- a/lib/pages/view_ticket.dart +++ b/lib/pages/view_ticket.dart @@ -14,7 +14,7 @@ import '../widgets/mobile/MobileBottomNav.dart'; import '../widgets/mobile/mobile_view_ticket.dart'; class ViewTicket extends StatefulWidget { - final Key key; + final Key? key; final int ticketId; const ViewTicket(this.ticketId, {this.key}) : super(key: key); diff --git a/lib/utils/double_back_to_close_app.dart b/lib/utils/double_back_to_close_app.dart index b39eee3..16826f3 100644 --- a/lib/utils/double_back_to_close_app.dart +++ b/lib/utils/double_back_to_close_app.dart @@ -21,7 +21,7 @@ class DoubleBackToCloseApp extends StatefulWidget { /// Creates a widget that allows the user to close the app by double tapping /// the back-button. const DoubleBackToCloseApp({ - Key key, + Key? key, @required this.snackBar, @required this.child, }) : assert(snackBar != null), diff --git a/lib/utils/shop_scroll_controller.dart b/lib/utils/shop_scroll_controller.dart index f987c38..ebae43e 100644 --- a/lib/utils/shop_scroll_controller.dart +++ b/lib/utils/shop_scroll_controller.dart @@ -38,7 +38,7 @@ class ShopScrollController extends ScrollController { final bool keepScrollOffset; /// [toString]输出中使用的标签。 旨在帮助在调试输出中标识滚动控制器实例。 - final String debugLabel; + final String? debugLabel; /// The currently attached positions. 当前附加的 [positions]。 /// 这不应直接突变。 可以使用[attach]和[detach]添加和删除[ScrollPosition]对象。 @@ -61,7 +61,7 @@ class ShopScrollController extends ScrollController { 'ScrollController not attached to any scroll views.'); assert(_positions.length == 1, 'ScrollController attached to multiple scroll views.'); - return _positions.single; + return _positions.single as ShopScrollPosition; } /// 可滚动小部件的当前滚动偏移量 @@ -83,12 +83,12 @@ class ShopScrollController extends ScrollController { /// 持续时间不能为零。 要在没有动画的情况下跳至特定值,请使用[jumpTo]。 Future animateTo( double offset, { - @required Duration duration, - @required Curve curve, + required Duration duration, + required Curve curve, }) { assert(_positions.isNotEmpty, 'ScrollController not attached to any scroll views.'); - final List> animations = List>(_positions.length); + final List> animations = List>.filled(_positions.length, Future.value()); for (int i = 0; i < _positions.length; i += 1) animations[i] = _positions[i].animateTo(offset, duration: duration, curve: curve); @@ -149,7 +149,7 @@ class ShopScrollController extends ScrollController { /// 则它将是前一个实例。 当环境已更改并且[Scrollable]需要重新创建[ScrollPosition] /// 对象时,将使用此方法。 第一次创建[ScrollPosition]时为null。 ScrollPosition createScrollPosition(ScrollPhysics physics, - ScrollContext context, ScrollPosition oldPosition) { + ScrollContext context, ScrollPosition? oldPosition) { return ShopScrollPosition( coordinator: coordinator, physics: physics, @@ -175,7 +175,7 @@ class ShopScrollController extends ScrollController { @mustCallSuper void debugFillDescription(List description) { super.debugFillDescription(description); - if (debugLabel != null) description.add(debugLabel); + if (debugLabel != null) description.add(debugLabel!); if (initialScrollOffset != 0.0) description.add( 'initialScrollOffset: ${initialScrollOffset.toStringAsFixed(1)}, '); diff --git a/lib/utils/shop_scroll_coordinator.dart b/lib/utils/shop_scroll_coordinator.dart index 624dbeb..044e918 100644 --- a/lib/utils/shop_scroll_coordinator.dart +++ b/lib/utils/shop_scroll_coordinator.dart @@ -12,15 +12,15 @@ class ShopScrollCoordinator { /// 页面主 CustomScrollView 控制 final String pageLabel = "page"; - ShopScrollController _pageScrollController; - double Function() pinnedHeaderSliverHeightBuilder; + late ShopScrollController _pageScrollController; + double Function()? pinnedHeaderSliverHeightBuilder; ShopScrollPosition get _pageScrollPosition => _pageScrollController.position; - ScrollDragController scrollDragController; + late ScrollDragController scrollDragController; /// 主页面滑动部件默认位置 - double _pageInitialOffset; + late double _pageInitialOffset; /// 获取主页面滑动控制器 ShopScrollController pageScrollController([double initialOffset = 0.0]) { @@ -32,26 +32,26 @@ class ShopScrollCoordinator { } /// 创建并获取一个子滑动控制器 - ShopScrollController newChildScrollController([String debugLabel]) => + ShopScrollController newChildScrollController([String? debugLabel]) => ShopScrollController(this, debugLabel: debugLabel); /// 子部件滑动数据协调 /// [userScrollDirection]用户滑动方向 /// [position]被滑动的子部件的位置信息 void applyUserOffset(double delta, - [ScrollDirection userScrollDirection, ShopScrollPosition position]) { + [ScrollDirection? userScrollDirection, ShopScrollPosition? position]) { if (userScrollDirection == ScrollDirection.reverse) { - updateUserScrollDirection(_pageScrollPosition, userScrollDirection); + updateUserScrollDirection(_pageScrollPosition, userScrollDirection!); final innerDelta = _pageScrollPosition.applyClampedDragUpdate(delta); if (innerDelta != 0.0) { - updateUserScrollDirection(position, userScrollDirection); + updateUserScrollDirection(position!, userScrollDirection); position.applyFullDragUpdate(innerDelta); } } else { - updateUserScrollDirection(position, userScrollDirection); + updateUserScrollDirection(position!, userScrollDirection!); final outerDelta = position.applyClampedDragUpdate(delta); if (outerDelta != 0.0) { - updateUserScrollDirection(_pageScrollPosition, userScrollDirection); + updateUserScrollDirection(_pageScrollPosition, userScrollDirection!); _pageScrollPosition.applyFullDragUpdate(outerDelta); } } @@ -60,7 +60,7 @@ class ShopScrollCoordinator { bool applyContentDimensions(double minScrollExtent, double maxScrollExtent, ShopScrollPosition position) { if (pinnedHeaderSliverHeightBuilder != null) { - maxScrollExtent = maxScrollExtent - pinnedHeaderSliverHeightBuilder(); + maxScrollExtent = maxScrollExtent - pinnedHeaderSliverHeightBuilder!(); maxScrollExtent = math.max(0.0, maxScrollExtent); } return position.applyContentDimensions( diff --git a/lib/utils/shop_scroll_position.dart b/lib/utils/shop_scroll_position.dart index 448e314..835333d 100644 --- a/lib/utils/shop_scroll_position.dart +++ b/lib/utils/shop_scroll_position.dart @@ -11,17 +11,17 @@ import 'shop_scroll_coordinator.dart'; class ShopScrollPosition extends ScrollPosition implements ScrollActivityDelegate { final ShopScrollCoordinator coordinator; // 协调器 - ScrollDragController _currentDrag; + ScrollDragController? _currentDrag; double _heldPreviousVelocity = 0.0; ShopScrollPosition( - {@required ScrollPhysics physics, - @required ScrollContext context, + {required ScrollPhysics physics, + required ScrollContext context, double initialPixels = 0.0, bool keepScrollOffset = true, - ScrollPosition oldPosition, - String debugLabel, - @required this.coordinator}) + ScrollPosition? oldPosition, + String? debugLabel, + required this.coordinator}) : super( physics: physics, context: context, @@ -40,7 +40,7 @@ class ShopScrollPosition extends ScrollPosition @override double setPixels(double newPixels) { - assert(activity.isScrolling); + assert(activity!.isScrolling); return super.setPixels(newPixels); } @@ -51,13 +51,13 @@ class ShopScrollPosition extends ScrollPosition goIdle(); return; } - activity.updateDelegate(this); + activity!.updateDelegate(this); final ShopScrollPosition typedOther = other as ShopScrollPosition; _userScrollDirection = typedOther._userScrollDirection; assert(_currentDrag == null); if (typedOther._currentDrag != null) { _currentDrag = typedOther._currentDrag; - _currentDrag.updateDelegate(this); + _currentDrag!.updateDelegate(this); typedOther._currentDrag = null; } } @@ -131,14 +131,14 @@ class ShopScrollPosition extends ScrollPosition } @override - void beginActivity(ScrollActivity newActivity) { + void beginActivity(ScrollActivity? newActivity) { _heldPreviousVelocity = 0.0; if (newActivity == null) return; assert(newActivity.delegate == this); super.beginActivity(newActivity); _currentDrag?.dispose(); _currentDrag = null; - if (!activity.isScrolling) updateUserScrollDirection(ScrollDirection.idle); + if (!activity!.isScrolling) updateUserScrollDirection(ScrollDirection.idle); } /// 将[用户滚动方向]设置为给定值。 @@ -154,7 +154,7 @@ class ShopScrollPosition extends ScrollPosition @override ScrollHoldController hold(VoidCallback holdCancelCallback) { - final double previousVelocity = activity.velocity; + final double previousVelocity = activity!.velocity; final HoldScrollActivity holdActivity = HoldScrollActivity(delegate: this, onHoldCanceled: holdCancelCallback); beginActivity(holdActivity); @@ -195,10 +195,10 @@ class ShopScrollPosition extends ScrollPosition if (coordinator.pageExpand == PageExpandState.Expanding) return; } assert(pixels != null); - final Simulation simulation = + final Simulation? simulation = physics.createBallisticSimulation(this, velocity); if (simulation != null) { - beginActivity(BallisticScrollActivity(this, simulation, context.vsync)); + beginActivity(BallisticScrollActivity(this, simulation, context.vsync, false)); } else { goIdle(); } @@ -220,8 +220,8 @@ class ShopScrollPosition extends ScrollPosition @override Future animateTo( double to, { - @required Duration duration, - @required Curve curve, + required Duration duration, + required Curve curve, }) { if (nearEqual(to, pixels, physics.tolerance.distance)) { // 跳过动画,直接移到我们已经靠近的位置。 diff --git a/lib/widgets/desktop/create_online_store_1.dart b/lib/widgets/desktop/create_online_store_1.dart index 9703301..416c860 100644 --- a/lib/widgets/desktop/create_online_store_1.dart +++ b/lib/widgets/desktop/create_online_store_1.dart @@ -15,7 +15,7 @@ import '../../widgets/general/navigationbar.dart'; class CreateOnlineStore1 extends StatefulWidget { final int businessId; - const CreateOnlineStore1(this.businessId, {Key key}) : super(key: key); + const CreateOnlineStore1(this.businessId, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_blog.dart b/lib/widgets/desktop/desktop_blog.dart index c4ef5f4..09047fe 100644 --- a/lib/widgets/desktop/desktop_blog.dart +++ b/lib/widgets/desktop/desktop_blog.dart @@ -24,7 +24,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar class DesktopBlog extends StatefulWidget { final int businessId; - const DesktopBlog({Key key, this.businessId}) : super(key: key); + const DesktopBlog({Key? key, this.businessId}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_buy_service.dart b/lib/widgets/desktop/desktop_buy_service.dart index 68db0fa..07508a2 100644 --- a/lib/widgets/desktop/desktop_buy_service.dart +++ b/lib/widgets/desktop/desktop_buy_service.dart @@ -15,7 +15,7 @@ import '../../widgets/general/navigationbar.dart'; class DesktopBuyService extends StatefulWidget { final Map data; - const DesktopBuyService(this.data, {Key key}) + const DesktopBuyService(this.data, {Key? key}) : super(key: key); @override diff --git a/lib/widgets/desktop/desktop_change_mobile_or_email.dart b/lib/widgets/desktop/desktop_change_mobile_or_email.dart index f3384fc..83dfebf 100644 --- a/lib/widgets/desktop/desktop_change_mobile_or_email.dart +++ b/lib/widgets/desktop/desktop_change_mobile_or_email.dart @@ -16,7 +16,7 @@ import '../../utils/utils.dart'; class DesktopChangeMobileOrEmail extends StatefulWidget { final bool isMobile; - const DesktopChangeMobileOrEmail(this.isMobile, {Key key}) : super(key: key); + const DesktopChangeMobileOrEmail(this.isMobile, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_change_password.dart b/lib/widgets/desktop/desktop_change_password.dart index 4b13861..b6e0203 100644 --- a/lib/widgets/desktop/desktop_change_password.dart +++ b/lib/widgets/desktop/desktop_change_password.dart @@ -8,7 +8,7 @@ import '../../utils/utils.dart'; import '../../widgets/general/breadcrumbs.dart'; class DesktopChangePassword extends StatefulWidget { - const DesktopChangePassword({Key key}) : super(key: key); + const DesktopChangePassword({Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_checkout.dart b/lib/widgets/desktop/desktop_checkout.dart index 322cfa6..a36599a 100644 --- a/lib/widgets/desktop/desktop_checkout.dart +++ b/lib/widgets/desktop/desktop_checkout.dart @@ -34,7 +34,7 @@ import '../../utils/utils.dart'; import '../../widgets/general/sliding_up_panel.dart'; class DesktopCheckout extends StatefulWidget { - final Key key; + final Key? key; final int businessId; const DesktopCheckout(this.businessId, {this.key,}) : super(key: key); diff --git a/lib/widgets/desktop/desktop_contact_us.dart b/lib/widgets/desktop/desktop_contact_us.dart index 6684098..d309101 100644 --- a/lib/widgets/desktop/desktop_contact_us.dart +++ b/lib/widgets/desktop/desktop_contact_us.dart @@ -19,7 +19,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar class DesktopContactUs extends StatefulWidget { final Business business; - const DesktopContactUs(this.business, {Key key}) : super(key: key); + const DesktopContactUs(this.business, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_coupons.dart b/lib/widgets/desktop/desktop_coupons.dart index 95c8edf..f3c8541 100644 --- a/lib/widgets/desktop/desktop_coupons.dart +++ b/lib/widgets/desktop/desktop_coupons.dart @@ -17,7 +17,7 @@ import '../../widgets/general/navigationbar.dart'; class DesktopCoupons extends StatefulWidget { final int contactId; - final Key key; + final Key? key; const DesktopCoupons(this.contactId, {this.key}); @override diff --git a/lib/widgets/desktop/desktop_download_apps.dart b/lib/widgets/desktop/desktop_download_apps.dart index efb6c1d..9009a7b 100644 --- a/lib/widgets/desktop/desktop_download_apps.dart +++ b/lib/widgets/desktop/desktop_download_apps.dart @@ -9,7 +9,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar class DesktopDownloadApps extends StatefulWidget { final Map data; - DesktopDownloadApps(this.data, {Key key}) : super(key: key); + DesktopDownloadApps(this.data, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_edit_address.dart b/lib/widgets/desktop/desktop_edit_address.dart index 639769c..c05010d 100644 --- a/lib/widgets/desktop/desktop_edit_address.dart +++ b/lib/widgets/desktop/desktop_edit_address.dart @@ -20,7 +20,7 @@ import '../../utils/utils.dart'; import '../../widgets/general/navigationbar.dart'; class DesktopEditAddress extends StatefulWidget { - final Key key; + final Key? key; final Address address; final int businessId; const DesktopEditAddress(this.address, {this.key, int businessId}) : diff --git a/lib/widgets/desktop/desktop_forgot_password.dart b/lib/widgets/desktop/desktop_forgot_password.dart index 3ea3890..bca07d9 100644 --- a/lib/widgets/desktop/desktop_forgot_password.dart +++ b/lib/widgets/desktop/desktop_forgot_password.dart @@ -13,7 +13,7 @@ import '../../utils/http_util.dart'; import '../../utils/utils.dart'; class DesktopForgotPassword extends StatefulWidget { - const DesktopForgotPassword({Key key}) : super(key: key); + const DesktopForgotPassword({Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_igoshow_learn_more.dart b/lib/widgets/desktop/desktop_igoshow_learn_more.dart index 28cc732..c5c1f3f 100644 --- a/lib/widgets/desktop/desktop_igoshow_learn_more.dart +++ b/lib/widgets/desktop/desktop_igoshow_learn_more.dart @@ -8,7 +8,7 @@ import '../../widgets/general/breadcrumbs.dart'; class DesktopiGoShowLearnMore extends StatefulWidget { final Map data; - const DesktopiGoShowLearnMore(this.data, {Key key}) : super(key: key); + const DesktopiGoShowLearnMore(this.data, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_login.dart b/lib/widgets/desktop/desktop_login.dart index 0f20745..8916c83 100644 --- a/lib/widgets/desktop/desktop_login.dart +++ b/lib/widgets/desktop/desktop_login.dart @@ -11,7 +11,7 @@ import '../../utils/http_util.dart'; import '../../utils/utils.dart'; class DesktopLogin extends StatefulWidget { - final Key key; + final Key? key; const DesktopLogin({this.key}) : super(key: key); diff --git a/lib/widgets/desktop/desktop_me.dart b/lib/widgets/desktop/desktop_me.dart index 43df18e..0082bb9 100644 --- a/lib/widgets/desktop/desktop_me.dart +++ b/lib/widgets/desktop/desktop_me.dart @@ -21,7 +21,7 @@ double statusBarHeight; double screenHeight; class DesktopMe extends StatefulWidget { - final Key key; + final Key? key; const DesktopMe({this.key}) : super(key: key); diff --git a/lib/widgets/desktop/desktop_minipos_learn_more.dart b/lib/widgets/desktop/desktop_minipos_learn_more.dart index 2e3c979..8828712 100644 --- a/lib/widgets/desktop/desktop_minipos_learn_more.dart +++ b/lib/widgets/desktop/desktop_minipos_learn_more.dart @@ -7,7 +7,7 @@ import '../../widgets/general/breadcrumbs.dart'; class DesktopMiniPosLearnMore extends StatefulWidget { final Map data; - const DesktopMiniPosLearnMore(this.data, {Key key}) : super(key: key); + const DesktopMiniPosLearnMore(this.data, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_my_addresses.dart b/lib/widgets/desktop/desktop_my_addresses.dart index 05860bc..5737666 100644 --- a/lib/widgets/desktop/desktop_my_addresses.dart +++ b/lib/widgets/desktop/desktop_my_addresses.dart @@ -20,7 +20,7 @@ import '../../widgets/general/navigationbar.dart'; class DesktopMyAddresses extends StatefulWidget { final int businessId; - const DesktopMyAddresses({Key key, this.businessId}) : super(key: key); + const DesktopMyAddresses({Key? key, this.businessId}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_my_support.dart b/lib/widgets/desktop/desktop_my_support.dart index 578159d..a79e5f5 100644 --- a/lib/widgets/desktop/desktop_my_support.dart +++ b/lib/widgets/desktop/desktop_my_support.dart @@ -20,7 +20,7 @@ import '../../widgets/general/navigationbar.dart'; class DesktopMySupport extends StatefulWidget { final int businessId; - const DesktopMySupport({Key key, this.businessId}) : super(key: key); + const DesktopMySupport({Key? key, this.businessId}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_new_address.dart b/lib/widgets/desktop/desktop_new_address.dart index 2846726..d7aacc7 100644 --- a/lib/widgets/desktop/desktop_new_address.dart +++ b/lib/widgets/desktop/desktop_new_address.dart @@ -14,7 +14,7 @@ import '../../utils/http_util.dart'; import '../../widgets/general/navigationbar.dart'; class DesktopNewAddress extends StatefulWidget { - final Key key; + final Key? key; final LocatedAddress locatedAddress; final int businessId; const DesktopNewAddress({this.key, this.locatedAddress, this.businessId}) : super(key: key); diff --git a/lib/widgets/desktop/desktop_new_comment.dart b/lib/widgets/desktop/desktop_new_comment.dart index d393cc1..b322f1b 100644 --- a/lib/widgets/desktop/desktop_new_comment.dart +++ b/lib/widgets/desktop/desktop_new_comment.dart @@ -22,7 +22,7 @@ import '../../utils/utils.dart'; class DesktopNewComment extends StatefulWidget { - final Key key; + final Key? key; final int orderId; const DesktopNewComment(this.orderId, {this.key}); diff --git a/lib/widgets/desktop/desktop_new_ticket.dart b/lib/widgets/desktop/desktop_new_ticket.dart index 424604a..3bec6a5 100644 --- a/lib/widgets/desktop/desktop_new_ticket.dart +++ b/lib/widgets/desktop/desktop_new_ticket.dart @@ -18,7 +18,7 @@ import '../../widgets/general/breadcrumbs.dart'; import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart'; class DesktopNewTicket extends StatefulWidget { - final Key key; + final Key? key; final int businessId; const DesktopNewTicket({this.key, int businessId}) : diff --git a/lib/widgets/desktop/desktop_new_user.dart b/lib/widgets/desktop/desktop_new_user.dart index 00510a6..c59905e 100644 --- a/lib/widgets/desktop/desktop_new_user.dart +++ b/lib/widgets/desktop/desktop_new_user.dart @@ -11,7 +11,7 @@ import '../../utils/http_util.dart'; import '../../utils/utils.dart'; class DesktopNewUser extends StatefulWidget { - const DesktopNewUser({Key key}) : super(key: key); + const DesktopNewUser({Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_order_detail.dart b/lib/widgets/desktop/desktop_order_detail.dart index a2d473e..860738d 100644 --- a/lib/widgets/desktop/desktop_order_detail.dart +++ b/lib/widgets/desktop/desktop_order_detail.dart @@ -26,7 +26,7 @@ import '../../widgets/general/breadcrumbs.dart'; import '../../widgets/general/navigationbar.dart'; class DesktopOrderDetail extends StatefulWidget { - final Key key; + final Key? key; final int orderId; final bool fromOrders; const DesktopOrderDetail(this.orderId, {this.key, this.fromOrders}); diff --git a/lib/widgets/desktop/desktop_orders.dart b/lib/widgets/desktop/desktop_orders.dart index bda47c1..e8d2d16 100644 --- a/lib/widgets/desktop/desktop_orders.dart +++ b/lib/widgets/desktop/desktop_orders.dart @@ -22,7 +22,7 @@ import '../../widgets/general/navigationbar.dart'; class DesktopOrders extends StatefulWidget { - final Key key; + final Key? key; const DesktopOrders({this.key}); @override diff --git a/lib/widgets/desktop/desktop_pay_now.dart b/lib/widgets/desktop/desktop_pay_now.dart index c8aa6fe..e9d2dea 100644 --- a/lib/widgets/desktop/desktop_pay_now.dart +++ b/lib/widgets/desktop/desktop_pay_now.dart @@ -20,7 +20,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar import '../../utils/utils.dart'; class DesktopPayNow extends StatefulWidget { - final Key key; + final Key? key; final int orderId; const DesktopPayNow(this.orderId, {this.key}); diff --git a/lib/widgets/desktop/desktop_plain_page.dart b/lib/widgets/desktop/desktop_plain_page.dart index 2844fca..10d5d6e 100644 --- a/lib/widgets/desktop/desktop_plain_page.dart +++ b/lib/widgets/desktop/desktop_plain_page.dart @@ -13,7 +13,7 @@ import '../../widgets/general/navigationbar.dart'; class DesktopPlainPage extends StatefulWidget { final Blog blog; - const DesktopPlainPage(this.blog, {Key key}) : super(key: key); + const DesktopPlainPage(this.blog, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_product_detail_page.dart b/lib/widgets/desktop/desktop_product_detail_page.dart index d6a5f70..d5ca31e 100644 --- a/lib/widgets/desktop/desktop_product_detail_page.dart +++ b/lib/widgets/desktop/desktop_product_detail_page.dart @@ -30,7 +30,7 @@ class DesktopProductDetailPage extends StatefulWidget { final Product product; const DesktopProductDetailPage( - {@required this.business, @required this.product, Key key}) + {@required this.business, @required this.product, Key? key}) : super(key: key); @override diff --git a/lib/widgets/desktop/desktop_product_item.dart b/lib/widgets/desktop/desktop_product_item.dart index ac22e13..8398113 100644 --- a/lib/widgets/desktop/desktop_product_item.dart +++ b/lib/widgets/desktop/desktop_product_item.dart @@ -17,7 +17,7 @@ class DesktopProductItem extends StatefulWidget { final Business business; final bool horizontal; - DesktopProductItem({this.product, this.business, Key key, this.horizontal = false}) + DesktopProductItem({this.product, this.business, Key? key, this.horizontal = false}) : super(key: key); @override diff --git a/lib/widgets/desktop/desktop_renew_license.dart b/lib/widgets/desktop/desktop_renew_license.dart index 4960562..7e1d834 100644 --- a/lib/widgets/desktop/desktop_renew_license.dart +++ b/lib/widgets/desktop/desktop_renew_license.dart @@ -16,7 +16,7 @@ import '../../widgets/general/navigationbar.dart'; class DesktopRenewLicense extends StatefulWidget { final int businessId; - const DesktopRenewLicense(this.businessId, {Key key}) : super(key: key); + const DesktopRenewLicense(this.businessId, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_renew_minioffice.dart b/lib/widgets/desktop/desktop_renew_minioffice.dart index 9685b83..bcc233f 100644 --- a/lib/widgets/desktop/desktop_renew_minioffice.dart +++ b/lib/widgets/desktop/desktop_renew_minioffice.dart @@ -17,7 +17,7 @@ import '../../widgets/general/navigationbar.dart'; class DesktopRenewMiniOffice extends StatefulWidget { final Map data; - const DesktopRenewMiniOffice(this.data, {Key key}) : super(key: key); + const DesktopRenewMiniOffice(this.data, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/desktop/desktop_reset_password.dart b/lib/widgets/desktop/desktop_reset_password.dart index 4312eb2..a1ca1fc 100644 --- a/lib/widgets/desktop/desktop_reset_password.dart +++ b/lib/widgets/desktop/desktop_reset_password.dart @@ -12,7 +12,7 @@ class DesktopResetPassword extends StatefulWidget { final String mobile; final String code; - const DesktopResetPassword(this.mobile, {this.code, Key key}) : + const DesktopResetPassword(this.mobile, {this.code, Key? key}) : super(key: key); @override diff --git a/lib/widgets/desktop/desktop_search_place.dart b/lib/widgets/desktop/desktop_search_place.dart index 0ab73ff..4bf6090 100644 --- a/lib/widgets/desktop/desktop_search_place.dart +++ b/lib/widgets/desktop/desktop_search_place.dart @@ -17,7 +17,7 @@ import '../../utils/http_util.dart'; import '../../utils/utils.dart'; class DesktopSearchPlace extends StatefulWidget { - final Key key; + final Key? key; final int businessId; const DesktopSearchPlace(this.businessId, {this.key}) : super(key: key); diff --git a/lib/widgets/desktop/desktop_set_password.dart b/lib/widgets/desktop/desktop_set_password.dart index 99bebd0..af24f70 100644 --- a/lib/widgets/desktop/desktop_set_password.dart +++ b/lib/widgets/desktop/desktop_set_password.dart @@ -12,7 +12,7 @@ class DesktopSetPassword extends StatefulWidget { final String mobile; final String code; - const DesktopSetPassword(this.mobile, {this.code, Key key}) : + const DesktopSetPassword(this.mobile, {this.code, Key? key}) : super(key: key); @override diff --git a/lib/widgets/desktop/desktop_store_product_search.dart b/lib/widgets/desktop/desktop_store_product_search.dart index 3d3fef1..cac7c03 100644 --- a/lib/widgets/desktop/desktop_store_product_search.dart +++ b/lib/widgets/desktop/desktop_store_product_search.dart @@ -19,7 +19,7 @@ import '../../utils/utils.dart'; import '../../widgets/general/add_remove_button.dart'; class DesktopStoreProductSearch extends StatefulWidget { - final Key key; + final Key? key; final Business business; const DesktopStoreProductSearch(this.business, {this.key}); diff --git a/lib/widgets/desktop/desktop_user_profile.dart b/lib/widgets/desktop/desktop_user_profile.dart index 6024399..35d4d65 100644 --- a/lib/widgets/desktop/desktop_user_profile.dart +++ b/lib/widgets/desktop/desktop_user_profile.dart @@ -15,7 +15,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar import '../../utils/utils.dart'; class DesktopUserProfile extends StatefulWidget { - final Key key; + final Key? key; const DesktopUserProfile({this.key}) : super(key: key); diff --git a/lib/widgets/desktop/desktop_view_blog.dart b/lib/widgets/desktop/desktop_view_blog.dart index e0bcdc7..f1cebd0 100644 --- a/lib/widgets/desktop/desktop_view_blog.dart +++ b/lib/widgets/desktop/desktop_view_blog.dart @@ -16,7 +16,7 @@ import '../../widgets/general/breadcrumbs.dart'; import '../../utils/util_io.dart' if (dart.library.html) '../../utils/util_web.dart'; class DesktopViewBlog extends StatefulWidget { - final Key key; + final Key? key; final int bid; const DesktopViewBlog(this.bid, {this.key}) : super(key: key); diff --git a/lib/widgets/desktop/desktop_view_ticket.dart b/lib/widgets/desktop/desktop_view_ticket.dart index 614e33a..00f9b30 100644 --- a/lib/widgets/desktop/desktop_view_ticket.dart +++ b/lib/widgets/desktop/desktop_view_ticket.dart @@ -19,7 +19,7 @@ import '../../utils/utils.dart'; import '../../widgets/general/text_link.dart'; class DesktopViewTicket extends StatefulWidget { - final Key key; + final Key? key; final int ticketId; const DesktopViewTicket(this.ticketId, {this.key}) : super(key: key); diff --git a/lib/widgets/desktop/product_item.dart b/lib/widgets/desktop/product_item.dart index def6d06..919bc5c 100644 --- a/lib/widgets/desktop/product_item.dart +++ b/lib/widgets/desktop/product_item.dart @@ -17,7 +17,7 @@ class ProductItem extends StatefulWidget { final Product product; final bool horizontal; - const ProductItem(this.product, this.business, {Key key, this.horizontal = false}) : super(key: key); + const ProductItem(this.product, this.business, {Key? key, this.horizontal = false}) : super(key: key); @override State createState() => ProductItemState(); diff --git a/lib/widgets/desktop/product_search.dart b/lib/widgets/desktop/product_search.dart index a7585e9..a7486bc 100644 --- a/lib/widgets/desktop/product_search.dart +++ b/lib/widgets/desktop/product_search.dart @@ -20,7 +20,7 @@ import 'product_item.dart'; class ProductSearch extends StatefulWidget { final Business business; - const ProductSearch(this.business, {Key key}) : super(key: key); + const ProductSearch(this.business, {Key? key}) : super(key: key); @override State createState() => ProductSearchState(); diff --git a/lib/widgets/desktop/shop.dart b/lib/widgets/desktop/shop.dart index 82c7877..7c85306 100644 --- a/lib/widgets/desktop/shop.dart +++ b/lib/widgets/desktop/shop.dart @@ -24,7 +24,7 @@ import 'shopping_cart_widget.dart'; class Shop extends StatefulWidget { final int businessId; - const Shop({Key key, this.businessId}): super(key: key); + const Shop({Key? key, this.businessId}): super(key: key); @override State createState() => ShopState(); diff --git a/lib/widgets/desktop/shop_bulletin.dart b/lib/widgets/desktop/shop_bulletin.dart index 33a4f3e..cef770a 100644 --- a/lib/widgets/desktop/shop_bulletin.dart +++ b/lib/widgets/desktop/shop_bulletin.dart @@ -7,7 +7,7 @@ import '../../models/business.dart'; class ShopBulletin extends StatefulWidget { final Business business; - const ShopBulletin(this.business, {Key key}): super(key: key); + const ShopBulletin(this.business, {Key? key}): super(key: key); @override State createState() => ShopBulletinState(); diff --git a/lib/widgets/desktop/shop_products.dart b/lib/widgets/desktop/shop_products.dart index d6a6916..a14b2ee 100644 --- a/lib/widgets/desktop/shop_products.dart +++ b/lib/widgets/desktop/shop_products.dart @@ -16,7 +16,7 @@ import '../../widgets/desktop/product_item.dart'; class ShopProducts extends StatefulWidget { final dynamic data; - const ShopProducts(this.data, {Key key}): super(key: key); + const ShopProducts(this.data, {Key? key}): super(key: key); @override State createState() => ShopProductsState(); diff --git a/lib/widgets/desktop/shop_promote.dart b/lib/widgets/desktop/shop_promote.dart index e3bf2c9..8849ccf 100644 --- a/lib/widgets/desktop/shop_promote.dart +++ b/lib/widgets/desktop/shop_promote.dart @@ -12,7 +12,7 @@ import '../../utils/util_io.dart' if (dart.library.html) '../../utils/util_web.d class ShopPromote extends StatefulWidget { final dynamic data; - const ShopPromote(this.data, {Key key}): super(key: key); + const ShopPromote(this.data, {Key? key}): super(key: key); @override State createState() => ShopPromoteState(); diff --git a/lib/widgets/general/carousel.dart b/lib/widgets/general/carousel.dart index e239e1e..e3572cc 100644 --- a/lib/widgets/general/carousel.dart +++ b/lib/widgets/general/carousel.dart @@ -102,7 +102,7 @@ class CarouselState extends State { } class Indicator extends StatefulWidget { - Indicator({Key key, int count}) + Indicator({Key? key, int count}) : count = count, super(key: key); diff --git a/lib/widgets/general/download_item.dart b/lib/widgets/general/download_item.dart index dcf6d49..e9975c4 100644 --- a/lib/widgets/general/download_item.dart +++ b/lib/widgets/general/download_item.dart @@ -13,7 +13,7 @@ import '../../utils/utils.dart'; class DownloadItem extends StatefulWidget { final dynamic desc; final double width; - const DownloadItem(this.desc, {Key key, this.width}) : super(key: key); + const DownloadItem(this.desc, {Key? key, this.width}) : super(key: key); @override State createState() { diff --git a/lib/widgets/general/hover_widget.dart b/lib/widgets/general/hover_widget.dart index 06117cd..5baf2e6 100644 --- a/lib/widgets/general/hover_widget.dart +++ b/lib/widgets/general/hover_widget.dart @@ -1,3 +1,4 @@ +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; /// 自定义实现,替代已停维的 `hovering` 包的 [HoverWidget]。 diff --git a/lib/widgets/general/index_carousel.dart b/lib/widgets/general/index_carousel.dart index 7d40ea8..3a416e8 100644 --- a/lib/widgets/general/index_carousel.dart +++ b/lib/widgets/general/index_carousel.dart @@ -7,7 +7,7 @@ import 'package:responsive_builder/responsive_builder.dart'; class IndexCarousel extends StatelessWidget { final List galleries; - const IndexCarousel(this.galleries, {Key key}) : super(key: key); + const IndexCarousel(this.galleries, {Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/widgets/general/index_main_content_1.dart b/lib/widgets/general/index_main_content_1.dart index e9d0ff9..2b4e7b4 100644 --- a/lib/widgets/general/index_main_content_1.dart +++ b/lib/widgets/general/index_main_content_1.dart @@ -6,7 +6,7 @@ import 'package:responsive_builder/responsive_builder.dart'; class IndexMainContent1 extends StatelessWidget { final String message; - const IndexMainContent1(this.message, {Key key}) : super(key: key); + const IndexMainContent1(this.message, {Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/widgets/general/index_main_content_2.dart b/lib/widgets/general/index_main_content_2.dart index 842ed4c..b44af04 100644 --- a/lib/widgets/general/index_main_content_2.dart +++ b/lib/widgets/general/index_main_content_2.dart @@ -6,7 +6,7 @@ import 'package:responsive_builder/responsive_builder.dart'; class IndexMainContent2 extends StatelessWidget { final Map content; - const IndexMainContent2(this.content, {Key key}) : super(key: key); + const IndexMainContent2(this.content, {Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/widgets/general/index_main_content_3.dart b/lib/widgets/general/index_main_content_3.dart index 41906ab..832917a 100644 --- a/lib/widgets/general/index_main_content_3.dart +++ b/lib/widgets/general/index_main_content_3.dart @@ -6,7 +6,7 @@ import 'package:responsive_builder/responsive_builder.dart'; class IndexMainContent3 extends StatelessWidget { final Map content; - const IndexMainContent3(this.content, {Key key}) : super(key: key); + const IndexMainContent3(this.content, {Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/widgets/general/navigationbar_logo.dart b/lib/widgets/general/navigationbar_logo.dart index 2d674b3..aeb2653 100644 --- a/lib/widgets/general/navigationbar_logo.dart +++ b/lib/widgets/general/navigationbar_logo.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; import '../../constants.dart'; class NavigationBarLogo extends StatelessWidget { - const NavigationBarLogo({Key key}) : super(key: key); + const NavigationBarLogo({Key? key}) : super(key: key); static const IconData logoData = IconData( Constants.FONT_WISETRONIC, diff --git a/lib/widgets/general/payment_verification_code_dialog.dart b/lib/widgets/general/payment_verification_code_dialog.dart index 591e7c4..2d2fe52 100644 --- a/lib/widgets/general/payment_verification_code_dialog.dart +++ b/lib/widgets/general/payment_verification_code_dialog.dart @@ -12,7 +12,7 @@ typedef OnCodeVerified(); typedef OnCancel(); class PaymentVerificationCodeDialog extends StatefulWidget { - final Key key; + final Key? key; final User user; final OnCodeVerified onCodeVerified; final OnCancel onCancel; diff --git a/lib/widgets/general/read_more_text.dart b/lib/widgets/general/read_more_text.dart index 8d5227f..0b8042f 100644 --- a/lib/widgets/general/read_more_text.dart +++ b/lib/widgets/general/read_more_text.dart @@ -9,7 +9,7 @@ enum TrimMode { class ReadMoreText extends StatefulWidget { const ReadMoreText( this.data, { - Key key, + Key? key, this.trimExpandedText = ' read less', this.trimCollapsedText = ' ...read more', this.colorClickableText, diff --git a/lib/widgets/general/sliding_up_panel.dart b/lib/widgets/general/sliding_up_panel.dart index 732cee8..0cb67c5 100644 --- a/lib/widgets/general/sliding_up_panel.dart +++ b/lib/widgets/general/sliding_up_panel.dart @@ -164,7 +164,7 @@ class SlidingUpPanel extends StatefulWidget { final PanelState defaultPanelState; SlidingUpPanel({ - Key key, + Key? key, this.panel, this.panelBuilder, this.body, diff --git a/lib/widgets/mobile/create_online_store_1.dart b/lib/widgets/mobile/create_online_store_1.dart index 7225210..8abcaa8 100644 --- a/lib/widgets/mobile/create_online_store_1.dart +++ b/lib/widgets/mobile/create_online_store_1.dart @@ -12,7 +12,7 @@ import '../../utils/utils.dart'; class CreateOnlineStore1 extends StatefulWidget { final int businessId; - const CreateOnlineStore1(this.businessId, {Key key}) : super(key: key); + const CreateOnlineStore1(this.businessId, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_attribute_selection.dart b/lib/widgets/mobile/mobile_attribute_selection.dart index 16e9fbb..0201559 100644 --- a/lib/widgets/mobile/mobile_attribute_selection.dart +++ b/lib/widgets/mobile/mobile_attribute_selection.dart @@ -19,7 +19,7 @@ import '../../widgets/general/attribute/radio_options.dart'; class MobileAttributeSelection extends StatefulWidget { final Product product; final Business business; - final Key key; + final Key? key; final GlobalKey startKey; const MobileAttributeSelection({@required this.product, @required this.business, this.key, this.startKey}) diff --git a/lib/widgets/mobile/mobile_blog.dart b/lib/widgets/mobile/mobile_blog.dart index 8ebc2b5..1f9558f 100644 --- a/lib/widgets/mobile/mobile_blog.dart +++ b/lib/widgets/mobile/mobile_blog.dart @@ -18,7 +18,7 @@ import '../../widgets/mobile/MobileBottomNav.dart'; class MobileBlog extends StatefulWidget { final int businessId; - const MobileBlog({Key key, this.businessId}) : super(key: key); + const MobileBlog({Key? key, this.businessId}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_buy_service.dart b/lib/widgets/mobile/mobile_buy_service.dart index 3e77711..cc0994b 100644 --- a/lib/widgets/mobile/mobile_buy_service.dart +++ b/lib/widgets/mobile/mobile_buy_service.dart @@ -11,7 +11,7 @@ import '../../utils/utils.dart'; class MobileBuyService extends StatefulWidget { final Map data; - const MobileBuyService(this.data, {Key key}) + const MobileBuyService(this.data, {Key? key}) : super(key: key); @override diff --git a/lib/widgets/mobile/mobile_change_mobile_or_email.dart b/lib/widgets/mobile/mobile_change_mobile_or_email.dart index d421bc8..626ae79 100644 --- a/lib/widgets/mobile/mobile_change_mobile_or_email.dart +++ b/lib/widgets/mobile/mobile_change_mobile_or_email.dart @@ -15,7 +15,7 @@ import '../../utils/utils.dart'; class MobileChangeMobileOrEmail extends StatefulWidget { final bool isMobile; - const MobileChangeMobileOrEmail(this.isMobile, {Key key}) : super(key: key); + const MobileChangeMobileOrEmail(this.isMobile, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_change_password.dart b/lib/widgets/mobile/mobile_change_password.dart index 4cc40f6..b3f2b0c 100644 --- a/lib/widgets/mobile/mobile_change_password.dart +++ b/lib/widgets/mobile/mobile_change_password.dart @@ -6,7 +6,7 @@ import '../../utils/utils.dart'; import '../../generated/l10n.dart'; class MobileChangePassword extends StatefulWidget { - const MobileChangePassword({Key key}) : super(key: key); + const MobileChangePassword({Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_checkout.dart b/lib/widgets/mobile/mobile_checkout.dart index 8d3dd9c..1974db2 100644 --- a/lib/widgets/mobile/mobile_checkout.dart +++ b/lib/widgets/mobile/mobile_checkout.dart @@ -32,7 +32,7 @@ import '../../utils/utils.dart'; import '../../widgets/general/sliding_up_panel.dart'; class MobileCheckout extends StatefulWidget { - final Key key; + final Key? key; final int businessId; const MobileCheckout(this.businessId, {this.key,}) : super(key: key); diff --git a/lib/widgets/mobile/mobile_contact_us.dart b/lib/widgets/mobile/mobile_contact_us.dart index 690e48e..0f3d5e3 100644 --- a/lib/widgets/mobile/mobile_contact_us.dart +++ b/lib/widgets/mobile/mobile_contact_us.dart @@ -15,7 +15,7 @@ import '../../widgets/general/text_link.dart'; class MobileContactUs extends StatefulWidget { final Business business; - const MobileContactUs(this.business, {Key key}) : super(key: key); + const MobileContactUs(this.business, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_coupons.dart b/lib/widgets/mobile/mobile_coupons.dart index 073aa2f..d893990 100644 --- a/lib/widgets/mobile/mobile_coupons.dart +++ b/lib/widgets/mobile/mobile_coupons.dart @@ -14,7 +14,7 @@ import '../../utils/utils.dart'; class MobileCoupons extends StatefulWidget { final int contactId; - final Key key; + final Key? key; const MobileCoupons(this.contactId, {this.key}); @override diff --git a/lib/widgets/mobile/mobile_download_apps.dart b/lib/widgets/mobile/mobile_download_apps.dart index ef1b1a2..362f4a7 100644 --- a/lib/widgets/mobile/mobile_download_apps.dart +++ b/lib/widgets/mobile/mobile_download_apps.dart @@ -7,7 +7,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar class MobileDownloadApps extends StatefulWidget { final Map data; - MobileDownloadApps(this.data, {Key key}) : super(key: key); + MobileDownloadApps(this.data, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_edit_address.dart b/lib/widgets/mobile/mobile_edit_address.dart index d062bb0..dbabd81 100644 --- a/lib/widgets/mobile/mobile_edit_address.dart +++ b/lib/widgets/mobile/mobile_edit_address.dart @@ -18,7 +18,7 @@ import '../general/gender_selection.dart'; import '../../routes.dart'; class MobileEditAddress extends StatefulWidget { - final Key key; + final Key? key; final Address address; final int businessId; const MobileEditAddress(this.address, {this.key, int businessId}) : diff --git a/lib/widgets/mobile/mobile_forgot_password.dart b/lib/widgets/mobile/mobile_forgot_password.dart index 42b7611..d2c16b3 100644 --- a/lib/widgets/mobile/mobile_forgot_password.dart +++ b/lib/widgets/mobile/mobile_forgot_password.dart @@ -12,7 +12,7 @@ import '../../utils/http_util.dart'; import '../../utils/utils.dart'; class MobileForgotPassword extends StatefulWidget { - const MobileForgotPassword({Key key}) : super(key: key); + const MobileForgotPassword({Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_igoshow_learn_more.dart b/lib/widgets/mobile/mobile_igoshow_learn_more.dart index 3aaee3b..520201f 100644 --- a/lib/widgets/mobile/mobile_igoshow_learn_more.dart +++ b/lib/widgets/mobile/mobile_igoshow_learn_more.dart @@ -5,7 +5,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar class MobileiGoShowLearnMore extends StatefulWidget { final Map data; - const MobileiGoShowLearnMore(this.data, {Key key}) : super(key: key); + const MobileiGoShowLearnMore(this.data, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_login.dart b/lib/widgets/mobile/mobile_login.dart index c048645..f1b8a6e 100644 --- a/lib/widgets/mobile/mobile_login.dart +++ b/lib/widgets/mobile/mobile_login.dart @@ -11,7 +11,7 @@ import '../../store/actions.dart'; import '../../store/store.dart'; class MobileLogin extends StatefulWidget { - final Key key; + final Key? key; const MobileLogin({this.key}) : super(key: key); diff --git a/lib/widgets/mobile/mobile_me.dart b/lib/widgets/mobile/mobile_me.dart index e5a0ff1..a66f7a9 100644 --- a/lib/widgets/mobile/mobile_me.dart +++ b/lib/widgets/mobile/mobile_me.dart @@ -25,7 +25,7 @@ double statusBarHeight; double screenHeight; class MobileMe extends StatefulWidget { - final Key key; + final Key? key; const MobileMe({this.key}) : super(key: key); diff --git a/lib/widgets/mobile/mobile_minipos_learn_more.dart b/lib/widgets/mobile/mobile_minipos_learn_more.dart index 337796c..8da55c1 100644 --- a/lib/widgets/mobile/mobile_minipos_learn_more.dart +++ b/lib/widgets/mobile/mobile_minipos_learn_more.dart @@ -4,7 +4,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar class MobileMiniPosLearnMore extends StatefulWidget { final Map data; - const MobileMiniPosLearnMore(this.data, {Key key}) : super(key: key); + const MobileMiniPosLearnMore(this.data, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_my_addresses.dart b/lib/widgets/mobile/mobile_my_addresses.dart index fc26f30..8c9795b 100644 --- a/lib/widgets/mobile/mobile_my_addresses.dart +++ b/lib/widgets/mobile/mobile_my_addresses.dart @@ -17,7 +17,7 @@ import '../../routes.dart'; class MobileMyAddresses extends StatefulWidget { final int businessId; - const MobileMyAddresses({Key key, this.businessId}) : super(key: key); + const MobileMyAddresses({Key? key, this.businessId}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_my_support.dart b/lib/widgets/mobile/mobile_my_support.dart index e864c8d..86cfca1 100644 --- a/lib/widgets/mobile/mobile_my_support.dart +++ b/lib/widgets/mobile/mobile_my_support.dart @@ -18,7 +18,7 @@ import '../../widgets/mobile/MobileBottomNav.dart'; class MobileMySupport extends StatefulWidget { final int businessId; - const MobileMySupport({Key key, this.businessId}) : super(key: key); + const MobileMySupport({Key? key, this.businessId}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_new_address.dart b/lib/widgets/mobile/mobile_new_address.dart index 122b0d2..5ffe425 100644 --- a/lib/widgets/mobile/mobile_new_address.dart +++ b/lib/widgets/mobile/mobile_new_address.dart @@ -11,7 +11,7 @@ import '../../store/store.dart'; import '../../utils/http_util.dart'; class MobileNewAddress extends StatefulWidget { - final Key key; + final Key? key; final LocatedAddress locatedAddress; final int businessId; const MobileNewAddress({this.key, this.locatedAddress, this.businessId}) : super(key: key); diff --git a/lib/widgets/mobile/mobile_new_comment.dart b/lib/widgets/mobile/mobile_new_comment.dart index aa85efd..8edc8f7 100644 --- a/lib/widgets/mobile/mobile_new_comment.dart +++ b/lib/widgets/mobile/mobile_new_comment.dart @@ -19,7 +19,7 @@ import '../../utils/utils.dart'; class MobileNewComment extends StatefulWidget { - final Key key; + final Key? key; final int orderId; const MobileNewComment(this.orderId, {this.key}); diff --git a/lib/widgets/mobile/mobile_new_ticket.dart b/lib/widgets/mobile/mobile_new_ticket.dart index 05ec49a..12ec0f4 100644 --- a/lib/widgets/mobile/mobile_new_ticket.dart +++ b/lib/widgets/mobile/mobile_new_ticket.dart @@ -17,7 +17,7 @@ import '../../store/store.dart'; import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart'; class MobileNewTicket extends StatefulWidget { - final Key key; + final Key? key; final int businessId; const MobileNewTicket({this.key, int businessId}) : diff --git a/lib/widgets/mobile/mobile_new_user.dart b/lib/widgets/mobile/mobile_new_user.dart index ff6f98b..c7ba78b 100644 --- a/lib/widgets/mobile/mobile_new_user.dart +++ b/lib/widgets/mobile/mobile_new_user.dart @@ -11,7 +11,7 @@ import '../../utils/http_util.dart'; import '../../utils/utils.dart'; class MobileNewUser extends StatefulWidget { - const MobileNewUser({Key key}) : super(key: key); + const MobileNewUser({Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_order_detail.dart b/lib/widgets/mobile/mobile_order_detail.dart index da9704e..9020f9e 100644 --- a/lib/widgets/mobile/mobile_order_detail.dart +++ b/lib/widgets/mobile/mobile_order_detail.dart @@ -24,7 +24,7 @@ import '../../routes.dart'; import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart'; class MobileOrderDetail extends StatefulWidget { - final Key key; + final Key? key; final int orderId; final bool fromOrders; const MobileOrderDetail(this.orderId, {this.key, this.fromOrders}); diff --git a/lib/widgets/mobile/mobile_orders.dart b/lib/widgets/mobile/mobile_orders.dart index 66d077a..64eb84f 100644 --- a/lib/widgets/mobile/mobile_orders.dart +++ b/lib/widgets/mobile/mobile_orders.dart @@ -18,7 +18,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'MobileBottomNav.dart'; class MobileOrders extends StatefulWidget { - final Key key; + final Key? key; const MobileOrders({this.key}); @override diff --git a/lib/widgets/mobile/mobile_pay_now.dart b/lib/widgets/mobile/mobile_pay_now.dart index 938f31b..b579c86 100644 --- a/lib/widgets/mobile/mobile_pay_now.dart +++ b/lib/widgets/mobile/mobile_pay_now.dart @@ -18,7 +18,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar import '../../utils/utils.dart'; class MobilePayNow extends StatefulWidget { - final Key key; + final Key? key; final int orderId; const MobilePayNow(this.orderId, {this.key}); diff --git a/lib/widgets/mobile/mobile_plain_page.dart b/lib/widgets/mobile/mobile_plain_page.dart index 44e1f72..1bcdd44 100644 --- a/lib/widgets/mobile/mobile_plain_page.dart +++ b/lib/widgets/mobile/mobile_plain_page.dart @@ -8,7 +8,7 @@ import '../../models/blog.dart'; class MobilePlainPage extends StatefulWidget { final Blog blog; - const MobilePlainPage(this.blog, {Key key}) : super(key: key); + const MobilePlainPage(this.blog, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_product_detail_page.dart b/lib/widgets/mobile/mobile_product_detail_page.dart index bb357ff..0ac1118 100644 --- a/lib/widgets/mobile/mobile_product_detail_page.dart +++ b/lib/widgets/mobile/mobile_product_detail_page.dart @@ -33,7 +33,7 @@ class MobileProductDetailPage extends StatefulWidget { final Product product; const MobileProductDetailPage( - {@required this.business, @required this.product, Key key}) + {@required this.business, @required this.product, Key? key}) : super(key: key); @override diff --git a/lib/widgets/mobile/mobile_product_item.dart b/lib/widgets/mobile/mobile_product_item.dart index 8a46e20..bba1e0e 100644 --- a/lib/widgets/mobile/mobile_product_item.dart +++ b/lib/widgets/mobile/mobile_product_item.dart @@ -15,7 +15,7 @@ class MobileProductItem extends StatefulWidget { final Product product; final Business business; - MobileProductItem({this.product, this.business, Key key}) + MobileProductItem({this.product, this.business, Key? key}) : super(key: key); @override diff --git a/lib/widgets/mobile/mobile_renew_license.dart b/lib/widgets/mobile/mobile_renew_license.dart index 5687efb..2b5f7b5 100644 --- a/lib/widgets/mobile/mobile_renew_license.dart +++ b/lib/widgets/mobile/mobile_renew_license.dart @@ -13,7 +13,7 @@ import '../../utils/utils.dart'; class MobileRenewLicense extends StatefulWidget { final int businessId; - const MobileRenewLicense(this.businessId, {Key key}) : super(key: key); + const MobileRenewLicense(this.businessId, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_renew_minioffice.dart b/lib/widgets/mobile/mobile_renew_minioffice.dart index 6268cb6..0ed1045 100644 --- a/lib/widgets/mobile/mobile_renew_minioffice.dart +++ b/lib/widgets/mobile/mobile_renew_minioffice.dart @@ -13,7 +13,7 @@ import '../../utils/utils.dart'; class MobileRenewMiniOffice extends StatefulWidget { final Map data; - const MobileRenewMiniOffice(this.data, {Key key}) : super(key: key); + const MobileRenewMiniOffice(this.data, {Key? key}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_reset_password.dart b/lib/widgets/mobile/mobile_reset_password.dart index 12256ef..b469376 100644 --- a/lib/widgets/mobile/mobile_reset_password.dart +++ b/lib/widgets/mobile/mobile_reset_password.dart @@ -12,7 +12,7 @@ class MobileResetPassword extends StatefulWidget { final String mobile; final String code; - const MobileResetPassword(this.mobile, {this.code, Key key}) + const MobileResetPassword(this.mobile, {this.code, Key? key}) : super(key: key); @override diff --git a/lib/widgets/mobile/mobile_search_place.dart b/lib/widgets/mobile/mobile_search_place.dart index 5b5b736..c805cb5 100644 --- a/lib/widgets/mobile/mobile_search_place.dart +++ b/lib/widgets/mobile/mobile_search_place.dart @@ -14,7 +14,7 @@ import '../../utils/http_util.dart'; import '../../utils/utils.dart'; class MobileSearchPlace extends StatefulWidget { - final Key key; + final Key? key; final int businessId; const MobileSearchPlace(this.businessId, {this.key}) : super(key: key); diff --git a/lib/widgets/mobile/mobile_set_password.dart b/lib/widgets/mobile/mobile_set_password.dart index 2b26784..b79584d 100644 --- a/lib/widgets/mobile/mobile_set_password.dart +++ b/lib/widgets/mobile/mobile_set_password.dart @@ -12,7 +12,7 @@ class MobileSetPassword extends StatefulWidget { final String mobile; final String code; - const MobileSetPassword(this.mobile, {Key key, this.code}) : super(key: key); + const MobileSetPassword(this.mobile, {Key? key, this.code}) : super(key: key); @override State createState() { diff --git a/lib/widgets/mobile/mobile_store_product_search.dart b/lib/widgets/mobile/mobile_store_product_search.dart index 0c8fb7a..6308252 100644 --- a/lib/widgets/mobile/mobile_store_product_search.dart +++ b/lib/widgets/mobile/mobile_store_product_search.dart @@ -16,7 +16,7 @@ import '../../utils/utils.dart'; import '../../widgets/mobile/mobile_product_item.dart'; class MobileStoreProductSearch extends StatefulWidget { - final Key key; + final Key? key; final Business business; const MobileStoreProductSearch(this.business, {this.key}); diff --git a/lib/widgets/mobile/mobile_user_profile.dart b/lib/widgets/mobile/mobile_user_profile.dart index 433be3d..1f0a26d 100644 --- a/lib/widgets/mobile/mobile_user_profile.dart +++ b/lib/widgets/mobile/mobile_user_profile.dart @@ -15,7 +15,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar import '../../utils/utils.dart'; class MobileUserProfile extends StatefulWidget { - final Key key; + final Key? key; const MobileUserProfile({this.key}) : super(key: key); diff --git a/lib/widgets/mobile/mobile_view_blog.dart b/lib/widgets/mobile/mobile_view_blog.dart index da13d64..ba1f488 100644 --- a/lib/widgets/mobile/mobile_view_blog.dart +++ b/lib/widgets/mobile/mobile_view_blog.dart @@ -16,7 +16,7 @@ import '../../utils/utils.dart'; import '../../utils/util_io.dart' if (dart.library.html) '../../utils/util_web.dart'; class MobileViewBlog extends StatefulWidget { - final Key key; + final Key? key; final int bid; const MobileViewBlog(this.bid, {this.key}) : super(key: key); diff --git a/lib/widgets/mobile/mobile_view_ticket.dart b/lib/widgets/mobile/mobile_view_ticket.dart index a215928..a98a319 100644 --- a/lib/widgets/mobile/mobile_view_ticket.dart +++ b/lib/widgets/mobile/mobile_view_ticket.dart @@ -20,7 +20,7 @@ import '../../utils/utils.dart'; import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart'; class MobileViewTicket extends StatefulWidget { - final Key key; + final Key? key; final int ticketId; const MobileViewTicket(this.ticketId, {this.key}) : super(key: key); diff --git a/lib/widgets/mobile/product_item.dart b/lib/widgets/mobile/product_item.dart index fb4e588..4cd9812 100644 --- a/lib/widgets/mobile/product_item.dart +++ b/lib/widgets/mobile/product_item.dart @@ -19,7 +19,7 @@ class ProductItem extends StatefulWidget { final double imageWidth; const ProductItem(this.product, this.business, { - Key key, + Key? key, this.horizontal = false, this.imageWidth = 110, }) : super(key: key); diff --git a/lib/widgets/mobile/product_search.dart b/lib/widgets/mobile/product_search.dart index a0f911f..6c1ee37 100644 --- a/lib/widgets/mobile/product_search.dart +++ b/lib/widgets/mobile/product_search.dart @@ -18,7 +18,7 @@ import 'product_item.dart'; class ProductSearch extends StatefulWidget { final Business business; - const ProductSearch(this.business, {Key key}) : super(key: key); + const ProductSearch(this.business, {Key? key}) : super(key: key); @override State createState() => ProductSearchState(); diff --git a/lib/widgets/mobile/shop.dart b/lib/widgets/mobile/shop.dart index 9e710ac..34eb82d 100644 --- a/lib/widgets/mobile/shop.dart +++ b/lib/widgets/mobile/shop.dart @@ -45,7 +45,7 @@ double screenHeight; class Shop extends StatefulWidget { final int businessId; - const Shop({Key key, this.businessId}) : super(key: key); + const Shop({Key? key, this.businessId}) : super(key: key); @override State createState() => ShopState();