overlay_container 0.0.5+1 copy "overlay_container: ^0.0.5+1" to clipboard
overlay_container: ^0.0.5+1 copied to clipboard

A flutter widget which renders its child outside the original widget hierarchy.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Overlay Container Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text('Overlay Container Demo Page'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(20),
        child: ListView.separated(
          shrinkWrap: true,
          itemCount: 5,
          itemBuilder: (BuildContext context, int index) {
            if (index % 2 == 1) {
              return MyDropdownButton(
                label: "Bottom Dropdown",
                position: DropdownPosition.BELOW,
              );
            }
            return MyDropdownButton(
              label: "Right Dropdown",
              position: DropdownPosition.RIGHT,
            );
          },
          separatorBuilder: (BuildContext context, int index) {
            return SizedBox(height: 20);
          },
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
50
likes
40
pub points
76%
popularity

Publisher

verified publishermustansir.dev

A flutter widget which renders its child outside the original widget hierarchy.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on overlay_container