body method
Defines the actual body code. path
is passed relative to lib
, baseName
is the filename, and className
is the filename converted to Pascal case.
実際の本体コードを定義します。path
にlib
からの相対パス、baseName
にファイル名が渡され、className
にファイル名をパスカルケースに変換した値が渡されます。
Implementation
@override
String body(String path, String baseName, String className) {
return """
/// App Model.
///
/// By replacing this with another adapter, the data storage location can be changed.
// TODO: Change the database.
final modelAdapter = runtimeModelAdapter;
/// App Auth.
///
/// Changing to another adapter allows you to change to another authentication mechanism.
// TODO: Change the authentication.
final authAdapter = runtimeAuthAdapter;
/// App Storage.
///
/// Changing to another adapter allows you to change to another storage mechanism.
// TODO: Change the storage.
final storageAdapter = runtimeStorageAdapter;
/// App Functions.
///
/// Changing to another adapter allows you to change to another functions mechanism.
// TODO: Change the functions.
final functionsAdapter = runtimeFunctionsAdapter;
/// Logger adapter list.
///
/// Adapters for logging can be defined here.
// TODO: Change the loggers.
final loggerAdapters = runtimeLoggerAdapters;
/// Masamune adapter list.
///
/// The Masamune framework plugin functions can be defined together.
// TODO: Add the adapters.
final masamuneAdapters = runtimeMasamuneAdapters;
/// Test user id.
///
/// Please set up mock data using this.
const testUserUid = "${uuid()}";
/// Current time.
///
/// Set the current time for testing.
///
/// Please set up mock data using this.
final testCurrentTime = Clock(${Clock.now().year}, 1, 1, 12, 0, 0);
/// App Model.
///
/// Testing model adapter.
final runtimeModelAdapter = RuntimeModelAdapter();
/// App Auth.
///
/// Test Auth adapter.
final runtimeAuthAdapter = RuntimeAuthAdapter();
/// App Storage.
///
/// Testing storage adapter.
final runtimeStorageAdapter = LocalStorageAdapter();
/// App Functions.
///
/// Testing functions adapter.
final runtimeFunctionsAdapter = RuntimeFunctionsAdapter();
/// Logger adapter list.
///
/// Testing logger adapter list.
final runtimeLoggerAdapters = <LoggerAdapter>[
const ConsoleLoggerAdapter(),
];
/// Masamune adapter list.
///
/// Testing masamune adapter list.
final runtimeMasamuneAdapters = <MasamuneAdapter>[
const UniversalMasamuneAdapter(),
${module != null ? "appModule," : ""}
];
""";
}