Giter Club home page Giter Club logo

flutter_customizable_flashcards's Introduction

Flutter Test

This is a package that uses the flash_card as foundation and adds additional functionality to it. I make this package, because the original author didnt made a new version in over 17 months so I assumed its no longer maintained.

Features

  • change the appereance of the flashcard(color, gradient, size)
  • ontap callback
  • onFlip callback

Getting started

check how to install here

Usage

Basic example:

FlashCard(
    frontWidget: Text("Front"),
    backWidget: Text("Back"),
    )

Complex Example:

FlashCard(
    ontap: () {
    setState(() {
        isTapped = true;
    });
    },
    onFlip: (newSide) {
    setState(() {
        side = newSide;
    });
    },
    frontWidget: const Center(child: Text("Front")),
    backWidget: const Center(child: Text("Back")),
    frontGradient: const LinearGradient(
    colors: [Colors.red, Colors.blue],
    ),
    backGradient: const LinearGradient(
    colors: [Colors.red, Colors.blue],
    )),

This code produces this result:

example gif

Parameter

Widgets

frontWidget: takes a widget as a parameter to show on the front of the card. (required)

backWidget: takes a widget as a parameter to show on the back of the card. (required)

Size

height: takes a double as a parameter to set the height of the card. (default: 200)

width: takes a double as a parameter to set the width of the card. (default: 200)

Styling

frontColor: takes a color as a parameter to show on the front of the card. (default: Colors.white)

backColor: takes a color as a parameter to show on the back of the card. (default: Colors.white)

frontGradient: takes a gradient as a parameter to show on the front of the card. (default: null)

backGradient: takes a gradient as a parameter to show on the back of the card. (default: null)

borderRadius: takes a border radius as a parameter to set the border radius of the card. (default: 20)

border: takes a border as a parameter for the case you want to have a border. (default: null)

callbacks

ontap: takes a function as a parameter to call when the card is tapped. (required)

onFlip: takes a function as a parameter to call when the card is flipped. Returns also the current side after the flip. (default: null)

Additional information

I appreciate every PR, so feel free to contribute. I will also look through all the issues on github and try to fix them as soon as possible.

flutter_customizable_flashcards's People

Contributors

oxelf avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.