Skip to content

Commit eb56205

Browse files
committed
Run dart fix & format with new analysis rules
1 parent 6e2c8b3 commit eb56205

34 files changed

+330
-310
lines changed

example/lib/flap/flap_demo.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import 'flap_home_page.dart';
2-
import 'package:flutter/material.dart';
31
import 'package:adwaita/adwaita.dart';
2+
import 'package:flutter/material.dart';
3+
4+
import 'flap_home_page.dart';
45

56
class FlapDemo extends StatelessWidget {
67
final ValueNotifier<ThemeMode> themeNotifier =

example/lib/flap/flap_home_page.dart

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,21 @@ class _FlapHomePageState extends State<FlapHomePage> {
5353
appWindow: appWindow,
5454
windowDecor: windowDecor,
5555
start: [
56-
Builder(builder: (context) {
57-
return AdwHeaderButton(
58-
icon: const Icon(Icons.view_sidebar, size: 15),
59-
isActive: _flapController.isOpen,
60-
onPressed: () => _flapController.toggle(),
61-
);
62-
}),
56+
Builder(
57+
builder: (context) {
58+
return AdwHeaderButton(
59+
icon: const Icon(Icons.view_sidebar, size: 15),
60+
isActive: _flapController.isOpen,
61+
onPressed: () => _flapController.toggle(),
62+
);
63+
},
64+
),
6365
AdwHeaderButton(
6466
icon: const Icon(Icons.nightlight_round, size: 15),
6567
onPressed: changeTheme,
6668
),
6769
],
68-
title: const Text("AdwFlap Demo"),
70+
title: const Text('AdwFlap Demo'),
6971
),
7072
Expanded(
7173
child: AdwScaffold(
@@ -120,38 +122,33 @@ class _FlapHomePageState extends State<FlapHomePage> {
120122
index: _currentIndex,
121123
children: [
122124
AdwClamp.scrollable(
123-
center: true,
124125
child: AdwPreferencesGroup(
125126
children: [
126127
const AdwComboRow(
127-
title: "Fold Policy",
128-
choices: ["auto", "always", "never"],
128+
title: 'Fold Policy',
129+
choices: ['auto', 'always', 'never'],
129130
),
130131
AdwActionRow(
131-
title: "Locked",
132+
title: 'Locked',
132133
subtitle:
133134
"Sidebar visibility doesn't change when fold state changes",
134135
end: CupertinoSwitch(
135-
value: locked,
136-
onChanged: (val) {
137-
locked = val;
138-
setState(() {});
139-
}),
136+
value: locked,
137+
onChanged: (val) {
138+
locked = val;
139+
setState(() {});
140+
},
141+
),
140142
)
141143
],
142144
),
143145
),
144146
AdwClamp.scrollable(
145-
center: true,
146147
child: AdwPreferencesGroup(
147148
children: [
148149
AdwActionRow(
149-
title: "Flap position",
150+
title: 'Flap position',
150151
end: ToggleButtons(
151-
children: const [
152-
Text("Start"),
153-
Text("End"),
154-
],
155152
isSelected: [
156153
flapPosition.index == 0,
157154
flapPosition.index == 1
@@ -163,33 +160,36 @@ class _FlapHomePageState extends State<FlapHomePage> {
163160
flapPosition = FlapPosition.end;
164161
}
165162
}),
163+
children: const [
164+
Text('Start'),
165+
Text('End'),
166+
],
166167
),
167168
),
168169
const AdwActionRow(
169-
title: "Transition type",
170-
end: Text("Over"),
170+
title: 'Transition type',
171+
end: Text('Over'),
171172
)
172173
],
173174
),
174175
),
175176
AdwClamp.scrollable(
176-
center: true,
177177
child: AdwPreferencesGroup(
178178
children: [
179179
AdwActionRow(
180-
title: "Modal",
180+
title: 'Modal',
181181
subtitle:
182-
"Clicking outside the sidebar or pressing Esc will close it when folded",
182+
'Clicking outside the sidebar or pressing Esc will close it when folded',
183183
end:
184184
CupertinoSwitch(value: true, onChanged: (val) {}),
185185
),
186186
AdwActionRow(
187-
title: "Swipe to Open",
187+
title: 'Swipe to Open',
188188
end:
189189
CupertinoSwitch(value: true, onChanged: (val) {}),
190190
),
191191
AdwActionRow(
192-
title: "Swipe to Close",
192+
title: 'Swipe to Close',
193193
end:
194194
CupertinoSwitch(value: true, onChanged: (val) {}),
195195
),

example/lib/home_page.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class _MyHomePageState extends State<MyHomePage> {
7474
onPressed: changeTheme,
7575
),
7676
],
77-
title: const Text("Libadwaita Demo"),
77+
title: const Text('Libadwaita Demo'),
7878
end: [
7979
AdwPopupMenu(
8080
body: Column(
@@ -137,7 +137,6 @@ class _MyHomePageState extends State<MyHomePage> {
137137
),
138138
body: AdwFlap(
139139
flapController: _flapController,
140-
foldPolicy: FoldPolicy.auto,
141140
flap: AdwSidebar(
142141
currentIndex: _currentIndex,
143142
children: const [
@@ -174,6 +173,7 @@ class _MyHomePageState extends State<MyHomePage> {
174173
),
175174
child: AdwViewStack(
176175
animationDuration: const Duration(milliseconds: 100),
176+
index: _currentIndex,
177177
children: [
178178
const WelcomePage(),
179179
CounterPage(counter: counter),
@@ -184,7 +184,6 @@ class _MyHomePageState extends State<MyHomePage> {
184184
const SettingsPage(),
185185
const StyleClassesPage(),
186186
],
187-
index: _currentIndex,
188187
),
189188
),
190189
),

example/lib/main.dart

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import 'package:adwaita/adwaita.dart';
12
import 'package:example/flap/flap_demo.dart';
23
import 'package:example/view_switcher/view_switcher_demo.dart';
4+
import 'package:flutter/material.dart';
35
import 'package:multi_window/multi_widget.dart';
46
import 'package:multi_window/multi_window.dart';
57

68
import 'home_page.dart';
7-
import 'package:flutter/material.dart';
8-
import 'package:adwaita/adwaita.dart';
99

1010
void main(List<String> args) async {
1111
WidgetsFlutterBinding.ensureInitialized();
@@ -26,17 +26,18 @@ class MyApp extends StatelessWidget {
2626
valueListenable: themeNotifier,
2727
builder: (_, ThemeMode currentMode, __) {
2828
return MaterialApp(
29-
theme: AdwaitaThemeData.light(),
30-
darkTheme: AdwaitaThemeData.dark(),
31-
debugShowCheckedModeBanner: false,
32-
home: MultiWidget(
33-
{
34-
'flap': FlapDemo(),
35-
'view_switcher': ViewSwitcherDemo(),
36-
},
37-
fallback: MyHomePage(themeNotifier: themeNotifier),
38-
),
39-
themeMode: currentMode);
29+
theme: AdwaitaThemeData.light(),
30+
darkTheme: AdwaitaThemeData.dark(),
31+
debugShowCheckedModeBanner: false,
32+
home: MultiWidget(
33+
{
34+
'flap': FlapDemo(),
35+
'view_switcher': ViewSwitcherDemo(),
36+
},
37+
fallback: MyHomePage(themeNotifier: themeNotifier),
38+
),
39+
themeMode: currentMode,
40+
);
4041
},
4142
);
4243
}

example/lib/pages/avatar_page.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ class AvatarPage extends StatelessWidget {
77
@override
88
Widget build(BuildContext context) {
99
return AdwClamp.scrollable(
10-
center: true,
1110
child: Column(
1211
mainAxisAlignment: MainAxisAlignment.center,
1312
children: [
1413
const AdwAvatar(
15-
child: Icon(Icons.person),
1614
size: 128,
15+
child: Icon(Icons.person),
1716
),
1817
AdwPreferencesGroup(
1918
title: 'All colors',

example/lib/pages/counter_page.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class _CounterPageState extends State<CounterPage> {
1717
Widget build(BuildContext context) {
1818
return Center(
1919
child: AdwClamp.scrollable(
20-
center: true,
2120
child: ValueListenableBuilder(
2221
valueListenable: widget.counter,
2322
builder: (_, value, child) {
@@ -31,7 +30,7 @@ class _CounterPageState extends State<CounterPage> {
3130
),
3231
AdwButton.pill(
3332
onPressed: _incrementCounter,
34-
child: const Text("Add"),
33+
child: const Text('Add'),
3534
),
3635
],
3736
);

example/lib/pages/flap_page.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ class FlapPage extends StatelessWidget {
99
Widget build(BuildContext context) {
1010
return Center(
1111
child: AdwClamp.scrollable(
12-
center: true,
1312
child: Column(
1413
children: [
1514
Text(
16-
"Flap",
15+
'Flap',
1716
style: Theme.of(context).textTheme.headline6,
1817
),
1918
const SizedBox(height: 10),
2019
const Text(
21-
"A widget showing a flap next or above the content.",
20+
'A widget showing a flap next or above the content.',
2221
),
2322
const SizedBox(height: 16),
2423
AdwButton.pill(
@@ -27,7 +26,7 @@ class FlapPage extends StatelessWidget {
2726
'flap',
2827
);
2928
},
30-
child: const Text("Run the demo"),
29+
child: const Text('Run the demo'),
3130
),
3231
],
3332
),

example/lib/pages/lists_page.dart

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,75 +7,85 @@ class ListsPage extends StatelessWidget {
77
@override
88
Widget build(BuildContext context) {
99
return AdwClamp.scrollable(
10-
center: true,
1110
child: Column(
1211
children: [
1312
const Icon(
1413
Icons.list_rounded,
1514
size: 150,
1615
),
1716
Text(
18-
"Lists",
17+
'Lists',
1918
style: Theme.of(context)
2019
.textTheme
2120
.headline5
2221
?.copyWith(fontWeight: FontWeight.bold),
2322
),
24-
const Text("Rows and helpers for GtkListBox."),
23+
const Text('Rows and helpers for GtkListBox.'),
2524
const SizedBox(
2625
height: 10,
2726
),
28-
AdwPreferencesGroup(children: [
29-
const AdwActionRow(
30-
start: Icon(Icons.settings),
31-
title: "Rows have a title",
32-
subtitle: "They also have a subtitle and an icon",
33-
),
34-
AdwActionRow(
35-
title: "Rows can have suffix widgets",
36-
end:
37-
TextButton(onPressed: () {}, child: const Text("Frobnicate")),
38-
)
39-
]),
40-
const AdwPreferencesGroup(children: [
41-
AdwComboRow(
42-
choices: ["Test", "Second", "Third and a long name"],
43-
title: "Combo row",
44-
)
45-
]),
27+
AdwPreferencesGroup(
28+
children: [
29+
const AdwActionRow(
30+
start: Icon(Icons.settings),
31+
title: 'Rows have a title',
32+
subtitle: 'They also have a subtitle and an icon',
33+
),
34+
AdwActionRow(
35+
title: 'Rows can have suffix widgets',
36+
end: TextButton(
37+
onPressed: () {},
38+
child: const Text('Frobnicate'),
39+
),
40+
)
41+
],
42+
),
43+
const AdwPreferencesGroup(
44+
children: [
45+
AdwComboRow(
46+
choices: ['Test', 'Second', 'Third and a long name'],
47+
title: 'Combo row',
48+
)
49+
],
50+
),
4651
AdwPreferencesGroup(
4752
children: List.generate(
4853
3,
4954
(index) => ListTile(
50-
title: Text("Index $index"),
55+
title: Text('Index $index'),
5156
),
5257
),
5358
),
54-
AdwPreferencesGroup(children: [
55-
Theme(
59+
AdwPreferencesGroup(
60+
children: [
61+
Theme(
5662
data: Theme.of(context)
5763
.copyWith(dividerColor: Colors.transparent),
5864
child: ExpansionTile(
59-
title: const Text("Expander row"),
65+
title: const Text('Expander row'),
6066
children: [
6167
const ListTile(
62-
title: Text("A nested row"),
68+
title: Text('A nested row'),
6369
),
6470
Divider(
6571
color: context.borderColor,
6672
height: 10,
6773
),
6874
const ListTile(
69-
title: Text("Another nested row"),
75+
title: Text('Another nested row'),
7076
)
7177
],
72-
))
73-
])
78+
),
79+
)
80+
],
81+
)
7482
]
75-
.map((e) => Padding(
76-
child: e,
77-
padding: const EdgeInsets.symmetric(vertical: 10),
78-
))
83+
.map(
84+
(e) => Padding(
85+
padding: const EdgeInsets.symmetric(vertical: 10),
86+
child: e,
87+
),
88+
)
7989
.toList(),
8090
),
8191
);

0 commit comments

Comments
 (0)