fix(runtime): 37 late fields with == null checks were wrongly migrated -> nullable. Fixes LateInitializationError crashes on page navigation (shop/checkout/comment/data pages)

This commit is contained in:
2026-08-01 01:58:36 +08:00
parent b49fb59db4
commit 0526baa3c8
32 changed files with 317 additions and 317 deletions

View File

@@ -30,7 +30,7 @@ class BuyService extends StatefulWidget {
}
class BuyServiceState extends State<BuyService> {
late Map<String, dynamic> data;
Map<String, dynamic>? data;
@override
Widget build(BuildContext context) {
@@ -51,9 +51,9 @@ class BuyServiceState extends State<BuyService> {
return ResponsiveBuilder(
builder: (context, sizingInformation) =>
ScreenTypeLayout(
mobile: MobileBuyService(data),
tablet: DesktopBuyService(data),
desktop: DesktopBuyService(data),
mobile: MobileBuyService(data!),
tablet: DesktopBuyService(data!),
desktop: DesktopBuyService(data!),
),
);
}
@@ -73,7 +73,7 @@ class BuyServiceState extends State<BuyService> {
}
).then((value) {
data = value;
data['domain'] = widget.domain;
data!['domain'] = widget.domain;
print('data: $data');
setState(() {});
}).onError((error, stackTrace) {

View File

@@ -22,7 +22,7 @@ class ContactUs extends StatefulWidget {
}
class ContactUsState extends State<ContactUs> {
late Business business;
Business? business;
@override
Widget build(BuildContext context) {
@@ -43,9 +43,9 @@ class ContactUsState extends State<ContactUs> {
return ResponsiveBuilder(
builder: (context, sizingInformation) =>
ScreenTypeLayout(
mobile: MobileContactUs(business),
tablet: DesktopContactUs(business),
desktop: DesktopContactUs(business),
mobile: MobileContactUs(business!),
tablet: DesktopContactUs(business!),
desktop: DesktopContactUs(business!),
),
);
}

View File

@@ -30,7 +30,7 @@ class Download extends StatefulWidget {
class DownloadState extends State<Download> {
final _scaffoldKey = GlobalKey<ScaffoldState>();
late Map<String, dynamic> data;
Map<String, dynamic>? data;
@override
Widget build(BuildContext context) {
@@ -58,11 +58,11 @@ class DownloadState extends State<Download> {
),
drawer: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? MobileNavigationDrawer() : null,
body: ScreenTypeLayout(
mobile: MobileDownloadApps(data),
tablet: DesktopDownloadApps(data),
mobile: MobileDownloadApps(data!),
tablet: DesktopDownloadApps(data!),
desktop: Scrollbar(
thumbVisibility: true,
child: DesktopDownloadApps(data),
child: DesktopDownloadApps(data!),
),
),
bottomNavigationBar: ScreenTypeLayout(

View File

@@ -26,7 +26,7 @@ class IGoShowLearnMore extends StatefulWidget {
class IGoShowLearnMoreState extends State<IGoShowLearnMore> {
final _scaffoldKey = GlobalKey<ScaffoldState>();
late Map<String, dynamic> data;
Map<String, dynamic>? data;
@override
Widget build(BuildContext context) {
@@ -56,9 +56,9 @@ class IGoShowLearnMoreState extends State<IGoShowLearnMore> {
),
drawer: null,
body: ScreenTypeLayout(
mobile: MobileiGoShowLearnMore(data),
tablet: DesktopiGoShowLearnMore(data),
desktop: DesktopiGoShowLearnMore(data),
mobile: MobileiGoShowLearnMore(data!),
tablet: DesktopiGoShowLearnMore(data!),
desktop: DesktopiGoShowLearnMore(data!),
),
bottomNavigationBar: ScreenTypeLayout(
mobile: MobileBottomNav(currentIndex: 0,),

View File

@@ -26,7 +26,7 @@ class MiniPosLearnMore extends StatefulWidget {
class MiniPosLearnMoreState extends State<MiniPosLearnMore> {
final _scaffoldKey = GlobalKey<ScaffoldState>();
late Map<String, dynamic> data;
Map<String, dynamic>? data;
@override
Widget build(BuildContext context) {
@@ -57,9 +57,9 @@ class MiniPosLearnMoreState extends State<MiniPosLearnMore> {
),
drawer: null,
body: ScreenTypeLayout(
mobile: MobileMiniPosLearnMore(data),
tablet: DesktopMiniPosLearnMore(data),
desktop: DesktopMiniPosLearnMore(data),
mobile: MobileMiniPosLearnMore(data!),
tablet: DesktopMiniPosLearnMore(data!),
desktop: DesktopMiniPosLearnMore(data!),
),
bottomNavigationBar: ScreenTypeLayout(
mobile: MobileBottomNav(currentIndex: 0,),

View File

@@ -23,7 +23,7 @@ class PlainPage extends StatefulWidget {
}
class PlainPageState extends State<PlainPage> {
late Blog blog;
Blog? blog;
@override
Widget build(BuildContext context) {
@@ -44,9 +44,9 @@ class PlainPageState extends State<PlainPage> {
return ResponsiveBuilder(
builder: (context, sizingInformation) =>
ScreenTypeLayout(
mobile: MobilePlainPage(blog),
tablet: DesktopPlainPage(blog),
desktop: DesktopPlainPage(blog),
mobile: MobilePlainPage(blog!),
tablet: DesktopPlainPage(blog!),
desktop: DesktopPlainPage(blog!),
),
);
}

View File

@@ -25,7 +25,7 @@ class RenewMiniOffice extends StatefulWidget {
}
class RenewMiniOfficeState extends State<RenewMiniOffice> {
late Map<String, dynamic> data;
Map<String, dynamic>? data;
@override
Widget build(BuildContext context) {
@@ -46,9 +46,9 @@ class RenewMiniOfficeState extends State<RenewMiniOffice> {
return ResponsiveBuilder(
builder: (context, sizingInformation) =>
ScreenTypeLayout(
mobile: MobileRenewMiniOffice(data),
tablet: DesktopRenewMiniOffice(data),
desktop: DesktopRenewMiniOffice(data),
mobile: MobileRenewMiniOffice(data!),
tablet: DesktopRenewMiniOffice(data!),
desktop: DesktopRenewMiniOffice(data!),
),
);
}