write method
Implementation
@override
Method write() {
return Method((builder) => builder
..annotations.add(overrideAnnotationExpression)
..returns = refer(method.returnType.getDisplayString(
withNullability: true,
))
..name = method.name
..requiredParameters.addAll(_generateParameters())
..modifier = MethodModifier.async
..body = Code(_generateMethodBody()));
}