shaped_bottom_bar 0.0.1 copy "shaped_bottom_bar: ^0.0.1" to clipboard
shaped_bottom_bar: ^0.0.1 copied to clipboard

outdated

Custom Flutter bottom bar navigation with multiple shapes

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:shaped_bottom_bar/models/shaped_item_object.dart';
import 'package:shaped_bottom_bar/utils/shapes.dart';
import 'package:shaped_bottom_bar/shaped_bottom_bar.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyScreen(),
    );
  }
}

class MyScreen extends StatefulWidget {
  @override
  _MyScreenState createState() => _MyScreenState();
}

class _MyScreenState extends State<MyScreen> {
  List<Widget> screens = [
    Container(color: Colors.white),
    Container(color: Colors.white),
    Container(color: Colors.white),
    Container(color: Colors.white)
  ];

  int selectedItem = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      bottomNavigationBar: ShapedBottomBar(
          backgroundColor: Colors.grey,
          iconsColor: Colors.white,
          listItems: [
            ShapedItemObject(iconData: Icons.settings, title: "Settings"),
            ShapedItemObject(iconData: Icons.account_balance_outlined, title: "Account"),
            ShapedItemObject(iconData: Icons.verified_user_rounded, title: "User"),
            ShapedItemObject(iconData: Icons.login, title: "Logout"),
          ],
          onItemChanged: (position) {
            setState(() {
              this.selectedItem = position;
            });
          },
          shapeColor: Colors.pink,
          selectedIconColor: Colors.white,
          shape: ShapeType.HEXAGONE),
      body: screens[selectedItem],
    );
  }
}
24
likes
0
pub points
63%
popularity

Publisher

verified publisherbadrkouki.dev

Custom Flutter bottom bar navigation with multiple shapes

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on shaped_bottom_bar