running formatter
This commit is contained in:
@@ -16,7 +16,8 @@ class NgDartCommanderRunner extends CommandRunner {
|
||||
static const _verboseOption = 'verbose';
|
||||
|
||||
NgDartCommanderRunner()
|
||||
: super('ngflutter', 'Ngflutter is a command line interface for Flutter.') {
|
||||
: super(
|
||||
'ngflutter', 'Ngflutter is a command line interface for Flutter.') {
|
||||
argParser.addFlag(_verboseOption,
|
||||
abbr: 'v',
|
||||
help: 'Output extra logging information.',
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd
|
||||
|
||||
|
||||
import 'command.dart';
|
||||
import 'generate_test.dart';
|
||||
import 'package:ngflutter/src/commands/generate_widget.dart';
|
||||
|
||||
@@ -30,9 +30,7 @@ class NewProjectCommand extends NgDartCommand {
|
||||
'a new folder will be created unde this path for the project.',
|
||||
defaultsTo: '.');
|
||||
argParser.addOption(_rootComponentOption,
|
||||
abbr: 'r',
|
||||
help: 'Class name of root component.',
|
||||
defaultsTo: 'Screen');
|
||||
abbr: 'r', help: 'Class name of root component.', defaultsTo: 'Screen');
|
||||
}
|
||||
|
||||
Future run() async {
|
||||
|
||||
@@ -26,7 +26,7 @@ class PackageUriResolver {
|
||||
} catch (e) {
|
||||
throw new UsageException(
|
||||
'Error when reading $_dotPackagesFilePath, '
|
||||
'please run pub get first.',
|
||||
'please run pub get first.',
|
||||
'');
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class PackageUriResolver {
|
||||
if (_packageMap[packageName] == null) {
|
||||
throw new UsageException(
|
||||
'Cannot locate $packageName, '
|
||||
'probably you need to run pub get again',
|
||||
'probably you need to run pub get again',
|
||||
'');
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class PageObjectData {
|
||||
.map((element) => new _Variable.fromElement(element))
|
||||
.where((variable) => variable != null)
|
||||
.toList(growable: false)
|
||||
..sort();
|
||||
..sort();
|
||||
|
||||
return new PageObjectData._internal(document, variables);
|
||||
}
|
||||
|
||||
@@ -105,8 +105,8 @@ String _getProjectName(String pubspecFilePath) {
|
||||
} catch (e) {
|
||||
throw new UsageException(
|
||||
'Error happened when reading pubspec.yaml. '
|
||||
'Command generate test should be run '
|
||||
'under root directory of the project.',
|
||||
'Command generate test should be run '
|
||||
'under root directory of the project.',
|
||||
'');
|
||||
}
|
||||
var namePrefix = 'name:';
|
||||
|
||||
@@ -33,7 +33,7 @@ void main() {
|
||||
test('should generate items in parents list', () {
|
||||
var po = new PageObjectData(
|
||||
'<p *ngFor="xxx"><action-button class="good">'
|
||||
'</action-button></p>',
|
||||
'</action-button></p>',
|
||||
);
|
||||
expect(po.variables.first.getterString,
|
||||
'Future<List<PageLoaderElement>> get good => _getGood();');
|
||||
@@ -53,13 +53,13 @@ void main() {
|
||||
test('should sort generated items', () {
|
||||
var po1 = new PageObjectData(
|
||||
'<action-button class="good"></action-button>'
|
||||
'<action-button class="bad"></action-button>',
|
||||
'<action-button class="bad"></action-button>',
|
||||
);
|
||||
expect(po1.variables.first.name, 'Bad');
|
||||
expect(po1.variables.last.name, 'Good');
|
||||
var po2 = new PageObjectData(
|
||||
'<action-button class="good"></action-button>'
|
||||
'<action-button class="bad"></action-button>',
|
||||
'<action-button class="bad"></action-button>',
|
||||
);
|
||||
expect(po2.variables.first.name, 'Bad');
|
||||
expect(po2.variables.last.name, 'Good');
|
||||
@@ -91,8 +91,8 @@ void main() {
|
||||
test('should choose correct selector.', () {
|
||||
var po = new PageObjectData(
|
||||
'<some-widget class="cool"></some-widget>'
|
||||
'<some-widget class="cool" id="cooler"></some-widget>'
|
||||
'<some-widget></some-widget>',
|
||||
'<some-widget class="cool" id="cooler"></some-widget>'
|
||||
'<some-widget></some-widget>',
|
||||
);
|
||||
expect(po.variables.length, 3);
|
||||
expect(po.variables[0].selector.toString(), "@ByClass('cool')");
|
||||
@@ -103,7 +103,7 @@ void main() {
|
||||
test('should work with selectors with attributes', () {
|
||||
var po = new PageObjectData(
|
||||
'<some-cell class="field-class"></some-cell>'
|
||||
'<some-cell id="fieldWithId"></some-cell>',
|
||||
'<some-cell id="fieldWithId"></some-cell>',
|
||||
);
|
||||
expect(po.variables[0].selector.toString(), "@ByClass('field-class')");
|
||||
expect(po.variables[1].selector.toString(), "@ById('fieldWithId')");
|
||||
|
||||
Reference in New Issue
Block a user