Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bensonarafat committed Jun 28, 2023
1 parent 985be34 commit ecdf3c6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 113 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

Benson Arafat <[email protected]>

Thomas Burkhart <[email protected]>a
Thomas Burkhart <[email protected]>
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

# [2.0.4] - 28.06.2023

# [2.0.3] - 23.06.2023
# [2.0.2] - 25.05.2023
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(
Expand All @@ -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();
Expand Down Expand Up @@ -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,
Expand All @@ -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,
//...
Expand All @@ -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,
Expand All @@ -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?
Expand All @@ -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(
Expand All @@ -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<bool> _willPopCallback() async {
// If the tooltip is open we don't pop the page on a backbutton press
// but close the ToolTip
Expand Down
73 changes: 0 additions & 73 deletions package-lock.json

This file was deleted.

28 changes: 0 additions & 28 deletions package.json

This file was deleted.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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


Expand Down

0 comments on commit ecdf3c6

Please sign in to comment.