From ecdf3c617fe0cea7d70a41a36b9a6bea0497e5d8 Mon Sep 17 00:00:00 2001 From: Benson Arafat Date: Wed, 28 Jun 2023 09:00:45 +0100 Subject: [PATCH] Update Readme --- AUTHORS | 2 +- CHANGELOG.md | 1 + README.md | 22 +++++++------- package-lock.json | 73 ----------------------------------------------- package.json | 28 ------------------ pubspec.yaml | 2 +- 6 files changed, 15 insertions(+), 113 deletions(-) delete mode 100644 package-lock.json delete mode 100644 package.json diff --git a/AUTHORS b/AUTHORS index 91da8be..912e35a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,4 +5,4 @@ Benson Arafat -Thomas Burkhart a \ No newline at end of file +Thomas Burkhart \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8108fe1..4ac5a1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ +# [2.0.4] - 28.06.2023 # [2.0.3] - 23.06.2023 # [2.0.2] - 25.05.2023 diff --git a/README.md b/README.md index 241f28b..8967a17 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This will add a line like this to your package's pubspec.yaml (and run an implic ``` dependencies: - super_tooltip: ^2.0.0 + super_tooltip: ^2.0.4 ``` Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more. @@ -32,7 +32,7 @@ import 'package:super_tooltip/super_tooltip.dart'; You have to make your Widget a `StatefulWidget` and you just need to create a controller to manage state of tooltips, you can do so by defining an instance of a `SuperTooltipController` and pass it through to constructor. -``` +```dart final _controller = SuperTooltipController(); child: SuperTooltip( @@ -48,7 +48,7 @@ You have to make your Widget a `StatefulWidget` and you just need to create a co You need to wrap `SuperTooltip` with a `GestureDetector`, `MouseRegion` or `InkWell` that is responsible for showing and hiding the content. Further handling of the tooltip state can be managed explicitly through a controller -``` +```dart child: GestureDetector( onTap: () async { await _controller.showTooltip(); @@ -80,7 +80,8 @@ You need to wrap `SuperTooltip` with a `GestureDetector`, `MouseRegion` or `InkW ``` `SuperTooltip` just need one required argument which is the content. You can pass a child Widget which can be an icon to represent the what should be clicked. As showed in the example below. -``` + +```dart SuperTooltip( content: const Text("Lorem ipsum dolor sit amet, consetetur sadipscing elitr", softWrap: true, @@ -104,14 +105,15 @@ SuperTooltip( ``` Change the background by passing the `backgroundColor`. -``` + +```dart SuperTooltip( backgroundColor: Color(0xff2f2d2f), //.... ), ``` Change Popup direction to `TooltipDirection.right`, `TooltipDirection.left`, `TooltipDirection.bottom` and `TooltipDirection.up` -``` +```dart SuperTooltip( popupDirection: TooltipDirection.right, //... @@ -123,7 +125,7 @@ SuperTooltip( If you'd like to keep the user from dismissing the tooltip by clicking on the barrier, you can change `showBarrier` to `true` which means pressing on the scrim area will not immediately hide the tooltip. -``` +```dart SuperTooltip( showBarrier: true, barrierColor: Colors.red, @@ -133,7 +135,7 @@ SuperTooltip( If you'd like to simply react to open or close states, you can pass through `onHide` or `onShow` callbacks to the default constructor. -``` +```dart SuperTooltip( onDismiss: () { // Maybe continue tutorial? @@ -146,7 +148,7 @@ SuperTooltip( To hide the tooltip when the user tap the back button. Wrap your `GestureDetector` widget with `WillPopScope` widget passing a callback function to `onWillPop` like the example below -``` +```dart return WillPopScope( onWillPop: _willPopCallback, child: GestureDetector( @@ -159,7 +161,7 @@ To hide the tooltip when the user tap the back button. Wrap your `GestureDetecto ``` Create a callback function to dismiss -``` +```dart Future _willPopCallback() async { // If the tooltip is open we don't pop the page on a backbutton press // but close the ToolTip diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index c62d587..0000000 --- a/package-lock.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "super_tooltip", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "super_tooltip", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "moment": "^2.29.4", - "simple-git": "^3.19.0" - } - }, - "node_modules/@kwsites/file-exists": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", - "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", - "dependencies": { - "debug": "^4.1.1" - } - }, - "node_modules/@kwsites/promise-deferred": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", - "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==" - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/simple-git": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.19.0.tgz", - "integrity": "sha512-hyH2p9Ptxjf/xPuL7HfXbpYt9gKhC1yWDh3KYIAYJJePAKV7AEjLN4xhp7lozOdNiaJ9jlVvAbBymVlcS2jRiA==", - "dependencies": { - "@kwsites/file-exists": "^1.1.1", - "@kwsites/promise-deferred": "^1.1.1", - "debug": "^4.3.4" - }, - "funding": { - "type": "github", - "url": "https://github.com/steveukx/git-js?sponsor=1" - } - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index 2f205ef..0000000 --- a/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "super_tooltip", - "version": "1.0.0", - "description": "`SuperTooltip` It is super flexible and allows you to display ToolTips in the overlay of the screen. It gives you more flexibility over the Flutter standard ```Tooltip```. You have the option to make the whole screen covered with a background color. Tapping on the background closes the Tooltip.", - "main": "index.js", - "directories": { - "doc": "doc", - "example": "example", - "lib": "lib" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/escamoteur/super_tooltip.git" - }, - "author": "", - "license": "ISC", - "bugs": { - "url": "https://github.com/escamoteur/super_tooltip/issues" - }, - "homepage": "https://github.com/escamoteur/super_tooltip#readme", - "dependencies": { - "moment": "^2.29.4", - "simple-git": "^3.19.0" - } -} diff --git a/pubspec.yaml b/pubspec.yaml index 611afc8..5b1bbc9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: super_tooltip description: Super flexible Tooltip class that gets opend in the screens overlay -version: 2.0.3 +version: 2.0.4 homepage: https://github.com/escamoteur/super_tooltip