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

@@ -10,11 +10,12 @@ import '../../widgets/general/navigationbar_logo.dart';
import '../../routes.dart';
class MobileNavigationBar extends StatefulWidget {
final String title;
final bool back;
final bool toHome;
final bool showMe;
const MobileNavigationBar({Key key, this.title, this.back, this.toHome, this.showMe}) : super(key: key);
final String? title;
final bool? back;
final bool? toHome;
final bool? showMe;
const MobileNavigationBar({Key? key, this.title, this.back, this.toHome, this.showMe}) : super(key: key);
@override
State<StatefulWidget> createState() {
@@ -24,19 +25,19 @@ class MobileNavigationBar extends StatefulWidget {
}
class MobileNavigationBarState extends State<MobileNavigationBar> {
User _user;
User? _user;
@override
Widget build(BuildContext context) {
return AppBar(
leading: widget.back ?
leading: widget.back == true ?
IconButton(
icon: Icon(
Icons.arrow_back_ios,
color: Colors.white,
),
onPressed: () {
if (widget.toHome) {
if (widget.toHome == true) {
Routes.router.navigateTo(context, '/', clearStack: true);
} else {
Routes.router.pop(context);
@@ -53,7 +54,7 @@ class MobileNavigationBarState extends State<MobileNavigationBar> {
},
),
title: Container(
child: widget.title.isNotEmpty ?
child: widget.title?.isNotEmpty == true ?
Container(
child: Text(
'${widget.title}',