router.dart 677 B

1234567891011121314151617181920212223242526272829303132
  1. /// global instance
  2. final _Router router = _Router();
  3. class _Router {
  4. Set<String> imports = Set<String>();
  5. Map<String, Page> routerMap = <String, Page>{};
  6. }
  7. class Page {
  8. String path;
  9. String name;
  10. List<Argument> arguments;
  11. @override
  12. String toString() {
  13. return "{routerPath:${this.path},name:${this.name},arguments:${this.arguments.toString()}}";
  14. }
  15. }
  16. class Argument {
  17. String name;
  18. String type;
  19. bool isImported;
  20. bool required;
  21. Argument(this.name, this.type, this.required, {this.isImported=false});
  22. @override
  23. String toString() {
  24. return "{name:${this.name},type:${this.type},imported:${this.isImported},required:${this.required}}";
  25. }
  26. }