Skip to content

Commit 2327dbd

Browse files
committed
Cleanup.
1 parent 7645957 commit 2327dbd

File tree

5 files changed

+42
-199
lines changed

5 files changed

+42
-199
lines changed

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.md]
16+
trim_trailing_whitespace = false
17+
18+
[*.yml]
19+
indent_size = 2
20+
21+
[*.yaml]
22+
indent_size = 2
23+
24+
[*.dart]
25+
indent_brace_style = K&R
26+
indent_size = 2

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,6 @@ jobs:
112112

113113
- name: cargo clippy
114114
run: cargo clippy -- -D warnings
115+
116+
- name: flutter format
117+
run: flutter format --set-exit-if-changed .

lib/main.dart

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter/foundation.dart' show debugDefaultTargetPlatformOverride;
2+
import 'package:flutter/foundation.dart'
3+
show debugDefaultTargetPlatformOverride;
34

45
void main() {
56
// Override is necessary to prevent Unknown platform' flutter startup error.
@@ -24,15 +25,6 @@ class MyApp extends StatelessWidget {
2425
class MyHomePage extends StatefulWidget {
2526
MyHomePage({Key key, this.title}) : super(key: key);
2627

27-
// This widget is the home page of your application. It is stateful, meaning
28-
// that it has a State object (defined below) that contains fields that affect
29-
// how it looks.
30-
31-
// This class is the configuration for the state. It holds the values (in this
32-
// case the title) provided by the parent (in this case the App widget) and
33-
// used by the build method of the State. Fields in a Widget subclass are
34-
// always marked "final".
35-
3628
final String title;
3729

3830
@override
@@ -44,47 +36,18 @@ class _MyHomePageState extends State<MyHomePage> {
4436

4537
void _incrementCounter() {
4638
setState(() {
47-
// This call to setState tells the Flutter framework that something has
48-
// changed in this State, which causes it to rerun the build method below
49-
// so that the display can reflect the updated values. If we changed
50-
// _counter without calling setState(), then the build method would not be
51-
// called again, and so nothing would appear to happen.
5239
_counter++;
5340
});
5441
}
5542

5643
@override
5744
Widget build(BuildContext context) {
58-
// This method is rerun every time setState is called, for instance as done
59-
// by the _incrementCounter method above.
60-
//
61-
// The Flutter framework has been optimized to make rerunning build methods
62-
// fast, so that you can just rebuild anything that needs updating rather
63-
// than having to individually change instances of widgets.
6445
return Scaffold(
6546
appBar: AppBar(
66-
// Here we take the value from the MyHomePage object that was created by
67-
// the App.build method, and use it to set our appbar title.
6847
title: Text(widget.title),
6948
),
7049
body: Center(
71-
// Center is a layout widget. It takes a single child and positions it
72-
// in the middle of the parent.
7350
child: Column(
74-
// Column is also layout widget. It takes a list of children and
75-
// arranges them vertically. By default, it sizes itself to fit its
76-
// children horizontally, and tries to be as tall as its parent.
77-
//
78-
// Invoke "debug painting" (press "p" in the console, choose the
79-
// "Toggle Debug Paint" action from the Flutter Inspector in Android
80-
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
81-
// to see the wireframe for each widget.
82-
//
83-
// Column has various properties to control how it sizes itself and
84-
// how it positions its children. Here we use mainAxisAlignment to
85-
// center the children vertically; the main axis here is the vertical
86-
// axis because Columns are vertical (the cross axis would be
87-
// horizontal).
8851
mainAxisAlignment: MainAxisAlignment.center,
8952
children: <Widget>[
9053
Text(
@@ -101,7 +64,7 @@ class _MyHomePageState extends State<MyHomePage> {
10164
onPressed: _incrementCounter,
10265
tooltip: 'Increment',
10366
child: Icon(Icons.add),
104-
), // This trailing comma makes auto-formatting nicer for build methods.
67+
),
10568
);
10669
}
10770
}

pubspec.lock

Lines changed: 1 addition & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,30 @@
11
# Generated by pub
22
# See https://dart.dev/tools/pub/glossary#lockfile
33
packages:
4-
archive:
5-
dependency: transitive
6-
description:
7-
name: archive
8-
url: "https://pub.dartlang.org"
9-
source: hosted
10-
version: "2.0.11"
11-
args:
12-
dependency: transitive
13-
description:
14-
name: args
15-
url: "https://pub.dartlang.org"
16-
source: hosted
17-
version: "1.5.2"
18-
async:
19-
dependency: transitive
20-
description:
21-
name: async
22-
url: "https://pub.dartlang.org"
23-
source: hosted
24-
version: "2.4.0"
25-
boolean_selector:
26-
dependency: transitive
27-
description:
28-
name: boolean_selector
29-
url: "https://pub.dartlang.org"
30-
source: hosted
31-
version: "1.0.5"
32-
charcode:
33-
dependency: transitive
34-
description:
35-
name: charcode
36-
url: "https://pub.dartlang.org"
37-
source: hosted
38-
version: "1.1.2"
394
collection:
405
dependency: transitive
416
description:
427
name: collection
438
url: "https://pub.dartlang.org"
449
source: hosted
4510
version: "1.14.11"
46-
convert:
47-
dependency: transitive
48-
description:
49-
name: convert
50-
url: "https://pub.dartlang.org"
51-
source: hosted
52-
version: "2.1.1"
53-
crypto:
54-
dependency: transitive
55-
description:
56-
name: crypto
57-
url: "https://pub.dartlang.org"
58-
source: hosted
59-
version: "2.1.3"
6011
flutter:
6112
dependency: "direct main"
6213
description: flutter
6314
source: sdk
6415
version: "0.0.0"
65-
flutter_test:
66-
dependency: "direct dev"
67-
description: flutter
68-
source: sdk
69-
version: "0.0.0"
70-
image:
71-
dependency: transitive
72-
description:
73-
name: image
74-
url: "https://pub.dartlang.org"
75-
source: hosted
76-
version: "2.1.4"
77-
matcher:
78-
dependency: transitive
79-
description:
80-
name: matcher
81-
url: "https://pub.dartlang.org"
82-
source: hosted
83-
version: "0.12.6"
8416
meta:
8517
dependency: transitive
8618
description:
8719
name: meta
8820
url: "https://pub.dartlang.org"
8921
source: hosted
9022
version: "1.1.8"
91-
path:
92-
dependency: transitive
93-
description:
94-
name: path
95-
url: "https://pub.dartlang.org"
96-
source: hosted
97-
version: "1.6.4"
98-
pedantic:
99-
dependency: transitive
100-
description:
101-
name: pedantic
102-
url: "https://pub.dartlang.org"
103-
source: hosted
104-
version: "1.8.0+1"
105-
petitparser:
106-
dependency: transitive
107-
description:
108-
name: petitparser
109-
url: "https://pub.dartlang.org"
110-
source: hosted
111-
version: "2.4.0"
112-
quiver:
113-
dependency: transitive
114-
description:
115-
name: quiver
116-
url: "https://pub.dartlang.org"
117-
source: hosted
118-
version: "2.0.5"
11923
sky_engine:
12024
dependency: transitive
12125
description: flutter
12226
source: sdk
12327
version: "0.0.99"
124-
source_span:
125-
dependency: transitive
126-
description:
127-
name: source_span
128-
url: "https://pub.dartlang.org"
129-
source: hosted
130-
version: "1.5.5"
131-
stack_trace:
132-
dependency: transitive
133-
description:
134-
name: stack_trace
135-
url: "https://pub.dartlang.org"
136-
source: hosted
137-
version: "1.9.3"
138-
stream_channel:
139-
dependency: transitive
140-
description:
141-
name: stream_channel
142-
url: "https://pub.dartlang.org"
143-
source: hosted
144-
version: "2.0.0"
145-
string_scanner:
146-
dependency: transitive
147-
description:
148-
name: string_scanner
149-
url: "https://pub.dartlang.org"
150-
source: hosted
151-
version: "1.0.5"
152-
term_glyph:
153-
dependency: transitive
154-
description:
155-
name: term_glyph
156-
url: "https://pub.dartlang.org"
157-
source: hosted
158-
version: "1.1.0"
159-
test_api:
160-
dependency: transitive
161-
description:
162-
name: test_api
163-
url: "https://pub.dartlang.org"
164-
source: hosted
165-
version: "0.2.11"
16628
typed_data:
16729
dependency: transitive
16830
description:
@@ -177,12 +39,5 @@ packages:
17739
url: "https://pub.dartlang.org"
17840
source: hosted
17941
version: "2.0.8"
180-
xml:
181-
dependency: transitive
182-
description:
183-
name: xml
184-
url: "https://pub.dartlang.org"
185-
source: hosted
186-
version: "3.5.0"
18742
sdks:
188-
dart: ">=2.4.0 <3.0.0"
43+
dart: ">=2.6.0 <3.0.0"

pubspec.yaml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
1-
name: winit_flutter
1+
name: flutter_app_template
22
description: A new Flutter project.
33
version: 1.0.0+1
44
environment:
5-
sdk: ">=2.0.0 <3.0.0"
5+
sdk: ">=2.6.0 <3.0.0"
66

77
dependencies:
88
flutter:
99
sdk: flutter
1010

11-
dev_dependencies:
12-
flutter_test:
13-
sdk: flutter
14-
1511
flutter:
1612
assets:
17-
- assets/
13+
- assets/
1814

1915
fonts:
20-
- family: Roboto
21-
fonts:
22-
- asset: assets/fonts/Roboto-Regular.ttf
23-
- family: MaterialIcons
24-
fonts:
25-
- asset: assets/fonts/MaterialIcons-Regular.ttf
16+
- family: Roboto
17+
fonts:
18+
- asset: assets/fonts/Roboto-Regular.ttf
19+
- family: MaterialIcons
20+
fonts:
21+
- asset: assets/fonts/MaterialIcons-Regular.ttf

0 commit comments

Comments
 (0)