add a flutter.yaml file to the init template

This commit is contained in:
Devon Carew
2015-11-06 20:57:35 -08:00
parent d86fb66e9b
commit a469020983
4 changed files with 13 additions and 6 deletions

View File

@@ -49,7 +49,7 @@ class FlutterCommandRunner extends CommandRunner {
argParser.addFlag('local-build',
negatable: false,
help:
'Automatically detect your engine src directory from an overridden Flutter package.'
'Automatically detect your engine src directory from an overridden Flutter package. '
'Useful if you are building Flutter locally and are using a dependency_override for'
'the Flutter package that points to your engine src directory.');
argParser.addOption('engine-src-path', hide: true,

View File

@@ -89,6 +89,7 @@ abstract class Template {
class FlutterSimpleTemplate extends Template {
FlutterSimpleTemplate() : super('flutter-simple', 'A minimal Flutter project.') {
files['.gitignore'] = _gitignore;
files['flutter.yaml'] = _flutterYaml;
files['pubspec.yaml'] = _pubspec;
files['README.md'] = _readme;
files['lib/main.dart'] = _libMain;
@@ -98,9 +99,8 @@ class FlutterSimpleTemplate extends Template {
String _normalizeProjectName(String name) {
name = name.replaceAll('-', '_').replaceAll(' ', '_');
// Strip any extension (like .dart).
if (name.contains('.')) {
if (name.contains('.'))
name = name.substring(0, name.indexOf('.'));
}
return name;
}
@@ -134,6 +134,12 @@ dev_dependencies:
sky_tools: any
''';
const String _flutterYaml = r'''
name: {{projectName}}
material-design-icons:
- name: content/add
''';
const String _libMain = r'''
import 'package:flutter/material.dart';