Skip to content
Snippets Groups Projects
Select Git revision
  • 8c90c184ef04d018b01cc21163e1103854268b97
  • master default protected
  • 33-improve-clean-data-model
  • 34-allow-more-seeds-in-holes
  • 12-improve-ai
  • 14-improve-app-metadata
  • Release_0.8.2_27 protected
  • Release_0.8.1_26 protected
  • Release_0.8.0_25 protected
  • Release_0.7.2_24 protected
  • Release_0.7.1_23 protected
  • Release_0.7.0_22 protected
  • Release_0.6.0_21 protected
  • Release_0.5.0_20 protected
  • Release_0.4.0_19 protected
  • Release_0.3.2_18 protected
  • Release_0.3.1_17 protected
  • Release_0.3.0_16 protected
  • Release_0.2.1_15 protected
  • Release_0.2.0_14 protected
  • Release_0.1.1_13 protected
  • Release_0.1.0_12 protected
  • Release_0.0.11_11 protected
  • Release_0.0.10_10 protected
  • Release_0.0.9_9 protected
  • Release_0.0.8_8 protected
26 results

theme_state.dart

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),
                ),
              ],
            );
          }),
        );
      }
    }