# popover 0.2.3

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




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'popover:0.2.3'
```
Published: 2021-05-03T15:45:12.472142Z
Expected archive SHA-256: 086d8b1ab12da003e49d79ab9df24d19a3673a4a911de75cd33875e7d72a1301

Available in cache; verification: upstream_checksum
## Direct dependencies
- flutter: map[sdk:flutter]

## Package README (untrusted upstream documentation)
<h1 align="center">Popover</h1>

<p align="center">
  <a href="https://github.com/minikin/popover/">
    <img src="https://i.ibb.co/0DW1XQ0/popover-demo.png" alt="Popover screenshots" />
  </a>
<h2 align="center">Popover for Flutter</h2>
</p>

<p align="center">

  <a href="https://github.com/minikin/popover">
    <img src="https://img.shields.io/badge/platforms-iOS%20%7C%20iPadOS%20%7C%20Android%20%7C%20Web-green.svg" alt="Supported platforms" />
  </a>

   <a href="https://github.com/minikin/popover/blob/main/LICENSE">
    <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Popover is released under the MIT license." />
  </a>

  <a href="https://github.com/tenhobi/effective_dart">
    <img src="https://img.shields.io/badge/style-effective_dart-40c4ff.svg" alt="Effective Dart" />
  </a>

  <a href="https://github.com/minikin/popover/blob/main/CODE_OF_CONDUCT.md">
    <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
  </a>

  </br>

   <a href="https://github.com/minikin/popover/actions">
    <img src="https://github.com/minikin/popover/workflows/On%20Pull%20Request/badge.svg" alt="Current Build Status." />
  </a>

  <a href="https://codecov.io/gh/minikin/popover">
    <img src="https://codecov.io/gh/minikin/popover/branch/main/graph/badge.svg?token=CHT3D24SOQ"/>
  </a>

</p>


# Content

- [Features](#features)
- [Requirements](#requirements)
- [Install](#install)
- [Example](#example)
- [Support](#support)
- [License](#license)

## 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.
](https://developer.apple.com/design/human-interface-guidelines/ios/views/popovers/)

## Requirements

- Dart: 2.12.0+
- Flutter : 2.0.0+

## Install

```yaml
dependencies:
  popover: ^0.2.3
```

## Example

See `example/lib/main.dart`.

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

class PopoverExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Popover Example')),
        body: const SafeArea(
          child: Padding(
            padding: EdgeInsets.all(16),
            child: Button(),
          ),
        ),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return 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: GestureDetector(
        child: const Center(child: Text('Click Me')),
        onTap: () {
          showPopover(
            context: context,
            bodyBuilder: (context) => const ListItems(),
            onPop: () => print('Popover was popped!'),
            direction: PopoverDirection.top,
            width: 200,
            height: 400,
            arrowHeight: 15,
            arrowWidth: 30,
          );
        },
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scrollbar(
      child: Padding(
        padding: const EdgeInsets.symmetric(vertical: 8),
        child: ListView(
          padding: const EdgeInsets.all(8),
          children: [
            InkWell(
              onTap: () {
                print('GestureDetector was called on Entry A');
                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')),
            ),
          ],
        ),
      ),
    );
  }
}
```

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

```sh
cd example && flutter run
```

## Support

Post issues and feature requests on the GitHub [issue tracker](https://github.com/minikin/popover/issues).


## License

The source code of Popover project is available under the MIT license.
See the [LICENSE](https://github.com/minikin/popover/blob/main/LICENSE) file for more info.

## Changelog
## [0.2.3] - 03.05.2021.

- Add `RouteSettings? routeSettings` parameter.

## [0.2.2] - 22.04.2021.

- Rebuild Popover on device orientation changes (thanks [@SanekLic](https://github.com/SanekLic), [@shcherbuk96](https://github.com/shcherbuk96)).

## [0.2.1] - 04.04.2021.

- Lower minimum version requirements for Dart and Flutter to pass pub.dev validation.

## [0.2.0] - 04.04.2021.

- Migrate to NNBD.

## [0.1.0] - 09.02.2021.

- **BREAKING**: Refactor popover implementation to have identical API to included in Flutter modal dialogs e.g. `showCupertinoDialog`
- docs: README updates
- docs: example application updates

## [0.0.5] - 08.02.2021.

* Add `Key key`, `barrierDismissible` and `showPopover`.

## [0.0.4] - 27.01.2021.

* Add `arrowDyOffset`, `arrowDxOffset` and `contentDyOffset` public parameters.

## [0.0.3] - 21.01.2021.

* A `child` widget can be wrapped in `InkWell` or `GestureDetector`.

## [0.0.2] - 18.01.2021.

* Update `PopoverItem`.
* Add `PopoverDirection` to exports.
* Add documentation.

## [0.0.1] - 10.01.2021.

* Initial release.







 
