buildScaffoldForWeb method

Scaffold buildScaffoldForWeb({
  1. required String platform,
  2. bool? isFloating = true,
})

Implementation

Scaffold buildScaffoldForWeb(
    {required String platform, bool? isFloating = true}) {
  NavigationRail navigationRail = NavigationRail(
    selectedIndex: _selectedIndex,
    onDestinationSelected: (int index) {
      _onItemTap(index);
      setState(() => _selectedIndex = index);
    },
    backgroundColor: widget.backgroundColor ?? Colors.white,
    leading: widget.leading,
    extended: isExtended,
    selectedLabelTextStyle: TextStyle(
        color: widget.activeColor ?? Theme.of(context).primaryColor),
    selectedIconTheme: IconThemeData(
        color: widget.activeColor ?? Theme.of(context).primaryColor),
    unselectedLabelTextStyle: TextStyle(
      color: widget.inactiveColor ?? Colors.black,
    ),
    unselectedIconTheme: IconThemeData(
      color: widget.inactiveColor ?? Colors.black,
    ),
    useIndicator: widget.useIndicator ?? false,
    indicatorColor: widget.indicatorColor ??
        Theme.of(context).primaryColor.withOpacity(0.2),
    minExtendedWidth:
        widget.minExtendedWidth ?? MediaQuery.of(context).size.width * 0.14,
    labelType: NavigationRailLabelType.none,
    destinations: getNavigationRailDestinationListWithBadge(),
  );

  Nautics nautics = Nautics(
    onChange: (index) {
      _onItemTap(index);
      setState(() => _selectedIndex = index);
    },
    nauticsColor: widget.backgroundColor,
    selectedColor: widget.activeColor,
    unSelectedColor: widget.inactiveColor,
    initialIndex: _selectedIndex,
    children: widget.children,
    isFloating: widget.isFloating,
    footer: widget.nauticsFooter,
    header: widget.leading,
  );

  return Scaffold(
    appBar: widget.parentAppbar,
    body: Row(
      children: [
        widget.useNautics == true
            ? nautics
            : isFloating == true
                ? GestureDetector(
                    onTap: () => setState(() => isExtended = !isExtended),
                    child: Container(
                      margin: const EdgeInsets.all(10),
                      child: Material(
                        elevation: 10,
                        borderRadius: BorderRadius.circular(10),
                        child: ClipRRect(
                            borderRadius: BorderRadius.circular(10),
                            child: navigationRail),
                      ),
                    ),
                  )
                : GestureDetector(
                    onTap: () => setState(() => isExtended = !isExtended),
                    child: navigationRail),
        Expanded(
          child: PageView(
            physics: const NeverScrollableScrollPhysics(),
            scrollDirection: Axis.vertical,
            onPageChanged: (index) => setState(() => _selectedIndex = index),
            controller: floatingTabBarPageViewController,
            children: getTabScreenList(),
          ),
        ),
      ],
    ),
  );
}