Skip to content

Dart modular development, event communication template generation plug-in. Dart模块化开发,事件通信模板生成插件

Notifications You must be signed in to change notification settings

azhon/FlutterModuleBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dart modular development, event communication template generation plugin (AS, IDEA)

  • Menu Tools -> Build Flutter Bridge
  • Or use shortcut keysAlt + B

There are several requirements for the Bridge template

  1. A dart file can only have one class, stored in the lib/ directory
  2. The class must be with Bridge
  3. The method must be annotated with @Url
  4. The method parameter must be Map<String, String>, and the return value must be R or Future<R> type

Examples:

import 'package:module_bridge/module_bridge.dart';

class UserBridge with Bridge {

   @Url(url: '/user/getUserId', desc: 'Get UserId')
   R getUserId(Map<String, String> params) {
     return R.ok(data: 1234);
   }

   @Url(url: '/user/getUserName', desc: 'Get user name')
   Future<R> getUserName(Map<String, String> params) async {
     return R.ok(data: 'azhon');
   }
}

About

Dart modular development, event communication template generation plug-in. Dart模块化开发,事件通信模板生成插件

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages