navigation_rail_flutter 0.0.1
navigation_rail_flutter: ^0.0.1 copied to clipboard
NavigationRail in Flutter provides a responsive, side navigation bar for large screens, enhancing usability and adaptive UI design.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:navigation_rail_flutter/navigation_rail_flutter.dart';
const logo="assets/photoshop.png";
const profile="assets/profile.png";
const signOut="assets/sign_out.png";
const activeHouse="assets/active_house.png";
const activeList="assets/active_list.png";
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const NavigationRailExpample(),
);
}
}
class NavigationRailExpample extends StatefulWidget {
const NavigationRailExpample({super.key});
@override
State<NavigationRailExpample> createState() => _NavigationRailExpampleState();
}
class _NavigationRailExpampleState extends State<NavigationRailExpample> {
static const logo="assets/photoshop.png";
final List<String> label = <String>['Home', 'List'];
final List<String> bottomLabel = <String>['Profile', 'Logout'];
final List<String> bottomIcons = <String>[profile, logo];
final List<String> icons = <String>[activeHouse, activeList];
final List<Widget> pages = [
const Center(child: Text('Home', style: TextStyle(fontSize: 20))),
const Center(child: Text('List', style: TextStyle(fontSize: 20))),
];
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
backgroundColor: Colors.white,
body: NavigationFlutter(
railItemCount: label.length,
bottomItemCount: bottomLabel.length,
railIcons: icons,
pages: pages,
logo: logo,
navigationRailColor: Colors.grey.shade300,
railLabel: label,
bottomIcons: bottomIcons,
activeColor: Colors.orange,
inActiveColor: Colors.lightBlue.shade300),
),
);
}
}