phase3(critical-path): home page chain null-safe

home.dart + desktop/mobile navigation, carousels, index content widgets,
customers_logo, appbar_menu, navigation_drawer, MobileBottomNav, double_back.
Fixes: Key? params, nullable State fields, Scrollbar thumbVisibility,
ModalRoute.of()?, badges hide Badge, cartInfos local promotion.
This commit is contained in:
2026-07-24 13:42:03 +08:00
parent ae4c4046c3
commit 88dd90ed7c
16 changed files with 60 additions and 58 deletions

View File

@@ -1,6 +1,6 @@
import 'package:badges/badges.dart';
import 'package:flutter/material.dart';
import 'package:flutter/material.dart' hide Badge;
import '../../constants.dart';
import '../../generated/l10n.dart';
import '../../routes.dart';
@@ -15,10 +15,11 @@ class MobileBottomNav extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (store.state.cartInfos != null && store.state.cartInfos.length > 0) {
final cartInfos = store.state.cartInfos;
if (cartInfos != null && cartInfos.length > 0) {
count = 0;
for (var i = 0; i < store.state.cartInfos.length; i++) {
if (store.state.cartInfos[i].productList != null && store.state.cartInfos[i].productList.length > 0) {
for (var i = 0; i < cartInfos.length; i++) {
if (cartInfos[i].productList != null && cartInfos[i].productList!.length > 0) {
count += 1;
}
}