glass_one_nav_bar 1.0.0
glass_one_nav_bar: ^1.0.0 copied to clipboard
A customizable floating bottom navigation bar for Flutter with glassmorphism effects, elastic animations, and built-in accessibility.
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'core/di/setup_locator.dart';
import 'core/router/app_router.dart';
import 'core/theme/app_theme.dart';
import 'presentation/cubits/app/app_cubit.dart';
import 'presentation/cubits/app/app_state.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
setupLocator();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
late Future<void> _initializationFuture;
@override
void initState() {
super.initState();
_initializationFuture = locator.allReady();
}
@override
Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>(
value: const SystemUiOverlayStyle(
systemNavigationBarColor: Colors.transparent,
systemNavigationBarContrastEnforced: false,
systemNavigationBarIconBrightness: Brightness.light,
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.light,
),
child: FutureBuilder(
future: _initializationFuture,
builder: (context, snapshot) {
if (snapshot.connectionState != ConnectionState.done) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(child: CircularProgressIndicator()),
),
);
}
return BlocProvider.value(
value: locator<AppCubit>(),
child: BlocBuilder<AppCubit, AppState>(
builder: (context, state) {
return MaterialApp.router(
debugShowCheckedModeBanner: false,
title: 'GlassOneNavBar Demo',
themeMode: state.themeMode,
theme: AppTheme.lightTheme,
darkTheme: AppTheme.darkTheme,
routerConfig: AppRouter.router,
);
},
),
);
},
),
);
}
}