phase3: util_web + shop_scroll (custom scroll) null-safe; global Key? param fix

This commit is contained in:
2026-07-24 20:24:57 +08:00
parent f831fd1405
commit e2f815e141
133 changed files with 164 additions and 163 deletions

View File

@@ -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}) :

View File

@@ -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) {

View File

@@ -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}) :

View File

@@ -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

View File

@@ -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) {

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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

View File

@@ -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}) :

View File

@@ -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) {

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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);

View File

@@ -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);

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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}) :

View File

@@ -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}) :

View File

@@ -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);

View File

@@ -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);

View File

@@ -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}) :

View File

@@ -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) {

View File

@@ -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

View File

@@ -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);

View File

@@ -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

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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

View File

@@ -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

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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<StatefulWidget> createState() => ShopState();

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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);

View File

@@ -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),

View File

@@ -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<void> 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<Future<void>> animations = List<Future<void>>(_positions.length);
final List<Future<void>> animations = List<Future<void>>.filled(_positions.length, Future<void>.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<String> 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)}, ');

View File

@@ -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(

View File

@@ -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<void> animateTo(
double to, {
@required Duration duration,
@required Curve curve,
required Duration duration,
required Curve curve,
}) {
if (nearEqual(to, pixels, physics.tolerance.distance)) {
// 跳过动画,直接移到我们已经靠近的位置。

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -15,7 +15,7 @@ import '../../widgets/general/navigationbar.dart';
class DesktopBuyService extends StatefulWidget {
final Map<String, dynamic> data;
const DesktopBuyService(this.data, {Key key})
const DesktopBuyService(this.data, {Key? key})
: super(key: key);
@override

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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);

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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

View File

@@ -9,7 +9,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar
class DesktopDownloadApps extends StatefulWidget {
final Map<String, dynamic> data;
DesktopDownloadApps(this.data, {Key key}) : super(key: key);
DesktopDownloadApps(this.data, {Key? key}) : super(key: key);
@override
State<StatefulWidget> createState() {

View File

@@ -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}) :

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -8,7 +8,7 @@ import '../../widgets/general/breadcrumbs.dart';
class DesktopiGoShowLearnMore extends StatefulWidget {
final Map<String, dynamic> data;
const DesktopiGoShowLearnMore(this.data, {Key key}) : super(key: key);
const DesktopiGoShowLearnMore(this.data, {Key? key}) : super(key: key);
@override
State<StatefulWidget> createState() {

View File

@@ -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);

View File

@@ -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);

View File

@@ -7,7 +7,7 @@ import '../../widgets/general/breadcrumbs.dart';
class DesktopMiniPosLearnMore extends StatefulWidget {
final Map<String, dynamic> data;
const DesktopMiniPosLearnMore(this.data, {Key key}) : super(key: key);
const DesktopMiniPosLearnMore(this.data, {Key? key}) : super(key: key);
@override
State<StatefulWidget> createState() {

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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);

View File

@@ -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});

View File

@@ -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}) :

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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});

View File

@@ -22,7 +22,7 @@ import '../../widgets/general/navigationbar.dart';
class DesktopOrders extends StatefulWidget {
final Key key;
final Key? key;
const DesktopOrders({this.key});
@override

View File

@@ -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});

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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

View File

@@ -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

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -17,7 +17,7 @@ import '../../widgets/general/navigationbar.dart';
class DesktopRenewMiniOffice extends StatefulWidget {
final Map<String, dynamic> data;
const DesktopRenewMiniOffice(this.data, {Key key}) : super(key: key);
const DesktopRenewMiniOffice(this.data, {Key? key}) : super(key: key);
@override
State<StatefulWidget> createState() {

View File

@@ -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

View File

@@ -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);

View File

@@ -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

View File

@@ -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});

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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<StatefulWidget> createState() => ProductItemState();

View File

@@ -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<StatefulWidget> createState() => ProductSearchState();

View File

@@ -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<StatefulWidget> createState() => ShopState();

View File

@@ -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<StatefulWidget> createState() => ShopBulletinState();

View File

@@ -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<StatefulWidget> createState() => ShopProductsState();

View File

@@ -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<StatefulWidget> createState() => ShopPromoteState();

View File

@@ -102,7 +102,7 @@ class CarouselState extends State<Carousel> {
}
class Indicator extends StatefulWidget {
Indicator({Key key, int count})
Indicator({Key? key, int count})
: count = count,
super(key: key);

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -1,3 +1,4 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
/// 自定义实现,替代已停维的 `hovering` 包的 [HoverWidget]。

View File

@@ -7,7 +7,7 @@ import 'package:responsive_builder/responsive_builder.dart';
class IndexCarousel extends StatelessWidget {
final List<Gallery> galleries;
const IndexCarousel(this.galleries, {Key key}) : super(key: key);
const IndexCarousel(this.galleries, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {

View File

@@ -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) {

View File

@@ -6,7 +6,7 @@ import 'package:responsive_builder/responsive_builder.dart';
class IndexMainContent2 extends StatelessWidget {
final Map<String, dynamic> content;
const IndexMainContent2(this.content, {Key key}) : super(key: key);
const IndexMainContent2(this.content, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {

View File

@@ -6,7 +6,7 @@ import 'package:responsive_builder/responsive_builder.dart';
class IndexMainContent3 extends StatelessWidget {
final Map<String, dynamic> content;
const IndexMainContent3(this.content, {Key key}) : super(key: key);
const IndexMainContent3(this.content, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {

View File

@@ -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,

View File

@@ -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;

View File

@@ -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,

View File

@@ -164,7 +164,7 @@ class SlidingUpPanel extends StatefulWidget {
final PanelState defaultPanelState;
SlidingUpPanel({
Key key,
Key? key,
this.panel,
this.panelBuilder,
this.body,

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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})

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -11,7 +11,7 @@ import '../../utils/utils.dart';
class MobileBuyService extends StatefulWidget {
final Map<String, dynamic> data;
const MobileBuyService(this.data, {Key key})
const MobileBuyService(this.data, {Key? key})
: super(key: key);
@override

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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<StatefulWidget> createState() {

View File

@@ -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);

Some files were not shown because too many files have changed in this diff Show More