nrb 1.0.6 copy "nrb: ^1.0.6" to clipboard
nrb: ^1.0.6 copied to clipboard

A Flutter package for building structured and customizable report layouts.

example/lib/main.dart

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


void main() {
  runApp(MyReportBuilderApp());
}

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

  @override
  State<MyReportBuilderApp> createState() => _MyReportBuilderAppState();
}

class _MyReportBuilderAppState extends State<MyReportBuilderApp> {
  final List<HeaderCell> headers = [
    HeaderCell(text: "Secondary", span: 3, backgroundColor: Colors.green,),
    HeaderCell(text: "Primary", span: 3,backgroundColor: Colors.green),
  ];

  final List<SubHeaderCell> subHeaders = [
    SubHeaderCell(text: "Target", backgroundColor: Colors.green, width: 80.0,),
    SubHeaderCell(text: "Actual", backgroundColor: Colors.green, width: 80.0,),
    SubHeaderCell(text: "%", backgroundColor: Colors.green, width: 50.0,),
    SubHeaderCell(text: "Target", backgroundColor: Colors.green),
    SubHeaderCell(text: "Actual", backgroundColor: Colors.green),
    SubHeaderCell(text: "%", backgroundColor: Colors.green),
  ];

  final leftColumns = [
    TextCell(itemContent: "01-Nov-2025", ),
    TextCell(itemContent: "02-Nov-2025", ),
    TextCell(itemContent: "03-Nov-2025", ),
    TextCell(itemContent: "04-Nov-2025", ),
  ];

  final tableData = [
    [
      TextCell(itemContent: "10,99,493", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "9,34,839", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "85.07%"),
      TextCell(itemContent: "10,99,493", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "9,34,839", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "85.07%"),
    ],
    [
      TextCell(itemContent: "10,99,493", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "9,34,839", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "85.07%"),
      TextCell(itemContent: "10,99,493", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "9,34,839", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "85.07%"),
    ],
    [
      TextCell(itemContent: "10,99,493", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "9,34,839", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "85.07%"),
      TextCell(itemContent: "10,99,493", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "9,34,839", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "85.07%"),
    ],
    [
      TextCell(itemContent: "10,99,493", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "9,34,839", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "85.07%"),
      TextCell(itemContent: "10,99,493", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "9,34,839", textAlignment: Alignment.centerRight),
      TextCell(itemContent: "85.07%"),
    ],
  ];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(primarySwatch: Colors.blue),
      home: Scaffold(
        appBar: AppBar(title: const Text('Report Builder')),
        body: ReportMaker(
          headers: headers,
          subHeaders: subHeaders,
          leftColumn: leftColumns,
          tableData: tableData,
          stickyHeaderLabel: "Tran",
          stickyHeaderBackgroundColor: Colors.green,
        ),
      ),
    );
  }
}
4
likes
0
points
486
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for building structured and customizable report layouts.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on nrb