flutter_master_detail 1.1.5 copy "flutter_master_detail: ^1.1.5" to clipboard
flutter_master_detail: ^1.1.5 copied to clipboard

A package that simplifies building flexible adaptive master detail views for different screen sizes

example/lib/main.dart

import './views/grouped.dart';
import './views/paintings.dart';
import './views/ungrouped.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.indigo,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  int _selectedIndex = 0;
  static const List<Widget> _widgetOptions = [
    Ungrouped(),
    Grouped(),
    Paintings()
  ];
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: _widgetOptions.elementAt(_selectedIndex),
      bottomNavigationBar: BottomNavigationBar(
        items: const [
          BottomNavigationBarItem(
            label: 'Example One',
            icon: Icon(Icons.group_off),
          ),
          BottomNavigationBarItem(
            label: 'Example Two',
            icon: Icon(Icons.group),
          ),
          BottomNavigationBarItem(
            label: 'Example Three',
            icon: Icon(Icons.art_track),
          ),
        ],
        currentIndex: _selectedIndex,
        onTap: _onItemTapped,
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }

  void _onItemTapped(int index) {
    setState(() {
      _selectedIndex = index;
    });
  }
}
3
likes
90
pub points
42%
popularity

Publisher

unverified uploader

A package that simplifies building flexible adaptive master detail views for different screen sizes

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

animations, collection, cupertino_icons, flutter, flutter_sticky_header, responsive_builder, stacked

More

Packages that depend on flutter_master_detail