betto_recordset 0.1.0-dev.1 copy "betto_recordset: ^0.1.0-dev.1" to clipboard
betto_recordset: ^0.1.0-dev.1 copied to clipboard

A pure-Dart package for managing tabular data as typed, validated sets of records.

example/example.dart

// Copyright 2026 The Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:betto_recordset/betto_recordset.dart';
import 'package:collection/collection.dart';

void main() {
  const csvData = [
    'id,name,rating',
    '1,Black Forest Cake,5.0',
    '2,Trifle,3.5',
    '3,Ice cream cake,2.0',
    '4,Tiramisu,4.5',
    '5,Chocolate cake,3.0,Very Dry',
    '6,Fruit Pizza,0.5',
  ];

  final rs = RecordSet(
    header: RecordSetHeader.fromStrings(csvData[0].split(',')),
  );

  for (final row in csvData.slice(1)) {
    rs.newRecord(row.split(','));
  }

  print('HTML: ');
  final html = Renderer(formatHtml).render(rs);
  print(html);

  print('\n\nJSON: ');
  final json = Renderer(formatJson).render(rs);
  print(json);

  print('\nText: ');
  final text = Renderer(formatText).render(rs);
  print(text);
}
0
likes
160
points
33
downloads

Documentation

API reference

Publisher

verified publisherbettongia.com

Weekly Downloads

A pure-Dart package for managing tabular data as typed, validated sets of records.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

betto_common, betto_schema, collection

More

Packages that depend on betto_recordset