code

package
v0.0.0-...-201b726 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const KEY_AWAIT string = `$await$`
View Source
const KEY_EVENT_DEFINE string = `$EventDefine$`
View Source
const KEY_EVENT_DEFINE_PARAM string = `$EventDefineParam$`
View Source
const KEY_MAP_EVENT_BLOCK string = `$mapEventBlock$`
View Source
const KEY_MODULE_NAME_CAMEL string = `$ModuleNameCamel$`
View Source
const KEY_MODULE_NAME_LOGICAL string = `$ModuleNameLogical$`
View Source
const KEY_MODULE_NAME_SNAKE string = `$ModuleNameSnake$`
View Source
const KEY_PARAM string = `$Param$`
View Source
const KEY_PARAM_CONSTRUCTOR string = `$ParamConstructor$`
View Source
const KEY_PARAM_LOGICAL string = `$ParamLogical$`
View Source
const KEY_PARAM_PROPS string = `$ParamProps$`
View Source
const KEY_PROCESS_CAMEL string = `$ProcessNameCamel$`
View Source
const KEY_PROCESS_LOGICAL string = `$ProcessNameLogical$`
View Source
const KEY_PROCESS_LOWER_CAMEL string = `$ProcessNameLowerCamel$`
View Source
const KEY_PROJECT_NAME_LOGICAL string = `$ProjectNameLogical$`
View Source
const KEY_PROJECT_NAME_SNAKE string = `$ProjectNameSnake$`
View Source
const KEY_SERVICE_IMPL_PROCESS_BLOCK string = `$ServiceImplProcessBlock$`
View Source
const KEY_SERVICE_PROCESS_BLOCK string = `$ServiceProcessBlock$`
View Source
const KW_CLASS string = `class`
View Source
const KW_FINAL string = `final`
View Source
const KW_VIEW_SUFFIX string = `View`
View Source
const TMPL_AWAIT string = `await `
View Source
const TMPL_BLOC string = `
export '$ModuleNameSnake$_bloc.dart';
export '$ModuleNameSnake$_event.dart';
export '$ModuleNameSnake$_state.dart';
`

bloc.dart

View Source
const TMPL_BLOC_BLOC string = `` /* 1117-byte string literal not displayed */

xxx_bloc.dart

View Source
const TMPL_BLOC_EVENT string = `` /* 438-byte string literal not displayed */

xxx_event.dart

View Source
const TMPL_BLOC_STATE string = `` /* 746-byte string literal not displayed */

xxx_state.dart

View Source
const TMPL_EVENT_DEFINE string = `` /* 347-byte string literal not displayed */
View Source
const TMPL_EVENT_DEFINE_PARAM string = `
  /// $ParamLogical$
  $Param$;
`
View Source
const TMPL_MAP_EVENT_BLOCK string = `` /* 308-byte string literal not displayed */
View Source
const TMPL_SERVICE string = `` /* 360-byte string literal not displayed */
View Source
const TMPL_SERVICE_IMPL string = `` /* 460-byte string literal not displayed */
View Source
const TMPL_SERVICE_IMPL_PROCESS_ASYNC string = `` /* 199-byte string literal not displayed */
View Source
const TMPL_SERVICE_IMPL_PROCESS_SYNC string = `` /* 220-byte string literal not displayed */
View Source
const TMPL_SERVICE_PROCESS_ASYNC string = `` /* 175-byte string literal not displayed */
View Source
const TMPL_SERVICE_PROCESS_SYNC string = `` /* 167-byte string literal not displayed */

Variables

This section is empty.

Functions

func GenerateModule

func GenerateModule(moduleInfo ModuleInfo)

/ 林

func ToBlocView

func ToBlocView(file string) (string, error)

func ToBlocViewConstructor

func ToBlocViewConstructor(moduleViewDefine ModuleViewDefine) string

func ToBlocViewCopyWith

func ToBlocViewCopyWith(moduleViewDefine ModuleViewDefine) string

func ToBlocViewFromModel

func ToBlocViewFromModel()

func ToBlocViewGetProps

func ToBlocViewGetProps(propertyTokens []PropertyToken) string

Types

type ModuleInfo

type ModuleInfo struct {
	ProjectName        string        // 项目名
	ProjectLogicalName string        // 项目理论名
	RootPath           string        // 根目录
	ModuleName         string        // 机能名
	ModuleLogicalName  string        // 机能理论名
	ProcessInfos       []ProcessInfo // 处理信息列表
}

/ 机能信息

type ModuleViewDefine

type ModuleViewDefine struct {
	ModuleName         string
	PropertyTokens     []PropertyToken
	OrigionalCode      string
	LinePropertyEnd    int
	LineClassDefineEnd int
}

模块View关联

func ReadView

func ReadView(file string) (ModuleViewDefine, error)

type ParamInfo

type ParamInfo struct {
	ParamLogical string
	ParamType    string
	Param        string
}

/ 参数信息

type ProcessInfo

type ProcessInfo struct {
	ProcessName        string // 处理名()
	ProcessLogicalName string // 处理理论名
	IsAsync            bool   // 异步标志(true: 异步 false: 同步)

	EventParamInfo []ParamInfo // Event参数信息
}

/ 处理信息

type PropertyToken

type PropertyToken struct {
	PropertyType string // 属性类型
	PropertyVar  string // 属性名(物理名)
}

属性Token

type Tmpl

type Tmpl struct {
	TmplBloc     string `yaml:"tmplBloc"`     //
	TmplBlocBloc string `yaml:"tmplBlocBloc"` //
}

输入项

func ReadTmpl

func ReadTmpl(file string) (Tmpl, error)

读取模板

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL