📝 rubric_builder

Author weighted grading rubrics in Flutter — with a live points total

A widget to add, edit and remove rubric criteria, backed by a clean, immutable, controller-free data model.

pub package pub points likes CI license: MIT


The widget owns its TextEditingControllers internally and only ever hands you immutable RubricDraft values — so there are no leaked controllers and your state stays serializable.

Features

  • ➕ Add / ✏ïļ edit / 🗑ïļ remove rubric criteria
  • ðŸ§Ū Live points total that updates as you type
  • ✅ Per-criterion "auto-graded" toggle (mark some for manual grading)
  • 🧊 Immutable, controller-free, JSON-serializable RubricDraft model
  • ðŸŠķ Zero non-Flutter dependencies

Install

dependencies:
  rubric_builder: ^0.1.1

or flutter pub add rubric_builder.

Usage

import 'package:rubric_builder/rubric_builder.dart';

List<RubricDraft> rubrics = const [
  RubricDraft(description: 'Correct answer', requirement: 'Final value is right', points: 5),
  RubricDraft(description: 'Shows working',  requirement: 'Steps are shown',       points: 3),
];

RubricBuilder(
  initial: rubrics,
  onChanged: (updated) => setState(() => rubrics = updated),
);

The RubricDraft model is JSON-serializable and has value equality:

final json = rubric.toJson();
final back = RubricDraft.fromJson(json);   // == rubric
final total = RubricDraft.total(rubrics);  // sum of points
Customisation options
RubricBuilder(
  initial: rubrics,
  onChanged: (v) => ...,
  addButtonLabel: 'Add criterion', // button text
  showAutoGraded: true,            // show the per-row auto-graded checkbox
  showTotal: true,                 // show the running total header
);

Pairs well with

Part of the Flutter Grading Toolkit: author rubrics here, then grade answers with ai_rubric_grader — the field names line up.

Contributing

Issues and PRs welcome. Run flutter test before submitting.

License

MIT ÂĐ 2026 Muhammad Ali

Libraries

rubric_builder
A Flutter widget + model for authoring weighted grading rubrics.