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:
@@ -7,7 +7,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar
|
||||
class DesktopIndexCarousel extends StatefulWidget {
|
||||
final List<Gallery> galleries;
|
||||
|
||||
const DesktopIndexCarousel(this.galleries, {Key key}) : super(key: key);
|
||||
const DesktopIndexCarousel(this.galleries, {Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
@@ -53,8 +53,8 @@ class DesktopIndexCarouselState extends State<DesktopIndexCarousel> {
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
if (i.linkUrl != null && i.linkUrl.isNotEmpty) {
|
||||
Util.openWebUrl(context, i.linkUrl);
|
||||
if (i.linkUrl?.isNotEmpty == true) {
|
||||
Util.openWebUrl(context, i.linkUrl!);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
@@ -12,12 +12,12 @@ import '../../widgets/general/navigationbar_logo.dart';
|
||||
import '../../widgets/general/text_link.dart';
|
||||
|
||||
class DesktopAppBarMenu extends StatelessWidget {
|
||||
User _user;
|
||||
User? _user;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_user = store.state.user;
|
||||
String currentRoute = ModalRoute.of(context).settings.name;
|
||||
String currentRoute = ModalRoute.of(context)?.settings.name ?? '';
|
||||
Widget menuBar = Container(
|
||||
height: 56.0,
|
||||
padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
|
||||
|
||||
@@ -10,7 +10,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar
|
||||
|
||||
class CustomersLogo extends StatefulWidget {
|
||||
|
||||
const CustomersLogo({Key key}) : super(key: key);
|
||||
const CustomersLogo({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => CustomersLogoState();
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:flutter_wisetronic/generated/l10n.dart';
|
||||
|
||||
class DesktopIndexMainContent1 extends StatefulWidget {
|
||||
final String message;
|
||||
const DesktopIndexMainContent1(this.message, {Key key}) : super(key: key);
|
||||
const DesktopIndexMainContent1(this.message, {Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dar
|
||||
|
||||
class DesktopIndexMainContent2 extends StatefulWidget {
|
||||
final Map<String, dynamic> content;
|
||||
const DesktopIndexMainContent2(this.content, {Key key}) : super(key: key);
|
||||
const DesktopIndexMainContent2(this.content, {Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
|
||||
@@ -7,7 +7,7 @@ import '../../constants.dart';
|
||||
|
||||
class DesktopIndexMainContent3 extends StatefulWidget {
|
||||
final Map<String, dynamic> content;
|
||||
const DesktopIndexMainContent3(this.content, {Key key}) : super(key: key);
|
||||
const DesktopIndexMainContent3(this.content, {Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
|
||||
@@ -14,12 +14,12 @@ import '../../widgets/general/breadcrumbs.dart';
|
||||
import '../../widgets/general/navigationbar.dart';
|
||||
|
||||
class DesktopNavigationBar extends StatefulWidget {
|
||||
final bool hasBack;
|
||||
final List<BreadCrumb> breadCrumbs;
|
||||
final Widget shoppingCart;
|
||||
final OnBackPress onBackPress;
|
||||
final bool? hasBack;
|
||||
final List<BreadCrumb>? breadCrumbs;
|
||||
final Widget? shoppingCart;
|
||||
final OnBackPress? onBackPress;
|
||||
|
||||
const DesktopNavigationBar({Key key, this.hasBack, this.breadCrumbs,
|
||||
const DesktopNavigationBar({Key? key, this.hasBack, this.breadCrumbs,
|
||||
this.shoppingCart, this.onBackPress}) : super(key: key);
|
||||
|
||||
@override
|
||||
@@ -30,16 +30,16 @@ class DesktopNavigationBar extends StatefulWidget {
|
||||
}
|
||||
|
||||
class DesktopNavigationBarState extends State<DesktopNavigationBar> {
|
||||
User _user;
|
||||
User? _user;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget sc = SizedBox.shrink();
|
||||
if (widget.shoppingCart != null) {
|
||||
sc = widget.shoppingCart;
|
||||
sc = widget.shoppingCart!;
|
||||
}
|
||||
Widget breadCrumbBar = SizedBox.shrink();
|
||||
if (widget.breadCrumbs != null && widget.breadCrumbs.length > 0) {
|
||||
if (widget.breadCrumbs != null && widget.breadCrumbs!.length > 0) {
|
||||
breadCrumbBar = Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: Constants.BREADCRUMB_HEIGHT,
|
||||
|
||||
Reference in New Issue
Block a user