model2fish 0.0.2

  • Readme
  • Changelog
  • Installing
  • 41

model2fish #

model2fish is a dart library for gen fish-redux-template from model;

three steps for gen:

  1. Preparing Json files
  2. Run flutter pub run model2fish:main
  3. Use it to coding

Installation #

Add these libraries into pubspec.yaml

dev_dependencies:
    model2fish: 0.0.2

Usage #

cli #

>flutter pub run model2fish:main -h
-s, --source-dir    A source folder contains all string json files
                    (defaults to "example/")

-o, --output-dir    A output folder stores all generated files
                    (defaults to "generate/")

-h, --help          Instance:
                    > pub run fish-gens:main
                    read from example/fish_domain,
                    output to lib/generated,
                    & source file need start with f. to work
[WARNING]: xxxx.dart does not match naming pattern [f.{locale}.json]
[INFO]: xxxxx/fish_example/generate/todo_edit/action.dart is OK
[INFO]: xxxxx/fish_example/generate/todo_edit/reducer.dart is OK
[INFO]: xxxxx/fish_example/generate/todo_edit/effect.dart is OK
[INFO]: xxxxx/fish_example/generate/todo_edit/state.dart is OK
[INFO]: xxxxx/fish_example/generate/todo_edit/page.dart is OK
[INFO]: xxxxx/fish_example/generate/todo_edit/view.dart is OK

json #

/// example/f.todo.edit.json
{
    "DomainName" : "TodoEdit",
    "Attrs":[
      {"toDo":"Parent"},
      {"nameEditController": "TextEditingController"},
      {"descEditController": "TextEditingController"},
      {"focusNodeName":"FocusNode"},
      {"focusNodeDesc":"FocusNode"}
    ],
    "Actions":[
      {"onEdit":[]},
      {"edit":[{"name":"String"},{"desc":"String"}]},
      {"done":[]},
      {"onRemove":[]},
      {"remove":[]}
    ]
}

welcome to PF ^_^

0.0.2 #

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

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


dependencies:
  model2fish: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


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

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

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: web, other

Primary library: package:model2fish/model2fish.dart with components: mirrors.

Health suggestions

Format bin/main.dart.

Run dartfmt to format bin/main.dart.

Format lib/code_replace/action/action.dart.

Run dartfmt to format lib/code_replace/action/action.dart.

Format lib/code_replace/action/action_creator.dart.

Run dartfmt to format lib/code_replace/action/action_creator.dart.

