dynamic_forms 0.5.0

dynamic_forms #

pub package

Dart library providing infrastructure to define custom form model, parse it from external XML or JSON and execute operations on it.

0.5.0 #

Removed screaming caps convention.

0.4.0 #

  • Added abstraction over XML parser.
  • Added JSON parser.

0.3.0 #

Specific models and parsers were moved to the flutter_dynamic_forms_components package.

0.2.0 #

FormManager API Changes.

0.1.1 #

Updated the project description.

0.1.0 #

Initial Version of the library.

example/main.dart

import 'package:dynamic_forms/dynamic_forms.dart';

import 'components/container/container_parser.dart';
import 'components/label/label.dart';
import 'components/label/label_parser.dart';

void main() {
  var xml = '''<?xml version="1.0" encoding="UTF-8"?>
      <container id="container1">
        <label
          id="label1"
          value="John Doe" />
        <label
          id="label2">
          <label.value>
            <expression><![CDATA[
              "Welcome " + @label1 + "!"
            ]]></expression>
          </label.value>
        </label>
      </container>''';

  var formManagerBuilder = FormManagerBuilder(
      XmlFormParserService([ContainerParser(), LabelParser()]));
  FormManager formManager = formManagerBuilder.build(xml);
  var label2 = formManager.formElementMap["label2"] as Label;
  print(label2.value);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dynamic_forms: ^0.5.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dynamic_forms/dynamic_forms.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
38
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
68
Learn more about scoring.

We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:dynamic_forms/dynamic_forms.dart.

Health issues and suggestions

Document public APIs. (-1 points)

164 out of 164 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/parser/json/json_parser_node.dart. (-0.50 points)

Analysis of lib/src/parser/json/json_parser_node.dart reported 1 hint:

line 35 col 12: Avoid using null in if null operators.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
expression_language ^0.1.3 0.1.3
quiver ^2.0.1 2.0.5
rxdart ^0.22.0 0.22.1+1
uuid ^2.0.1 2.0.2
xml ^3.3.1 3.5.0
Transitive dependencies
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.2
matcher 0.12.5
meta 1.1.7
path 1.6.4
petitparser 2.4.0
rational 0.3.5
stack_trace 1.9.3
typed_data 1.1.6
Dev dependencies
test ^1.5.3
test_coverage ^0.2.3