A template package for List-Detail or Master-Detail layouts


  • Builds for large or small screens in one simple widget.
  • Easily modifiable.
  • Handles all state management with no dependencies and no fuss.
  • Inhereted lookup of controller ListDetail<T>.of(context)
  • Simple package. Look at the code. There's not much complexity.

Getting started

Add package

flutter pub add list_detail_base



import 'package:list_detail_base/list_detail_base.dart';

Example (explore example code in the example app - it's short).

/// Example of ListDetailBase
class _MyHomePageState extends State<MyHomePage> {

  /// Make a controller with the same type as your list.
  /// [ColorEtymology] is an example data class
  late final ListDetailController<ColorEtymology> controller;

  void initState() {
    /// 5 second delay for show. Transform turns JSON list into a 
    /// list of your model 
    controller = ListDetailController(
      fetch: () => Future.delayed(const Duration(seconds: 5), () => Future.value(colorMapList)),
      transform: ColorEtymology.fromMap,

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(widget.title)),
      body: ListDetailLayout(
        controller: controller,
        listBuilder: (context, items, isSplitScreen) => ListView.builder(
          itemCount: items.length,
          // [Item] is an example view - a ListTile
          itemBuilder: (context, index) => Item(
            colorModel: items[index],
            isSplitScreen: isSplitScreen,
            onSelect: (value) => = value,
        detailBuilder: (context, item, isSplitScreen) => item == null
            ? Container()
            // [ColorModelDetail] is an example view - a Card
            : ColorModelDetail(
                colorModel: item,
                isSplitScreen: isSplitScreen,
                colorModelListenable: controller.selectedItem,

  void dispose() {

Additional information

This is a quick helper package I put together based on other work I was doing. If you find it useful or want to add some feature please let me know.