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

Custom Flutter bottom bar navigation with multiple shapes

example/lib/main.dart

import 'package:example/my_shape.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.black,
          iconsColor: Colors.white,
          listItems: [
            ShapedItemObject(iconData: Icons.alarm, title: "Alarm"),
            ShapedItemObject(
                iconData: Icons.menu_book, title: "Menu"),
            ShapedItemObject(
                iconData: Icons.verified_user_rounded, title: "User"),
            ShapedItemObject(iconData: Icons.login, title: "Logout"),
          ],
          onItemChanged: (position) {
            setState(() {
              this.selectedItem = position;
            });
          },
          shape: ShapeType.STAR,
          shapeColor: Color(0xffFFD700),
          selectedIconColor: Colors.white),
      body: Container(),
    );
  }
}
24
likes
140
pub points
47%
popularity

Publisher

verified publisherbadrkouki.dev

Custom Flutter bottom bar navigation with multiple shapes

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on shaped_bottom_bar