flutter_mcq_template 0.0.1 copy "flutter_mcq_template: ^0.0.1" to clipboard
flutter_mcq_template: ^0.0.1 copied to clipboard

A customizable MCQ quiz widget for Flutter apps.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_mcq_template/flutter_mcq_template.dart';


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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'MCQ Package Demo',
      home: Scaffold(
        appBar: AppBar(title: const Text("MCQ Quiz Example")),
        body: MCQQuiz(
          questions: [
            Question(
              text: "What language is used by Flutter?",
              options: ["Dart", "Kotlin", "Swift", "Java"],
              correctIndex: 0,
            ),
            Question(
              text: "Who developed Flutter?",
              options: ["Google", "Apple", "Meta", "Microsoft"],
              correctIndex: 0,
            ),
          ],
          onCompleted: (score) {
            debugPrint("Quiz completed! Score: $score");
          },
        ),
      ),
    );
  }
}
2
likes
130
points
30
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A customizable MCQ quiz widget for Flutter apps.

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on flutter_mcq_template