Fix additional 46 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/code_replace/action/action_creator_item.dart (Run dartfmt to format lib/code_replace/action/action_creator_item.dart.)
  • lib/code_replace/action/index.dart (Run dartfmt to format lib/code_replace/action/index.dart.)
  • lib/code_replace/effect/effect.dart (Run dartfmt to format lib/code_replace/effect/effect.dart.)
  • lib/code_replace/effect/effect_method.dart (Run dartfmt to format lib/code_replace/effect/effect_method.dart.)
  • lib/code_replace/effect/effect_method_item.dart (Run dartfmt to format lib/code_replace/effect/effect_method_item.dart.)
  • lib/code_replace/effect/index.dart (Run dartfmt to format lib/code_replace/effect/index.dart.)
  • lib/code_replace/index.dart (Run dartfmt to format lib/code_replace/index.dart.)
  • lib/code_replace/page.dart (Run dartfmt to format lib/code_replace/page.dart.)
  • lib/code_replace/reducer/index.dart (Run dartfmt to format lib/code_replace/reducer/index.dart.)
  • lib/code_replace/reducer/reducer.dart (Run dartfmt to format lib/code_replace/reducer/reducer.dart.)
  • lib/code_replace/reducer/reducer_clone.dart (Run dartfmt to format lib/code_replace/reducer/reducer_clone.dart.)
  • lib/code_replace/reducer/reducer_clone_item.dart (Run dartfmt to format lib/code_replace/reducer/reducer_clone_item.dart.)
  • lib/code_replace/reducer/reducer_method.dart (Run dartfmt to format lib/code_replace/reducer/reducer_method.dart.)
  • lib/code_replace/reducer/reducer_method_item.dart (Run dartfmt to format lib/code_replace/reducer/reducer_method_item.dart.)
  • lib/code_replace/state/attr.dart (Run dartfmt to format lib/code_replace/state/attr.dart.)
  • lib/code_replace/state/index.dart (Run dartfmt to format lib/code_replace/state/index.dart.)
  • lib/code_replace/state/state.dart (Run dartfmt to format lib/code_replace/state/state.dart.)
  • lib/code_replace/state/state_init.dart (Run dartfmt to format lib/code_replace/state/state_init.dart.)
  • lib/code_replace/view.dart (Run dartfmt to format lib/code_replace/view.dart.)
  • lib/manage/core_manage.dart (Run dartfmt to format lib/manage/core_manage.dart.)
  • lib/manage/file_tool.dart (Run dartfmt to format lib/manage/file_tool.dart.)
  • lib/manage/fish_option.dart (Run dartfmt to format lib/manage/fish_option.dart.)
  • lib/util_package/fish_template/actions_str.dart (Run dartfmt to format lib/util_package/fish_template/actions_str.dart.)
  • lib/util_package/fish_template/effect_str.dart (Run dartfmt to format lib/util_package/fish_template/effect_str.dart.)
  • lib/util_package/fish_template/index.dart (Run dartfmt to format lib/util_package/fish_template/index.dart.)
  • lib/util_package/fish_template/page_str.dart (Run dartfmt to format lib/util_package/fish_template/page_str.dart.)
  • lib/util_package/fish_template/reducer_str.dart (Run dartfmt to format lib/util_package/fish_template/reducer_str.dart.)
  • lib/util_package/fish_template/state_str.dart (Run dartfmt to format lib/util_package/fish_template/state_str.dart.)
  • lib/util_package/fish_template/view_str.dart (Run dartfmt to format lib/util_package/fish_template/view_str.dart.)
  • lib/util_package/index.dart (Run dartfmt to format lib/util_package/index.dart.)
  • lib/util_package/model/action.dart (Run dartfmt to format lib/util_package/model/action.dart.)
  • lib/util_package/model/action.g.dart (Run dartfmt to format lib/util_package/model/action.g.dart.)
  • lib/util_package/model/actions.dart (Run dartfmt to format lib/util_package/model/actions.dart.)
  • lib/util_package/model/attr.dart (Run dartfmt to format lib/util_package/model/attr.dart.)
  • lib/util_package/model/attr.g.dart (Run dartfmt to format lib/util_package/model/attr.g.dart.)
  • lib/util_package/model/attrs.dart (Run dartfmt to format lib/util_package/model/attrs.dart.)
  • lib/util_package/model/attrs.g.dart (Run dartfmt to format lib/util_package/model/attrs.g.dart.)
  • lib/util_package/model/domain.dart (Run dartfmt to format lib/util_package/model/domain.dart.)
  • lib/util_package/model/domain.g.dart (Run dartfmt to format lib/util_package/model/domain.g.dart.)
  • lib/util_package/model/effects.dart (Run dartfmt to format lib/util_package/model/effects.dart.)
  • lib/util_package/model/index.dart (Run dartfmt to format lib/util_package/model/index.dart.)
  • lib/util_package/model/reducers.dart (Run dartfmt to format lib/util_package/model/reducers.dart.)
  • lib/util_package/str_replace_baseclass/domain_handle.dart (Run dartfmt to format lib/util_package/str_replace_baseclass/domain_handle.dart.)
  • lib/util_package/str_replace_baseclass/handle.dart (Run dartfmt to format lib/util_package/str_replace_baseclass/handle.dart.)
  • lib/util_package/str_replace_baseclass/index.dart (Run dartfmt to format lib/util_package/str_replace_baseclass/index.dart.)
  • lib/util_package/str_replace_baseclass/util_str.dart (Run dartfmt to format lib/util_package/str_replace_baseclass/util_str.dart.)

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/huang12zheng/model2fish/tree/master/model2fish was unreachable.

The package description is too short. (-16 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and model2fish.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
ansicolor ^1.0.2 1.0.2
args >=0.12.1 <2.0.0 1.5.2
path ^1.4.1 1.6.4
Dev dependencies
pedantic ^1.0.0
test ^1.0.0