master_detail_flow 2.0.0 copy "master_detail_flow: ^2.0.0" to clipboard
master_detail_flow: ^2.0.0 copied to clipboard

A package that provides a simple master-detail-flow with material 3

example/lib/main.dart

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

void main() => runApp(const MyApp());

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

  static const String _title = 'Example';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: _title,
      theme: ThemeData(
        useMaterial3: true,
        brightness: Brightness.light,
        colorSchemeSeed: Colors.blue,
      ),
      home: Scaffold(
        body: MasterDetailsFlow(
          title: const Text(_title),
          items: [
            MasterItem(
              'Item one',
              detailsBuilder: (_) => const DetailsItem(
                title: Text(
                  'Item one details title',
                ),
              ),
            ),
            MasterItem(
              'Item two',
              detailsBuilder: (_) => const DetailsItem(
                title: Text(
                  'Item two details title',
                ),
                children: [
                  Text('One children'),
                ],
              ),
            ),
            MasterItem(
              'Advanced item 3',
              detailsBuilder: (_) => DetailsItem(
                title: const Text(
                  'Using a custom sliver',
                ),
                slivers: [
                  SliverList(
                    delegate: SliverChildBuilderDelegate(
                      (context, index) => Text('This is item $index'),
                    ),
                  ),
                ],
              ),
            ),
            MasterItem(
              'Item 4',
              leading: const Icon(Icons.account_tree_rounded),
              detailsBuilder: (_) => DetailsItem(
                title: const Text(
                  'Using a custom sliver',
                ),
                actions: [
                  IconButton(
                    onPressed: () {},
                    icon: const Icon(
                      Icons.help,
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
7
likes
0
pub points
42%
popularity

Publisher

unverified uploader

A package that provides a simple master-detail-flow with material 3

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

animations, flutter

More

Packages that depend on master_detail_flow