| // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| |
| import 'dart:async'; |
| import 'package:_fe_analyzer_shared/src/macros/api.dart'; |
| import 'macro_dependency.dart'; |
| |
| macro |
| |
| class MethodMacro implements ClassDeclarationsMacro { |
| const MethodMacro(); |
| |
| @override |
| FutureOr<void> buildDeclarationsForClass(ClassDeclaration clazz, |
| ClassMemberDeclarationBuilder builder) async { |
| builder.declareInClass(new DeclarationCode.fromString(generateBody())); |
| } |
| } |