Skip to content

Commit

Permalink
Run dartfmt --fix (flutter#8)
Browse files Browse the repository at this point in the history
Drops optional new and const.
  • Loading branch information
natebosch authored Dec 10, 2019
1 parent 9d1ad40 commit de79a29
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/term_glyph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import 'src/generated/glyph_set.dart';
import 'src/generated/unicode_glyph_set.dart';

/// A [GlyphSet] that always returns ASCII glyphs.
const GlyphSet asciiGlyphs = const AsciiGlyphSet();
const GlyphSet asciiGlyphs = AsciiGlyphSet();

/// A [GlyphSet] that always returns Unicode glyphs.
const GlyphSet unicodeGlyphs = const UnicodeGlyphSet();
const GlyphSet unicodeGlyphs = UnicodeGlyphSet();

/// Returns [asciiGlyphs] if [ascii] is `true` or [unicodeGlyphs] otherwise.
///
Expand Down
20 changes: 10 additions & 10 deletions tool/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import 'package:csv/csv.dart';
import 'package:meta/meta.dart';

void main() {
var csv = new CsvCodec(eol: "\n");
var data = csv.decoder.convert(new File("data.csv").readAsStringSync());
var csv = CsvCodec(eol: "\n");
var data = csv.decoder.convert(File("data.csv").readAsStringSync());

// Remove comments and empty lines.
data.removeWhere((row) => row.length < 3);

new Directory("lib/src/generated").createSync(recursive: true);
Directory("lib/src/generated").createSync(recursive: true);

_writeGlyphSetInterface(data);
_writeGlyphSet(data, ascii: false);
Expand All @@ -29,8 +29,8 @@ void main() {

/// Writes `lib/src/generated/glyph_set.dart`.
void _writeGlyphSetInterface(List<List> data) {
var file = new File("lib/src/generated/glyph_set.dart")
.openSync(mode: FileMode.write);
var file =
File("lib/src/generated/glyph_set.dart").openSync(mode: FileMode.write);
file.writeStringSync(r"""
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
Expand Down Expand Up @@ -84,9 +84,9 @@ void _writeGlyphSetInterface(List<List> data) {
/// If [ascii] is `true`, this writes the ASCII glyph set. Otherwise it writes
/// the Unicode glyph set.
void _writeGlyphSet(List<List> data, {@required bool ascii}) {
var file = new File(
"lib/src/generated/${ascii ? "ascii" : "unicode"}_glyph_set.dart")
.openSync(mode: FileMode.write);
var file =
File("lib/src/generated/${ascii ? "ascii" : "unicode"}_glyph_set.dart")
.openSync(mode: FileMode.write);

var className = "${ascii ? "Ascii" : "Unicode"}GlyphSet";
file.writeStringSync("""
Expand Down Expand Up @@ -126,8 +126,8 @@ void _writeGlyphSet(List<List> data, {@required bool ascii}) {

/// Writes `lib/src/generated/top_level.dart`.
void _writeTopLevel(List<List> data) {
var file = new File("lib/src/generated/top_level.dart")
.openSync(mode: FileMode.write);
var file =
File("lib/src/generated/top_level.dart").openSync(mode: FileMode.write);

file.writeStringSync("""
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
Expand Down

0 comments on commit de79a29

Please sign in to comment.