Skip to content

aryzhov/flutter-rolodex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rolodex

A Flutter widget that turns a value into an animated deck of cards. It can be used for showing team scores, stock quotes, bonus points, etc.

animated image

Getting Started

  1. Add a dependency on rolodex package in pubspec.yaml:
dependencies:
  rolodex: any
  1. Import the library:
import 'package:rolodex/rolodex.dart';
  1. Wrap a widget that shows a value with Rolodex:
Rolodex(
  value: _counter,  // <-- Make sure to specify the value 
  child: Text(      // <-- The wrapped widget
    '$_counter',
    style: Theme.of(context).textTheme.display1,
  ),
),

You can try this with the default Flutter app generated by flutter create.

Customization

Rolodex provides limited but extensive customization capabilities via themes. You can customize Rolodex by specifying theme attributes, for example:

Rolodex(
  theme: const RolodexThemeData(
    direction: RolodexDirection.reversed,
    cardColor: Colors.blue,
    shadowColor: Colors.indigo,
    clipBorderRadius: BorderRadius.all(Radius.circular(6)),
    alwaysShowBackground: true,
  ),
  value: _counter,
  child: SizedBox(
    width: 60,
    height: 60,
    child: Center(
      child: Text("$_counter",
        style: Theme.of(context).textTheme.display1.copyWith(
          fontSize: 40, color: Colors.white,
        ),
      ),
    ),
  ),
),

Global Settings

Instead of customizing every Rolodex widget in your app, you might want to specify global theme settings via RolodexTheme:

return MaterialApp(
  title: 'Flutter Demo',
  theme: ThemeData(
    primarySwatch: Colors.blue,
  ),
  home: RolodexTheme(
    data: const RolodexThemeData(  // <-- These settings will apply to all Rolodex widgets in the widget tree
      mode: RolodexMode.splitFlap,
      maxCards: 2,
      animationDuration: const Duration(milliseconds: 200),
    ),
    child: MyHomePage(title: 'Flutter Demo Home Page')
  ),
);

About

A Flutter widget that represents a roll of cards.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages