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

A beautiful, custom animated floating capsule-style navigation bar for Flutter.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'CMX Capsule Nav Example',
      theme: ThemeData(
        primaryColor: const Color(0xFF7B7BFF),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _currentIndex = 0;

  final List<CmxCapsuleNavItem> _items = const [
    CmxCapsuleNavItem(icon: Icons.home_outlined, label: 'Home'),
    CmxCapsuleNavItem(icon: Icons.chat_bubble_outline, label: 'Chat'),
    CmxCapsuleNavItem(icon: Icons.person_outline, label: 'Profile'),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('CMX Capsule Nav'), centerTitle: true),
      body: Center(
        child: Text(
          'Selected Index: $_currentIndex',
          style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
        ),
      ),
      extendBody: true,
      bottomNavigationBar: CmxCapsuleNav(
        currentIndex: _currentIndex,
        items: _items,
        onTap: (index) {
          setState(() {
            _currentIndex = index;
          });
        },
        theme: CmxCapsuleNavTheme.defaultTheme(context),
      ),
    );
  }
}
5
likes
160
points
125
downloads

Publisher

unverified uploader

Weekly Downloads

A beautiful, custom animated floating capsule-style navigation bar for Flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on cmx_capsule_nav