flutter_boardview 0.2.1 copy "flutter_boardview: ^0.2.1" to clipboard
flutter_boardview: ^0.2.1 copied to clipboard

This is a custom Flutter widget that can create a draggable BoardView or also known as a kanban. The view can be reordered with drag and drop.

example/lib/main.dart

import 'package:example/example_board.dart';
import 'package:flutter/material.dart';

import 'pagination_scroll_board.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

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

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

class _MyHomePageState extends State<MyHomePage> {
  List<Tab> tabs = [
    Tab("Board", const ExampleBoard(), const Icon(Icons.table_chart)),
    Tab("Pagination (infinite scroll)", const PaginationScrollBoard(), const Icon(Icons.list_alt_outlined)),
  ];

  int _selectedIndex = 0;
  late final List<Widget> _widgetOptions = tabs.map((Tab tab) => tab.widget).toList();

  void _onItemTapped(int index) {
    setState(() {
      _selectedIndex = index;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(tabs[_selectedIndex].label)),
      body: _widgetOptions.elementAt(_selectedIndex),
      bottomNavigationBar: BottomNavigationBar(
        items: tabs
            .map((Tab tab) => BottomNavigationBarItem(
                  icon: tab.icon,
                  label: tab.label,
                ))
            .toList(),
        currentIndex: _selectedIndex,
        onTap: _onItemTapped,
      ),
    );
  }
}

class Tab {
  final String label;
  final Widget widget;
  final Widget icon;

  Tab(this.label, this.widget, this.icon);
}
17
likes
140
pub points
84%
popularity

Publisher

unverified uploader

This is a custom Flutter widget that can create a draggable BoardView or also known as a kanban. The view can be reordered with drag and drop.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_boardview