smart_nav_rail 0.0.3 copy "smart_nav_rail: ^0.0.3" to clipboard
smart_nav_rail: ^0.0.3 copied to clipboard

A customizable Navigation Rail for Flutter apps with enhanced features and easy implementation.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:smart_nav_rail/smart_nav_rail.dart';  // <-- YOUR PACKAGE IMPORT

void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  int _currentIndex = 0;  // <-- STATE VARIABLE FOR CURRENT INDEX

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Row(
          children: [
            // YOUR SMART NAV RAIL WIDGET
            SmartNavRail(
              items: [
                NavRailItem(
                  icon: Icon(Icons.home_outlined),
                  selectedIcon: Icon(Icons.home),
                  label: "Home",
                ),
                NavRailItem(
                  icon: Icon(Icons.search_outlined),
                  selectedIcon: Icon(Icons.search),
                  label: "Search",
                ),
                NavRailItem(
                  icon: Icon(Icons.settings_outlined),
                  selectedIcon: Icon(Icons.settings),
                  label: "Settings",
                ),
              ],
              currentIndex: _currentIndex,
              onTap: (index) => setState(() => _currentIndex = index),
              extended: true,
              selectedColor: Colors.blue,
            ),

            // MAIN CONTENT AREA
            Expanded(
              child: Center(
                child: Text(
                  'Page ${_currentIndex + 1} Content',
                  style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
145
points
13
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A customizable Navigation Rail for Flutter apps with enhanced features and easy implementation.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on smart_nav_rail