hints 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

hints #

A simple widget for showing dismissible help texts to the user. If the widget is dismissed, it will remember by saving the state in persistent storage and will never be shown again.

Usage #

Import the package #

To use this package, add hints as a dependency in your pubspec.yaml

Use the package #

import 'package:hints/hints.dart';

The main widget to use is HintCard.

The widget need a unique Key to keep track of if the widget is hidden or not.

It also needs a hint text and can be provided an icon.

Note: The widget will assert if no key is provided. Don't provide a generated key as it will not match next run.

Getting started #

Please look at the example code for getting started.


[0.0.1] - 03/09/2019 #

  • Initial release.

[0.0.2] - 04/09/2019 #


  • Added a flag to force show the widget. This can be used for testing purposes.


// Copyright 2019 Mattias MÃ¥nsson. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

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

void main() {
  runApp(new MaterialApp(
    home: new MyHomePage(),

class MyHomePage extends StatefulWidget {
  _MyHomePageState createState() => new _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  var isEnabled = true;

  void initState() {


  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(),
      body: Center(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
              key: Key('MyUniqueHintKey'),
              'This is a little help text for the first time user. Just press the little X to dismiss it forever...',
              key: Key('MyUniqueHintKey2'),
              'This is a 2nd little help text for the first time user. Just press the little X to dismiss it forever...',
              key: Key('MyUniqueHintKey3'),
              'This is a 3rd little help text for the first time user. Just press the little X to dismiss it forever...',
              child: Text('Reset'),
              onPressed: () async {
                await HintCard.resetHidden();
                setState(() {});

Use this package as a library

1. Depend on it

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

  hints: ^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:hints/hints.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/hints.dart.

Run flutter format to format lib/hints.dart.

Maintenance suggestions

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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
shared_preferences ^0.5.3+4 0.5.6+2
Transitive dependencies
collection 1.14.11 1.14.12
flutter_web_plugins 0.0.0
meta 1.1.8
shared_preferences_macos 0.0.1+6
shared_preferences_platform_interface 1.0.3
shared_preferences_web 0.1.2+4
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies