confused_travolta_error_view 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

confused_travolta_error_view #

A fun way to display error view.

Display your error view composed of following components:

  • An appropriate error gif. (Confused Travolta Gif)

  • An error message. (Can be customized with errorWidget, errorMessage and errorMessageStyle)

  • A Retry button. [Optional] (Can be customized with retryButton, retryButtonText and onTapRetryButton).

Example #

Using default values for error and button widgets:

 ConfusedTravoltaErrorView(
    errorMessage: 'You have no Internet connection.',
    onTapRetryButton: () {},
 )

Using custom error and button widgets:

 ConfusedTravoltaErrorView(
    errorText: Text(
        'Ooops! Something went wrong.',
        style: TextStyle(fontSize: 19.0),
    ),
    retryButton: RaisedButton(
        onPressed: () {},
        child: Text('Try again'.toUpperCase()),
        color: Colors.black38,
        textColor: Colors.white,
    ),
 )

Using without a button

ConfusedTravoltaErrorView(
    errorMessage: 'You have no favorites, yet.',
)

Credits #

Confused Travolta Gif

[1.0.0] - 8/31/2018

  • If neither retryButton nor onTapRetryButton provided, no button is displayed.

  • backgroundColor property is added.

[1.0.0] - 8/24/2018

  • Initial release 🎉

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ConfusedTravoltaErrorView Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        accentColor: Colors.pink,
      ),
      routes: {
        '/': (context) => HomePage(),
      },
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 3,
      child: Scaffold(
        appBar: AppBar(
          title: Text('ConfusedTravoltaErrorView Demo'),
          bottom: TabBar(tabs: [
            Tab(text: 'Default'),
            Tab(text: 'Custom'),
            Tab(text: 'No Button'),
          ]),
        ),
        body: TabBarView(children: [
          ConfusedTravoltaErrorView(
            errorMessage: 'You have no Internet connection.',
            onTapRetryButton: () {},
          ),
          ConfusedTravoltaErrorView(
            backgroundColor: Colors.grey,
            errorText: Text(
              'Ooops! Something went wrong.',
              style: TextStyle(fontSize: 19.0),
            ),
            retryButton: RaisedButton(
              onPressed: () {},
              child: Text('Try again'.toUpperCase()),
              color: Colors.black38,
              textColor: Colors.white,
            ),
          ),
          ConfusedTravoltaErrorView(
            errorMessage: 'You have no favorites, yet.',
          ),
        ]),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  confused_travolta_error_view: ^1.0.1

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

We analyzed this package on Dec 7, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/confused_travolta_error_view.dart.

Run flutter format to format lib/confused_travolta_error_view.dart.

Maintenance suggestions

Package is getting outdated. (-26.58 points)

The package was last published 66 weeks ago.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test