fallstrick_mvc 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 46

fallstrick_mvc #

language license

Usage #

A simple usage example:

import 'package:fallstrick_mvc/fallstrick_mvc.dart';
import 'package:fallstrick_hosting/fallstrick_hosting.dart';


void main() {
  createWebHostBuilder('localhost', 8080).build().run();
  MVCReflection.doScan();
}

WebHostBuilder createWebHostBuilder(String address, int port) {
  return WebHostBuilder().useHttpListener(address, port).configure((app) {
    app.use(fallStrickMVC);
  });
}

@controller
class HelloController {
  void helloWorld() {
     print('helloworld')
  }
}

We should use this package with fallstrick_routing and fallstrick_hosting

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.0.1 #

  • publish beta version

0.0.2 #

  • fix bug that the same url and the different method will throw exception
  • response decoupling

example/fallstrick_mvc_example.dart

import 'package:fallstrick_mvc/fallstrick_mvc.dart';
import 'package:fallstrick_hosting/fallstrick_hosting.dart';

void main() {
  createWebHostBuilder('localhost', 8080).build().run();
  MVCReflection.doScan();
}

WebHostBuilder createWebHostBuilder(String address, int port) {
  return WebHostBuilder().useHttpListener(address, port).configure((app) {
    app.use(fallStrickMVC);
  });
}

@controller
class HelloController {
  void helloWorld() {
     print('helloworld');
  }
}

Use this package as a library

1. Depend on it

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


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

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

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

Fix lib/src/controller/mvc_controller.dart. (-0.50 points)

Analysis of lib/src/controller/mvc_controller.dart reported 1 hint:

line 30 col 18: This function has a return type of 'InstanceMirror', but doesn't end with a return statement.

Format lib/src/annotation/controller_annotation.dart.

Run dartfmt to format lib/src/annotation/controller_annotation.dart.

Format lib/src/reflection/mvc_reflection.dart.

Run dartfmt to format lib/src/reflection/mvc_reflection.dart.

Maintenance suggestions

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.

The package description is too short. (-8 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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
fallstrick_hosting ^0.0.2 0.0.3
Dev dependencies
pedantic ^1.8.0
test ^1.6.0