flutter_confusion_matrix 0.0.2 copy "flutter_confusion_matrix: ^0.0.2" to clipboard
flutter_confusion_matrix: ^0.0.2 copied to clipboard

Package for creating and visualizing Confusion Matrices with a customizable heatmap.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Confusion Matrix'),
      ),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Center(
            child: ConfusionMatrix(
              xAxis: const ['A', 'B', 'C'],
              yAxis: const ['A', 'B', 'C'],
              data: const [
                [100, 33, 5],
                [20, 150, 70],
                [10, 30, 100],
              ],
              color: Colors.green,
              cellWidth: 100,
              cellHeight: 100,
              backgroundOpacity: 3,
              xAxisStyle: const TextStyle(color: Colors.black, fontSize: 16),
              yAxisStyle: const TextStyle(color: Colors.black, fontSize: 16),
            ),
          ),
        ],
      ),
    );
  }
}
3
likes
150
points
40
downloads

Publisher

unverified uploader

Weekly Downloads

Package for creating and visualizing Confusion Matrices with a customizable heatmap.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on flutter_confusion_matrix