iOS Development

When launching functions on iOS, the appliance interface has shrunk

There isn’t any such downside on Android, I take advantage of auto_route for navigation, respectively, indents and related widgets usually are not used anyplace larger up the widget tree, for the underside panel of AutoTabsRouter, what might be the explanation?

enter picture description right here

Beneath is the principle block of code the place AutoTabsRouter is used:

Widget construct(BuildContext context) {
    return AutoTabsRouter(
      routes: const [
        HomeRoute(),
        BranchesRoute(),
        QrCodeRoute(),
        NewsRoute(),
        ProfileRoute(),
      ],
      builder: (context, youngster) {
        closing tabsRouter = AutoTabsRouter.of(context);
        return Scaffold(
          physique: youngster,
          bottomNavigationBar: Stack(
            alignment: Alignment.heart,
            youngsters: [
              BottomNavigationBar(
                currentIndex: tabsRouter.activeIndex,
                onTap: (index) => _openPage(context, index, tabsRouter),
                items: [
                  BottomNavigationBarItem(
                    label: LocaleKeys.main.tr(),
                    icon: const ImageIcon(
                      AssetImage(IconHelper.iconJiraffe),
                    ),
                  ),
                  BottomNavigationBarItem(
                    label: LocaleKeys.branches.tr(),
                    icon: const ImageIcon(
                      AssetImage(IconHelper.branches),
                    ),
                  ),
                  const BottomNavigationBarItem(
                    icon: SizedBox.shrink(),
                    label: '',
                  ),
                  BottomNavigationBarItem(
                    label: LocaleKeys.news.tr(),
                    icon: const ImageIcon(
                      AssetImage(IconHelper.news),
                    ),
                  ),
                  BottomNavigationBarItem(
                    label: LocaleKeys.profile.tr(),
                    icon: const ImageIcon(
                      AssetImage(IconHelper.user),
                    ),
                  ),
                ],
              ),
              Padding(
                padding: EdgeInsets.solely(
                  backside: MediaQuery.maybePaddingOf(context)?.backside ?? 0,
                ),
                youngster: ElevatedButton(
                  model: ElevatedButton.styleFrom(
                    backgroundColor: ThemeHelper.gray13,
                    form: RoundedRectangleBorder(
                      borderRadius: BorderRadius.round(10),
                    ),
                    padding: const EdgeInsets.symmetric(
                      vertical: 6,
                      horizontal: 14,
                    ),
                  ),
                  youngster: SvgPicture.asset(IconHelper.viewfinder),
                  onPressed: () => _showModalBottomSheet(context),
                ),
              ),
            ],
          ),
        );
      },
    );

Beneath is the code of the information display screen itself, constructed on the Scaffold widget:

Widget construct(BuildContext context) {
    return AutoTabsRouter(
      routes: const [
        HomeRoute(),
        BranchesRoute(),
        QrCodeRoute(),
        NewsRoute(),
        ProfileRoute(),
      ],
      builder: (context, youngster) {
        closing tabsRouter = AutoTabsRouter.of(context);
        return Scaffold(
          physique: youngster,
          bottomNavigationBar: Stack(
            alignment: Alignment.heart,
            youngsters: [
              BottomNavigationBar(
                currentIndex: tabsRouter.activeIndex,
                onTap: (index) => _openPage(context, index, tabsRouter),
                items: [
                  BottomNavigationBarItem(
                    label: LocaleKeys.main.tr(),
                    icon: const ImageIcon(
                      AssetImage(IconHelper.iconJiraffe),
                    ),
                  ),
                  BottomNavigationBarItem(
                    label: LocaleKeys.branches.tr(),
                    icon: const ImageIcon(
                      AssetImage(IconHelper.branches),
                    ),
                  ),
                  const BottomNavigationBarItem(
                    icon: SizedBox.shrink(),
                    label: '',
                  ),
                  BottomNavigationBarItem(
                    label: LocaleKeys.news.tr(),
                    icon: const ImageIcon(
                      AssetImage(IconHelper.news),
                    ),
                  ),
                  BottomNavigationBarItem(
                    label: LocaleKeys.profile.tr(),
                    icon: const ImageIcon(
                      AssetImage(IconHelper.user),
                    ),
                  ),
                ],
              ),
              Padding(
                padding: EdgeInsets.solely(
                  backside: MediaQuery.maybePaddingOf(context)?.backside ?? 0,
                ),
                youngster: ElevatedButton(
                  model: ElevatedButton.styleFrom(
                    backgroundColor: ThemeHelper.gray13,
                    form: RoundedRectangleBorder(
                      borderRadius: BorderRadius.round(10),
                    ),
                    padding: const EdgeInsets.symmetric(
                      vertical: 6,
                      horizontal: 14,
                    ),
                  ),
                  youngster: SvgPicture.asset(IconHelper.viewfinder),
                  onPressed: () => _showModalBottomSheet(context),
                ),
              ),
            ],
          ),
        );
      },
    );

The post When launching functions on iOS, the appliance interface has shrunk appeared first on Ismmailgsm.

Credit: www.ismmailgsm.com

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button