index_cut 0.1.0 copy "index_cut: ^0.1.0" to clipboard
index_cut: ^0.1.0 copied to clipboard

The widget represents a screen like an index cut

index_cut #

The widget represents a screen like an index cut

Demo #

Usage #

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

  @override
  State<IndexCutView> createState() => _IndexCutViewState();
}

class _IndexCutViewState extends State<IndexCutView> {
  int currentIndex = 0;

  final items = [
    const Text('1', style: TextStyle(fontSize: 18)),
    const Text('2', style: TextStyle(fontSize: 18)),
    const Text('3', style: TextStyle(fontSize: 18)),
    const Text('4', style: TextStyle(fontSize: 18)),
  ];

  @override
  Widget build(BuildContext context) {
    return IndexCut(
      currentIndex: currentIndex,
      icons: items,
      isOneWay: false,
      onChanged: (index) {
        setState(() {
          currentIndex = index;
        });
      },
      child: Center(
        child: items[currentIndex],
      ),
    );
  }
}
2
likes
130
pub points
0%
popularity

Publisher

verified publishershoryu.dev

The widget represents a screen like an index cut

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on index_cut