string_res 1.2.1 copy "string_res: ^1.2.1" to clipboard
string_res: ^1.2.1 copied to clipboard

A Dart Builder for creating a class with String constants from a JSON file.

example/lib/example.dart

import 'dart:io';
import 'dart:convert';
import 'strings.dart';

Future<void> main() async {
  // expect current dir to be top-level of this package
  final file = File('assets/data/strings.json');
  final data = json.decode(await file.readAsString());
  print('foo value is: ${data[SR.FOO]}');
}
1
likes
40
points
24
downloads

Publisher

verified publishermanichord.com

Weekly Downloads

A Dart Builder for creating a class with String constants from a JSON file.

Repository (GitHub)

License

BSD-3-Clause (license)

Dependencies

build, build_config, dart_style, glob, meta, path

More

Packages that depend on string_res