widget_gen 1.0.1+1

  • Readme
  • Changelog
  • Installing
  • new60

Flutter Widget Gen #

flutter pub get
flutter pub run build_runner build
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter_dynamic_widget/flutter_dynamic_widget.dart';

import '../library.dart';

part 'center.g.dart';

@WidgetClass('Center')
class CenterBase extends _$CenterBase {
  CenterBase(this.widgetData, this.widgetContext);

  @WidgetKey.widget(
    acceptWidth: 100,
    acceptHeight: 100,
    defaultValue: 'Placeholder',
  )
  Widget child;
  double heightFactor;
  Key key;
  double widthFactor;

  @override
  final Map<String, dynamic> widgetData;

  @override
  final WidgetContext widgetContext;

  @override
  get onAction => (context, val) => MaterialBase.onAction(context, val);

  @override
  GenerateWidget get widgetRender =>
      (val) => MaterialBase(val, widgetContext).base;
}

1.0.0 #

  • Adding Base Classes

Use this package as a library

1. Depend on it

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


dependencies:
  widget_gen: ^1.0.1+1

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:widget_gen/widget_gen.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
33
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Jul 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • widget_gen that is a package requiring null.

Package not compatible with SDK flutter

Because it is not compatible with any of the supported runtimes: flutter-native, flutter-web

Package not compatible with runtime flutter-native on android

Because:

  • package:widget_gen/widget_gen.dart that imports:
  • package:widget_gen/src/class_annotation_gen.dart that imports:
  • package:widget_gen/src/type_names.dart that imports:
  • package:widget_gen/src/template/comma_list.dart that imports:
  • package:widget_gen/src/template/util.dart that imports:
  • package:source_gen/source_gen.dart that imports:
  • package:source_gen/src/type_checker.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on ios

Because:

  • package:widget_gen/widget_gen.dart that imports:
  • package:widget_gen/src/class_annotation_gen.dart that imports:
  • package:widget_gen/src/type_names.dart that imports:
  • package:widget_gen/src/template/comma_list.dart that imports:
  • package:widget_gen/src/template/util.dart that imports:
  • package:source_gen/source_gen.dart that imports:
  • package:source_gen/src/type_checker.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on linux

Because:

  • package:widget_gen/widget_gen.dart that imports:
  • package:widget_gen/src/class_annotation_gen.dart that imports:
  • package:widget_gen/src/type_names.dart that imports:
  • package:widget_gen/src/template/comma_list.dart that imports:
  • package:widget_gen/src/template/util.dart that imports:
  • package:source_gen/source_gen.dart that imports:
  • package:source_gen/src/type_checker.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on macos

Because:

  • package:widget_gen/widget_gen.dart that imports:
  • package:widget_gen/src/class_annotation_gen.dart that imports:
  • package:widget_gen/src/type_names.dart that imports:
  • package:widget_gen/src/template/comma_list.dart that imports:
  • package:widget_gen/src/template/util.dart that imports:
  • package:source_gen/source_gen.dart that imports:
  • package:source_gen/src/type_checker.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on windows

Because:

  • package:widget_gen/widget_gen.dart that imports:
  • package:widget_gen/src/class_annotation_gen.dart that imports:
  • package:widget_gen/src/type_names.dart that imports:
  • package:widget_gen/src/template/comma_list.dart that imports:
  • package:widget_gen/src/template/util.dart that imports:
  • package:source_gen/source_gen.dart that imports:
  • package:source_gen/src/type_checker.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-web on web

Because:

  • package:widget_gen/widget_gen.dart that imports:
  • package:widget_gen/src/class_annotation_gen.dart that imports:
  • package:widget_gen/src/type_names.dart that imports:
  • package:widget_gen/src/template/comma_list.dart that imports:
  • package:widget_gen/src/template/util.dart that imports:
  • package:source_gen/source_gen.dart that imports:
  • package:source_gen/src/utils.dart that imports:
  • package:build/build.dart that imports:
  • package:build/src/generate/run_post_process_builder.dart that imports:
  • package:build/src/builder/post_process_builder.dart that imports:
  • package:build/src/builder/builder.dart that imports:
  • package:build/src/builder/build_step.dart that imports:
  • package:build/src/asset/reader.dart that imports:
  • package:glob/glob.dart that imports:
  • package:glob/src/list_tree.dart that imports:
  • package:glob/src/io.dart that imports:
  • package:glob/src/io_export.dart that imports:
  • dart:io

Health issues and suggestions

Document public APIs. (-0.24 points)

75 out of 77 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/class_annotation_gen.dart. (-0.50 points)

Analysis of lib/src/class_annotation_gen.dart reported 1 hint:

line 21 col 64: 'typeSystem' is deprecated and shouldn't be used. Use LibraryElement.typeSystem.

Format lib/src/template/properties/list_widget.dart.

Run flutter format to format lib/src/template/properties/list_widget.dart.

Format lib/widget_gen.dart.

Run flutter format to format lib/widget_gen.dart.

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and widget_gen.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.7.0 <3.0.0
analyzer ^0.39.10 0.39.12
build ^1.3.0 1.3.0
flutter 0.0.0
meta ^1.1.8 1.1.8 1.2.1
shortid ^0.1.1 0.1.1
source_gen ^0.9.5 0.9.5
Transitive dependencies
_fe_analyzer_shared 5.0.0
args 1.6.0
async 2.4.2
charcode 1.1.3
collection 1.14.12 1.14.13
convert 2.1.1
crypto 2.1.5
csslib 0.16.1
dart_style 1.3.6
glob 1.2.0
html 0.14.0+3
js 0.6.2
logging 0.11.4
node_interop 1.1.1
node_io 1.1.1
package_config 1.9.3
path 1.7.0
pedantic 1.9.0 1.9.1
pub_semver 1.4.4
sky_engine 0.0.99
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
vector_math 2.0.8
watcher 0.9.7+15
yaml 2.2.1
Dev dependencies
build_runner ^1.10.0
build_version ^2.0.1
flutter_test