confused_travolta_error_view 1.0.1 copy "confused_travolta_error_view: ^1.0.1" to clipboard
confused_travolta_error_view: ^1.0.1 copied to clipboard

A fun way to display error view.

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.',
          ),
        ]),
      ),
    );
  }
}
1
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A fun way to display error view.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on confused_travolta_error_view