innosoft_simpletooltip 0.0.2

  • Readme
  • Changelog
  • Installing
  • 46

innosoft_simpletooltip #

Plugin aims to help produce an easily usable implementation of tooltip

Usage #

To use this plugin, add innosoft_simpletooltip as a dependency in your pubspec.yaml.

Example #

import 'package:flutter/material.dart';
import 'package:innosoft_simpletooltip/innosoft_simpletooltip.dart';

void main() {
runApp(App());
}

class App extends StatelessWidget {

@override
Widget build(BuildContext context) {
return MaterialApp(
home: TooltipExampleStateful(),
);
}
}

class TooltipExampleStateful extends StatefulWidget {
TooltipExampleStateful({Key key}) : super(key: key);

@override
_TooltipExampleStateful createState() => _TooltipExampleStateful();
}

class _TooltipExampleStateful extends State<TooltipExampleStateful> {

double marginTop = 20;
SoftSimpleTooltip tooltipUp, tooltipDown;
bool clsTooltipUp = false;
bool clsTooltipDown = false;

@override
void initState() {
super.initState();
tooltipUp = SoftSimpleTooltip(
content: Container(
//height: 100.0,
child:Text("Lorem ipsum dolor sit amet, consetetur sadipscingelitr, "
"sed diam nonumy eirmod tempor invidunt ut laboreet dolore magna aliquyam erat, "
"sed diam voluptua. At vero eos et accusam et justoduo dolores et ea rebum. ")
),
popupDirection: TooltipDirection.up,
backgroundColor: Colors.black,
radius: 20,
arrowHeight: 40,
arrowWidth: 50,
arrowPos: 200,
tooltipStyle: TooltipStyle.border);
tooltipDown = SoftSimpleTooltip(
content: Container(
//height: 100.0,
child:Text("Lorem ipsum dolor sit amet, consetetur sadipscingelitr, "
"sed diam nonumy eirmod tempor invidunt ut laboreet dolore magna aliquyam erat, "
"sed diam voluptua. At vero eos et accusam et justoduo dolores et ea rebum. ")
),
popupDirection: TooltipDirection.down,
backgroundColor: Colors.black,
radius: 20,
arrowHeight: 40,
arrowWidth: 50,
arrowPos: 200,
tooltipStyle: TooltipStyle.border);
}

@override
void dispose() {
super.dispose();
}

void showHideTooltipUp(){
clsTooltipUp ? tooltipUp.showTooltip() : tooltipUp.closeTooltip();
setState(() {
clsTooltipUp = !clsTooltipUp;
});
}

void showHideTooltipDown(){
clsTooltipDown ? tooltipDown.showTooltip() : tooltipDown.closeTooltip();
setState(() {
clsTooltipDown = !clsTooltipDown;
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
backgroundColor: Colors.white,
elevation: 0.0,
centerTitle: true,
title: Text(
'TOOLTIP',
style: TextStyle(color: Colors.black),
),
),
body:
Column(
//mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
// Row 1
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: new Container(
margin: new EdgeInsets.fromLTRB(20, 20, 20, 0),
child: Row(
children: <Widget>[
Expanded(
child: tooltipUp,
),
],
))
),
]
),
Row(
children: <Widget>[
Expanded(
child: new Container(
margin: new EdgeInsets.fromLTRB(20, 0, 20, 0),
child: RaisedButton(
onPressed: () {
//Navigator.pop(globalContext);
showHideTooltipUp();
},
child: Text('Show Hide Tooltip Up'),
))
),
]
),
Row(
children: <Widget>[
Expanded(
child: new Container(
margin: new EdgeInsets.fromLTRB(20, 20, 20, 0),
child: RaisedButton(
onPressed: () {
//Navigator.pop(globalContext);
showHideTooltipDown();
},
child: Text('Show Hide Tooltip Down'),
))
),
]
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: new Container(
margin: new EdgeInsets.fromLTRB(20, 0, 20, 0),
child: Row(
children: <Widget>[
Expanded(
child: tooltipDown,
),
],
))
),
]
),
]
)
);
}
}

[0.0.1] - 06/03/2020 #

[0.0.2] - 06/03/2020 #

  • Inital publish package

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  innosoft_simpletooltip: ^0.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:innosoft_simpletooltip/innosoft_simpletooltip.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
46
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [innosoft_simpletooltip] that is in a package requiring null.

Health suggestions

Fix lib/innosoft_simpletooltip.dart. (-1.49 points)

Analysis of lib/innosoft_simpletooltip.dart reported 3 hints:

line 16 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: SoftSimpleTooltip.content, SoftSimpleTooltip.popupDirection, SoftSimpleTooltip.tooltipStyle, SoftSimpleTooltip.backgroundColor, SoftSimpleTooltip.hasShadow, SoftSimpleTooltip.radius, SoftSimpleTooltip.arrowHeight, SoftSimpleTooltip.arrowWidth, SoftSimpleTooltip.arrowPos, SoftSimpleTooltip.heightWall, SoftSimpleTooltip.stp

line 75 col 8: This method overrides a method annotated as '@mustCallSuper' in 'State', but doesn't invoke the overridden method.

line 85 col 8: This method overrides a method annotated as '@mustCallSuper' in 'State', but doesn't invoke the overridden method.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and innosoft_simpletooltip.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test