Skip to content
Snippets Groups Projects
Select Git revision
  • 865bc2cc952ce000fd7af810ab0b1c34d461dce0
  • master default protected
  • 27-improve-app-metadata
  • 6-fix-display-grid
  • Release_1.9.2_40 protected
  • Release_1.9.1_39 protected
  • Release_1.9.0_38 protected
  • Release_1.8.2_37 protected
  • Release_1.8.1_36 protected
  • Release_1.8.0_35 protected
  • Release_1.7.0_34 protected
  • Release_1.6.0_33 protected
  • Release_1.5.0_32 protected
  • Release_1.4.3_31 protected
  • Release_1.4.2_30 protected
  • Release_1.4.1_29 protected
  • Release_1.4.0_28 protected
  • Release_1.3.1_27 protected
  • Release_1.3.0_26 protected
  • Release_1.2.1_25 protected
  • Release_1.2.0_24 protected
  • Release_1.1.0_23 protected
  • Release_1.0.21_22 protected
  • Release_1.0.20_21 protected
24 results

Info.plist

Blame
  • bottom_nav_bar.dart 1.68 KiB
    import 'package:easy_localization/easy_localization.dart';
    import 'package:flutter/material.dart';
    import 'package:flutter_bloc/flutter_bloc.dart';
    
    import 'package:twister/cubit/bottom_nav_cubit.dart';
    import 'package:twister/ui/screens/settings.dart';
    import 'package:twister/ui/screens/home.dart';
    
    class BottomNavBar extends StatelessWidget {
      const BottomNavBar({super.key});
    
      @override
      Widget build(BuildContext context) {
        return Card(
          margin: const EdgeInsets.only(top: 1, right: 4, left: 4),
          elevation: 4,
          shadowColor: Theme.of(context).colorScheme.shadow,
          color: Theme.of(context).colorScheme.surfaceVariant,
          shape: const RoundedRectangleBorder(
            borderRadius: BorderRadius.only(
              topLeft: Radius.circular(16),
              topRight: Radius.circular(16),
            ),
          ),
          child: BlocBuilder<BottomNavCubit, int>(builder: (BuildContext context, int state) {
            return BottomNavigationBar(
              currentIndex: state,
              onTap: (int index) => context.read<BottomNavCubit>().updateIndex(index),
              type: BottomNavigationBarType.fixed,
              elevation: 0,
              backgroundColor: Colors.transparent,
              selectedItemColor: Theme.of(context).colorScheme.primary,
              unselectedItemColor: Theme.of(context).textTheme.bodySmall!.color,
              items: <BottomNavigationBarItem>[
                BottomNavigationBarItem(
                  icon: ScreenHome.navBarIcon,
                  label: tr(ScreenHome.navBarText),
                ),
                BottomNavigationBarItem(
                  icon: ScreenSettings.navBarIcon,
                  label: tr(ScreenSettings.navBarText),
                ),
              ],
            );
          }),
        );
      }
    }