customizable_flashcard 0.1.4 copy "customizable_flashcard: ^0.1.4" to clipboard
customizable_flashcard: ^0.1.4 copied to clipboard

A highly customizable flashcard widget. It allows you to use a study like flashcard that you can customize to your liking.

example/lib/main.dart

import 'package:customizable_flashcard/flashcard_side_enum.dart';
import 'package:flutter/material.dart';
import 'package:customizable_flashcard/customizable_flashcard.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatefulWidget {
  const MainApp({super.key});

  @override
  State<MainApp> createState() => _MainAppState();
}

class _MainAppState extends State<MainApp> {
  bool isTapped = false;
  FlashCardSide side = FlashCardSide.front;
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              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],
                  )),
              Text("isPressed: $isTapped"),
              Text("current side: $side"),
            ],
          ),
        ),
      ),
    );
  }
}
3
likes
150
pub points
40%
popularity

Publisher

unverified uploader

A highly customizable flashcard widget. It allows you to use a study like flashcard that you can customize to your liking.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on customizable_flashcard