curved_navigation_rail 2.0.1 copy "curved_navigation_rail: ^2.0.1" to clipboard
curved_navigation_rail: ^2.0.1 copied to clipboard

Stunning Animating Curved Shape Navigation Rail. Adjustable color, background color, animation curve, animation duration.

example/lib/main.dart

import 'package:curved_navigation_rail/curved_navigation_rail.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: CurvedNavigationRailExamplePage(),
    );
  }
}

class CurvedNavigationRailExamplePage extends StatefulWidget {
  const CurvedNavigationRailExamplePage({Key? key}) : super(key: key);

  @override
  State<CurvedNavigationRailExamplePage> createState() =>
      _CurvedNavigationRailExamplePageState();
}

class _CurvedNavigationRailExamplePageState
    extends State<CurvedNavigationRailExamplePage> {
  int _selectedIndex = 0;

  @override
  Widget build(BuildContext context) {
    final List<NavigationRailDestination> destinations = const [
      NavigationRailDestination(
          icon: Icon(Icons.person), label: Text('Profile')),
      NavigationRailDestination(icon: Icon(Icons.home), label: Text('Home')),
      NavigationRailDestination(
          icon: Icon(Icons.settings), label: Text('Settings')),
    ];

    return Scaffold(
        body: Row(
      children: [
        CurvedNavigationRail(
          destinations: destinations,
          onDestinationSelected: (index) =>
              setState(() => _selectedIndex = index),
        ),
        MyContent(value: _selectedIndex),
      ],
    ));
  }
}

class MyContent extends StatelessWidget {
  const MyContent({Key? key, required this.value}) : super(key: key);

  final int value;

  @override
  Widget build(BuildContext context) {
    return Expanded(child: Center(child: Text('This is Page $value')));
  }
}
10
likes
150
points
12
downloads

Publisher

verified publishergangyistudios.com

Weekly Downloads

Stunning Animating Curved Shape Navigation Rail. Adjustable color, background color, animation curve, animation duration.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause, BSD-2-Clause (license)

Dependencies

flutter

More

Packages that depend on curved_navigation_rail