flutter_yaml_to_dart 0.1.8
flutter_yaml_to_dart: ^0.1.8 copied to clipboard
Convert YAML file into Dart model automatically
Use this package as an executable
Install it
You can install the package from the command line:
dart pub global activate flutter_yaml_to_dart
Use it
The package has the following executables:
$ yaml_dart
Use this package as a library
Depend on it
Run this command:
With Dart:
$ dart pub add flutter_yaml_to_dart
With Flutter:
$ flutter pub add flutter_yaml_to_dart
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get
):
dependencies:
flutter_yaml_to_dart: ^0.1.8
Alternatively, your editor might support dart pub get
or flutter pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:flutter_yaml_to_dart/flutter_data.dart';
import 'package:flutter_yaml_to_dart/generators/constructor_generator.dart';
import 'package:flutter_yaml_to_dart/generators/copy_with_generator.dart';
import 'package:flutter_yaml_to_dart/generators/enum_generator.dart';
import 'package:flutter_yaml_to_dart/generators/equatable_generator.dart';
import 'package:flutter_yaml_to_dart/generators/fields_generator.dart';
import 'package:flutter_yaml_to_dart/generators/from_map_generator.dart';
import 'package:flutter_yaml_to_dart/generators/generator.dart';
import 'package:flutter_yaml_to_dart/generators/import_file_generator.dart';
import 'package:flutter_yaml_to_dart/generators/tomap_generator.dart';
import 'package:flutter_yaml_to_dart/model_parser.dart';
import 'package:flutter_yaml_to_dart/models/collection.dart';
import 'package:flutter_yaml_to_dart/models/product.dart';
import 'package:flutter_yaml_to_dart/models/status.dart';
import 'package:flutter_yaml_to_dart/utils.dart';