JavaFunctionSetter constructor

JavaFunctionSetter(
  1. Variable field, {
  2. int depth = 0,
})

Implementation

JavaFunctionSetter(Variable field, {int depth = 0})
    : super(
          functionName:
              'set${field.name[0].toUpperCase()}${field.name.substring(1)}',
          params: [field],
          body: (depth) => [
                OneLine(
                    depth: depth + 1,
                    body: 'this.${field.name} = ${field.name};')
              ],
          returnType: const AstVoid(),
          isPublic: true,
          isStatic: false,
          oneLine: true,
          depth: depth);