From 51738c1333181b9010e68a30c7fe2c26233565c3 Mon Sep 17 00:00:00 2001 From: minikin Date: Sun, 10 Jan 2021 17:00:48 +0100 Subject: [PATCH] Update README --- CHANGELOG.md | 4 +-- README.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++- example/README.md | 1 - 3 files changed, 66 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac07159..05789cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -## [0.0.1] - TODO: Add release date. +## [0.0.1] - 10.01.2021. -* TODO: Describe initial release. +* Initial release. diff --git a/README.md b/README.md index 6051c5b..2e401f6 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ Source: [Human Interface Guidelines. ## Requirements - Dart: 2.9.0+ +- Flutter : 1.17.5+ ## Install @@ -68,6 +69,68 @@ dependencies: ## Example +See `example/example.dart`. + + +```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')), + ), + builder: (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: ```sh @@ -76,7 +139,7 @@ cd example && flutter run ## TODO: -- [Add documentaion](https://github.com/minikin/popover/issues/5) +- [Add documentation](https://github.com/minikin/popover/issues/5) ## FAQ diff --git a/example/README.md b/example/README.md index e9d0f5d..1e88b7a 100644 --- a/example/README.md +++ b/example/README.md @@ -1,7 +1,6 @@ # Popover Example ```dart - import 'package:flutter/material.dart'; import 'package:popover/popover.dart';