Skip to content

Commit 21b9a0e

Browse files
fix: address review feedback on PR #1622
Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com>
1 parent 1afaa7a commit 21b9a0e

2 files changed

Lines changed: 9 additions & 55 deletions

File tree

lib/src/commands/create/commands/flutter_app.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import 'package:very_good_cli/src/commands/create/templates/templates.dart';
44
/// {@template very_good_create_flutter_app_command}
55
/// A [CreateSubCommand] for creating Flutter apps.
66
/// {@endtemplate}
7-
class CreateFlutterApp extends CreateSubCommand with OrgName, MultiTemplates {
7+
class CreateFlutterApp extends CreateSubCommand
8+
with OrgName, MultiTemplates, Publishable {
89
/// {@macro very_good_create_flutter_app_command}
910
CreateFlutterApp({
1011
required super.logger,

test/src/commands/create/commands/flutter_app_test.dart

Lines changed: 7 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Usage: very_good create flutter_app <project-name> [arguments]
3737
3838
--org-name The organization for this new project.
3939
(defaults to "com.example.verygoodcore")
40+
--publishable Whether the generated project is intended to be published.
4041
--application-id The bundle identifier on iOS or application id on Android. (defaults to <org-name>.<project-name>)
4142
--platforms The platforms supported by the app. By default, all platforms are enabled. Example: --platforms=android,ios
4243
@@ -178,52 +179,15 @@ void main() {
178179
templateName: 'core',
179180
mockArgs: {
180181
'application-id': 'xyz.app.my_app',
181-
'platforms': const [
182-
'android',
183-
'ios',
184-
'macos',
185-
'web',
186-
'windows',
187-
],
182+
'platforms': ['android', 'ios', 'macos', 'web', 'windows'],
188183
},
189184
expectedVars: {
190185
'project_name': 'my_app',
191186
'description': '',
192187
'org_name': 'com.example.verygoodcore',
188+
'publishable': false,
193189
'application_id': 'xyz.app.my_app',
194-
'platforms': const [
195-
'android',
196-
'ios',
197-
'macos',
198-
'web',
199-
'windows',
200-
],
201-
},
202-
expectedLogSummary: 'Created a Very Good App! 🦄',
203-
);
204-
});
205-
206-
test('generates successfully with custom platforms', () async {
207-
await testMultiTemplateCommand(
208-
multiTemplatesCommand: CreateFlutterApp(
209-
logger: logger,
210-
generatorFromBundle: (_) async => throw Exception('oops'),
211-
generatorFromBrick: (_) async => generator,
212-
),
213-
logger: logger,
214-
hooks: hooks,
215-
generator: generator,
216-
templateName: 'core',
217-
mockArgs: {
218-
'application-id': 'xyz.app.my_app',
219-
'platforms': const ['android', 'ios'],
220-
},
221-
expectedVars: {
222-
'project_name': 'my_app',
223-
'description': '',
224-
'org_name': 'com.example.verygoodcore',
225-
'application_id': 'xyz.app.my_app',
226-
'platforms': const ['android', 'ios'],
190+
'platforms': ['android', 'ios', 'macos', 'web', 'windows'],
227191
},
228192
expectedLogSummary: 'Created a Very Good App! 🦄',
229193
);
@@ -246,26 +210,15 @@ void main() {
246210
templateName: 'core',
247211
mockArgs: {
248212
'application-id': 'xyz.app.my_app',
249-
'platforms': const [
250-
'android',
251-
'ios',
252-
'macos',
253-
'web',
254-
'windows',
255-
],
213+
'platforms': ['android', 'ios', 'macos', 'web', 'windows'],
256214
},
257215
expectedVars: {
258216
'project_name': 'my_app',
259217
'description': '',
260218
'org_name': 'com.example.verygoodcore',
219+
'publishable': false,
261220
'application_id': 'xyz.app.my_app',
262-
'platforms': const [
263-
'android',
264-
'ios',
265-
'macos',
266-
'web',
267-
'windows',
268-
],
221+
'platforms': ['android', 'ios', 'macos', 'web', 'windows'],
269222
},
270223
expectedLogSummary: 'Created a Very Good App! 🦄',
271224
);

0 commit comments

Comments
 (0)