confused_travolta_error_view 1.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 67

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 packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
1.0.1 Aug 31, 2018 Go to the documentation of confused_travolta_error_view 1.0.1 Download confused_travolta_error_view 1.0.1 archive
1.0.0 Aug 24, 2018 Go to the documentation of confused_travolta_error_view 1.0.0 Download confused_travolta_error_view 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
43
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

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
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test