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

@@ -28,7 +28,7 @@ class MobileViewBlog extends StatefulWidget {
}
class MobileViewBlogState extends State<MobileViewBlog> {
late Blog blog;
Blog? blog;
@override
void initState() {
@@ -85,7 +85,7 @@ class MobileViewBlogState extends State<MobileViewBlog> {
children: [
Expanded(
child: Text(
'${blog.title}',
'${blog!.title}',
style: TextStyle(
fontSize: 24.0,
color: Colors.black
@@ -93,7 +93,7 @@ class MobileViewBlogState extends State<MobileViewBlog> {
),
),
Text(
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt!),
Utils.utcDatetimeStringToLocalDatetimeString(context, blog!.createdAt!),
style: TextStyle(
fontSize: 14.0,
color: Colors.black38,
@@ -106,7 +106,7 @@ class MobileViewBlogState extends State<MobileViewBlog> {
width: double.maxFinite,
padding: EdgeInsets.only(top: 8.0, left: 16.0, right: 16.0, bottom: 24.0),
child: Text(
'${blog.body}',
'${blog!.body}',
style: TextStyle(
color: Colors.black87,
fontSize: 17.0,
@@ -124,11 +124,11 @@ class MobileViewBlogState extends State<MobileViewBlog> {
Container(
width: double.maxFinite,
padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
child: (blog.imageUrl != null) ?
child: (blog!.imageUrl != null) ?
Container(
width: min(MediaQuery.of(context).size.width, MediaQuery.of(context).size.height) - 100.0,
height: min(MediaQuery.of(context).size.width, MediaQuery.of(context).size.height) - 100.0,
child: Util.showImage('https:${blog.imageUrl}'),
child: Util.showImage('https:${blog!.imageUrl}'),
) : SizedBox.shrink(),
decoration: BoxDecoration(
border: Border(