Commit cd65b790 authored by Dan Rubel's avatar Dan Rubel Committed by GitHub

switch to package:mustache (#6273)

parent 6ec68c47
...@@ -162,8 +162,7 @@ All done! In order to run your application, type: ...@@ -162,8 +162,7 @@ All done! In order to run your application, type:
int fileCount = 0; int fileCount = 0;
if (renderDriverTest) templateContext['withDriverTest'] = renderDriverTest;
templateContext['withDriverTest?'] = <String, dynamic>{};
Template createTemplate = new Template.fromName('create'); Template createTemplate = new Template.fromName('create');
fileCount += createTemplate.render(new Directory(dirPath), templateContext, fileCount += createTemplate.render(new Directory(dirPath), templateContext,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'dart:io'; import 'dart:io';
import 'package:mustache4dart/mustache4dart.dart' as mustache; import 'package:mustache/mustache.dart' as mustache;
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
import 'cache.dart'; import 'cache.dart';
...@@ -109,7 +109,7 @@ class Template { ...@@ -109,7 +109,7 @@ class Template {
if (sourceFile.path.endsWith(_kTemplateExtension)) { if (sourceFile.path.endsWith(_kTemplateExtension)) {
String templateContents = sourceFile.readAsStringSync(); String templateContents = sourceFile.readAsStringSync();
String renderedContents = mustache.render(templateContents, context); String renderedContents = new mustache.Template(templateContents).renderString(context);
finalDestinationFile.writeAsStringSync(renderedContents); finalDestinationFile.writeAsStringSync(renderedContents);
......
...@@ -23,7 +23,7 @@ dependencies: ...@@ -23,7 +23,7 @@ dependencies:
linter: ^0.1.21 linter: ^0.1.21
meta: ^1.0.3 meta: ^1.0.3
mustache4dart: ^1.0.0 mustache: ^0.2.5
package_config: '>=0.1.5 <2.0.0' package_config: '>=0.1.5 <2.0.0'
path: ^1.3.0 path: ^1.3.0
pub_semver: ^1.0.0 pub_semver: ^1.0.0
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
{{#withDriverTest?}} {{#withDriverTest}}
import 'package:flutter_driver/driver_extension.dart'; import 'package:flutter_driver/driver_extension.dart';
{{/withDriverTest?}} {{/withDriverTest}}
void main() { void main() {
{{#withDriverTest?}} {{#withDriverTest}}
// Starts the app with Flutter Driver extension enabled to allow Flutter Driver // Starts the app with Flutter Driver extension enabled to allow Flutter Driver
// to test the app. // to test the app.
enableFlutterDriverExtension(); enableFlutterDriverExtension();
{{/withDriverTest?}} {{/withDriverTest}}
runApp( runApp(
new MaterialApp( new MaterialApp(
title: 'Flutter Demo', title: 'Flutter Demo',
......
...@@ -3,8 +3,8 @@ description: {{description}} ...@@ -3,8 +3,8 @@ description: {{description}}
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
{{#withDriverTest?}} {{#withDriverTest}}
dev_dependencies: dev_dependencies:
flutter_driver: flutter_driver:
sdk: flutter sdk: flutter
{{/withDriverTest?}} {{/withDriverTest}}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment