pub repository
mirror.p-hatan.irpopover
0.1.0A popover is a transient view that appears above other content onscreen when you tap a control or in an area.
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.1.0
Example
See example/lib/main.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:
cd example && flutter run
Support
Post issues and feature requests on the GitHub issue tracker.
License
The source code of Popover project is available under the MIT license. See the LICENSE file for more info.
Changelog
[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,barrierDismissibleandshowPopover.
[0.0.4] - 27.01.2021.
- Add
arrowDyOffset,arrowDxOffsetandcontentDyOffsetpublic parameters.
[0.0.3] - 21.01.2021.
- A
childwidget can be wrapped inInkWellorGestureDetector.
[0.0.2] - 18.01.2021.
- Update
PopoverItem. - Add
PopoverDirectionto exports. - Add documentation.
[0.0.1] - 10.01.2021.
- Initial release.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add popoverpubspec.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.1.0
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
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.1 | 2021-01-10T16:05:11.774612Z | Download | 88b01eda033caeded5a6c3d360728c0ff16c7bf1ef9a122fae9017ca66bf5273 |
| 0.0.2 | 2021-01-18T10:51:14.535196Z | Download | 9d6da05b4c82ef7275d62f0f90dba360fb62923ac1229feec00137583c208a73 |
| 0.0.3 | 2021-01-21T09:35:38.409796Z | Download | 75ec1dcfbe54bfcdf8eeec8c5187b097fc2ef4ea1f7fa8a920dfc9a3e6f85d1b |
| 0.0.4 | 2021-01-27T13:17:13.360781Z | Download | 8c08d042e99dc19e1245173e8614cf8a1fcae965a623ff9a0a844540be4752cf |
| 0.0.5 | 2021-02-08T11:13:04.078089Z | Download | 092ea635faca3dfa8d106a49fc8e2ea8e81473c671a9da749155697dc2f05a8f |
| 0.1.0 | 2021-02-09T10:27:02.372294Z | Download | ecd0913b60c163f85ad8d7fb73f465b5cd87e331c2ffc6977f7981cbcce14e10 |
| 0.2.0 | 2021-04-04T09:39:39.763172Z | Download | ddc74c5975a7cee4b6429d3ef66e1d60f34781cea75e33a486c5daab1195811d |
| 0.2.1 | 2021-04-04T10:10:23.890126Z | Download | c0e7ba460a2eb7f86b5dd74dc8ae9b608a0b652c268c1242b9c5eb7e78655291 |
| 0.2.2 | 2021-04-22T19:32:25.407542Z | Download | 07285f1eb7a0ab40cbe7ed7037708befb2d68760c6ee8243511959df435b800f |
| 0.2.3 | 2021-05-03T15:45:12.472142Z | Download | 086d8b1ab12da003e49d79ab9df24d19a3673a4a911de75cd33875e7d72a1301 |
| 0.2.4 | 2021-05-18T09:01:40.553975Z | Download | d48bb7a4e2ed111ab588a8ec7e7b44f68c8c77008b760b4bfafe268f992234a1 |
| 0.2.5 | 2021-05-18T22:00:31.921862Z | Download | fed0248e40bbbc6ffb4455bad4e5d7d64e24f944b14b81ca6ca8aa57e1d020e1 |
| 0.2.6 | 2021-05-21T08:08:06.061717Z | Download | 379b0957e04ed32ffb4a765302817075e41e5cd21956d68843cec01e0e33ccc6 |
| 0.2.6+1 | 2021-05-21T10:25:36.682087Z | Download | 93f3b1d804740a7e102381edf54b840a5cc08cd37c90d38f9fdac281633fe28b |
| 0.2.6+2 | 2021-06-17T07:21:06.729570Z | Download | 4dfba8a3c865081f0468ae89c5fe1fdac7050b99cdc3e526259ebab40a00b9c3 |
| 0.2.6+3 | 2021-10-12T09:46:38.915902Z | Download | 586192140ed4413779a02e4e4e14ff1ad040346e15bdc5361a16178e9a01f933 |
| 0.2.7 | 2022-10-24T01:12:39.571177Z | Download | facec1170550043f859fa65706872f6ffa2fd96da2d6dc56c653a689f3066d67 |
| 0.2.8 | 2023-01-02T20:39:17.931736Z | Download | 29b40c4297f5192d4fd4263a2996598eb7b62105437a00d68cf9561311f9cf5f |
| 0.2.8+1 | 2023-02-05T19:38:58.565153Z | Download | 4255a09e3bb64cada6aebdeeeb15453a2790802d4eecb9256ff5c895863582ea |
| 0.2.8+2 | 2023-03-01T10:02:11.049592Z | Download | 59f4a55ebb484d012c8aaa273ad58eee571945231b71fb938c5a69f63b5a94d4 |
| 0.2.9 | 2023-12-08T09:27:42.256835Z | Download | 6a0928ccdcf12d46b407372b644a0d94400b316d0ee072a19dcef03c2bb88c3f |
| 0.3.0 | 2024-02-08T12:47:32.184638Z | Download | ca3bef9d88ebf5c5c3823946a5de3ce8360018fbb6a3e25819586a7d5a203db2 |
| 0.3.0+1 | 2024-05-19T13:31:13.932983Z | Download | 5cba40e04115cbbf15c35e00767b91e8bf3f769763a34beb2f8a1b9e8b5fc876 |
| 0.3.1 | 2024-08-11T09:33:48.970285Z | Download | 0606f3e10f92fc0459f5c52fd917738c29e7552323b28694d50c2d3312d0e1a2 |
| 0.4.0 | 2025-10-23T18:11:48.270204Z | Download | 2b2e1c40658b05089ac9365211983ebdad067d34b9d8fa0313434b38f7efff07 |
| 0.5.0 | 2026-10-12T19:08:52.329625Z | Download | 128561533a7b5a856de092073cd90ce7481c907970251db9d90a9513b50a6715 |
| 0.5.1 | 2026-10-12T20:11:03.251282Z | Download | 0bad70fe7dd7b182b8358719c1d50092a54f010e612fee1380c7f2302c6d3d3b |
Dependencies
flutter {
"sdk": "flutter"
}