master_detail_flow 1.0.1 copy "master_detail_flow: ^1.0.1" to clipboard
master_detail_flow: ^1.0.1 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: MasterDetailFlow.fromItems(
          title: const Text('MasterDetailFlow'),
          masterItems: <MasterDetailFlowItemBase>[
            MasterDetailFlowTitle(
              child: Container(
                color: Colors.green,
                height: 200,
                child: const Center(
                  child: Text('Title'),
                ),
              ),
            ),
            MasterDetailFlowItem(
              title: const Text('Option One'),
              detailsListChildBuilder: (BuildContext context, int index) =>
                  Text('Hello World $index'),
            ),
            const MasterDetailFlowDivider(child: Divider()),
            MasterDetailFlowItem(
              title: const Text('Option Two'),
              subtitle: const Text('This is the second option after a divider'),
              showSubtitleOnDetails: true,
              detailsListChildBuilder: (BuildContext context, int index) =>
                  const SizedBox(
                height: double.maxFinite,
                child: Center(
                  child: Text('A centered object'),
                ),
              ),
              detailsChildrenCount: 1,
            ),
          ],
        ),
      ),
    );
  }
}
10
likes
140
points
70
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on master_detail_flow