Viewing version 0.0.2. Open the latest package page.

popover

0.0.2

A popover is a transient view that appears above other content onscreen when you tap a control or in an area.

Download archive

Readme

Content

Features

A popover is a transient view that appears above other content onscreen when you tap a control or in an area. Typically, a popover includes an arrow pointing to the location from which it emerged. Popovers can be nonmodal or modal. A nonmodal popover is dismissed by tapping another part of the screen or a button on the popover. A modal popover is dismissed by tapping a Cancel or other button on the popover.

Source: Human Interface Guidelines.

Requirements

  • Dart: 2.9.0+
  • Flutter : 1.17.5+

Install

dependencies:
  popover: ^0.0.2

Example

See example/lib/main.dart.

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

class PopoverItems extends StatelessWidget {
  const PopoverItems({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Popover(
      width: 200,
      child: Container(
        width: 80,
        height: 40,
        decoration: const BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.all(Radius.circular(5)),
          boxShadow: [BoxShadow(color: Colors.black26, blurRadius: 5)],
        ),
        child: const Center(child: Text('Click Me')),
      ),
      bodyBuilder: (context) {
        return Scrollbar(
          child: Padding(
            padding: const EdgeInsets.only(top: 8, bottom: 8),
            child: ListView(
              padding: const EdgeInsets.all(8),
              children: [
                InkWell(
                  onTap: () => Navigator.of(context).pop(),
                  child: Container(
                    height: 50,
                    color: Colors.amber[100],
                    child: const Center(child: Text('Entry A')),
                  ),
                ),
                const Divider(),
                Container(
                  height: 50,
                  color: Colors.amber[200],
                  child: const Center(child: Text('Entry B')),
                ),
                const Divider(),
                Container(
                  height: 50,
                  color: Colors.amber[300],
                  child: const Center(child: Text('Entry C')),
                ),
              ],
            ),
          ),
        );
      },
    );
  }
}

To see examples of the following package on a device or simulator:

cd example && flutter run

FAQ

If you have any questions ping me on twitter: @minikin

License

The source code of Popover project is available under the MIT license. See the LICENSE file for more info.

Changelog

[0.0.2] - 18.01.2021.

  • Update PopoverItem.
  • Add PopoverDirection to exports.
  • Add documentation.

[0.0.1] - 10.01.2021.

  • Initial release.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'popover:0.0.2'
pubspec.yaml
name: popover
description: A popover is a transient view that appears above other content onscreen when you tap a control or in an area.
version: 0.0.2
homepage: https://github.com/minikin/popover

environment:
  sdk: ">=2.9.0 <3.0.0"
  flutter: ">=1.17.0"

dependencies:
  flutter:
    sdk: flutter

dev_dependencies:
  flutter_test:
    sdk: flutter

Version history

VersionPublishedArchiveSHA-256
0.0.1Cached · Upstream SHA-256 matchedDownload88b01eda…bf5273
0.0.2Cached · Upstream SHA-256 matchedDownload9d6da05b…208a73
0.0.3Cached · Upstream SHA-256 matchedDownload75ec1dcf…f85d1b
0.0.4Cached · Upstream SHA-256 matchedDownload8c08d042…4752cf
0.0.5Cached · Upstream SHA-256 matchedDownload092ea635…f05a8f
0.1.0Cached · Upstream SHA-256 matchedDownloadecd0913b…e14e10
0.2.0Cached · Upstream SHA-256 matchedDownloadddc74c59…95811d
0.2.1Cached · Upstream SHA-256 matchedDownloadc0e7ba46…655291
0.2.2Cached · Upstream SHA-256 matchedDownload07285f1e…5b800f
0.2.3Cached · Upstream SHA-256 matchedDownload086d8b1a…2a1301
0.2.4Cached · Upstream SHA-256 matchedDownloadd48bb7a4…2234a1
0.2.5Cached · Upstream SHA-256 matchedDownloadfed0248e…d020e1
0.2.6Cached · Upstream SHA-256 matchedDownload379b0957…33ccc6
0.2.6+1Cached · Upstream SHA-256 matchedDownload93f3b1d8…3fe28b
0.2.6+2Cached · Upstream SHA-256 matchedDownload4dfba8a3…00b9c3
0.2.6+3Cached · Upstream SHA-256 matchedDownload58619214…01f933
0.2.7Cached · Upstream SHA-256 matchedDownloadfacec117…066d67
0.2.8Cached · Upstream SHA-256 matchedDownload29b40c42…f9cf5f
0.2.8+1Cached · Upstream SHA-256 matchedDownload4255a09e…3582ea
0.2.8+2Cached · Upstream SHA-256 matchedDownload59f4a55e…5a94d4
0.2.9Cached · Upstream SHA-256 matchedDownload6a0928cc…b88c3f
0.3.0Cached · Upstream SHA-256 matchedDownloadca3bef9d…203db2
0.3.0+1Cached · Upstream SHA-256 matchedDownload5cba40e0…5fc876
0.3.1Cached · Upstream SHA-256 matchedDownload0606f3e1…d0e1a2
0.4.0Cached · Upstream SHA-256 matchedDownload2b2e1c40…efff07
0.5.0Cached · Upstream SHA-256 matchedDownload12856153…0a6715
0.5.1Cached · Upstream SHA-256 matchedDownload0bad70fe…6d3d3b

Dependencies

flutter { "sdk": "flutter" }