Skip to content

Commit f9c3b96

Browse files
committed
style: apply formatting changes
1 parent 64078cf commit f9c3b96

File tree

8 files changed

+38
-41
lines changed

8 files changed

+38
-41
lines changed

lib/data/status.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,9 @@ class Status {
9090
visibility: StatusVisibility.values.byName(data["visibility"]!),
9191
spoilerText: data["spoiler_text"]!,
9292
reblog: data["reblog"] == null ? null : Status.fromJson(data["reblog"]),
93-
customEmojis:
94-
((data["emojis"] ?? []) as List)
95-
.map(
96-
(emoji) => CustomEmoji.fromJson(emoji as Map<String, dynamic>),
97-
)
98-
.toList(),
93+
customEmojis: ((data["emojis"] ?? []) as List)
94+
.map((emoji) => CustomEmoji.fromJson(emoji as Map<String, dynamic>))
95+
.toList(),
9996
);
10097
}
10198

lib/screens/login.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class _LoginState extends State<Login> {
5555
// If the previous call successfully restored the API status, then the
5656
// `helper` was appropriately instanced.
5757
if (widget.apiService.helper != null) {
58-
AccessTokenResponse? token =
59-
await widget.apiService.helper!.getTokenFromStorage();
58+
AccessTokenResponse? token = await widget.apiService.helper!
59+
.getTokenFromStorage();
6060

6161
// This would check if, besides having a working `helper`, we also have
6262
// a user token stored.
@@ -79,11 +79,10 @@ class _LoginState extends State<Login> {
7979
void selectInstanceAction() {
8080
showDialog(
8181
context: context,
82-
builder:
83-
(context) => AlertDialog(
84-
title: const Text("Enter your Mastodon instance"),
85-
content: InstanceForm(onSuccessfulSubmit: logInAction),
86-
),
82+
builder: (context) => AlertDialog(
83+
title: const Text("Enter your Mastodon instance"),
84+
content: InstanceForm(onSuccessfulSubmit: logInAction),
85+
),
8786
);
8887
}
8988

lib/widgets/drawer.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ class FeathrDrawerHeader extends StatelessWidget {
3030
child: Text(account.acct, style: TextStyle(color: Colors.white)),
3131
),
3232
currentAccountPicture: CircleAvatar(
33-
foregroundImage:
34-
account.avatarUrl != null ? NetworkImage(account.avatarUrl!) : null,
33+
foregroundImage: account.avatarUrl != null
34+
? NetworkImage(account.avatarUrl!)
35+
: null,
3536
),
3637
decoration: BoxDecoration(
37-
image:
38-
account.headerUrl != null
39-
? DecorationImage(
40-
image: NetworkImage(account.headerUrl!),
41-
fit: BoxFit.cover,
42-
)
43-
: null,
38+
image: account.headerUrl != null
39+
? DecorationImage(
40+
image: NetworkImage(account.headerUrl!),
41+
fit: BoxFit.cover,
42+
)
43+
: null,
4444
color: account.headerUrl == null ? Colors.teal : null,
4545
),
4646
);

lib/widgets/status_card.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,9 @@ class _StatusCardState extends State<StatusCard> {
160160
);
161161
},
162162
child: CircleAvatar(
163-
foregroundImage:
164-
status.account.avatarUrl != null
165-
? NetworkImage(status.account.avatarUrl!)
166-
: null,
163+
foregroundImage: status.account.avatarUrl != null
164+
? NetworkImage(status.account.avatarUrl!)
165+
: null,
167166
),
168167
),
169168
title: Text(
@@ -192,10 +191,9 @@ class _StatusCardState extends State<StatusCard> {
192191
'a': Style(textDecoration: TextDecoration.none),
193192
},
194193
// TODO: handle @mentions and #hashtags differently
195-
onLinkTap:
196-
(url, renderContext, attributes) => {
197-
if (url != null) {launchUrl(Uri.parse(url))},
198-
},
194+
onLinkTap: (url, renderContext, attributes) => {
195+
if (url != null) {launchUrl(Uri.parse(url))},
196+
},
199197
),
200198
),
201199
OverflowBar(

lib/widgets/status_form.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,9 @@ class StatusFormState extends State<StatusForm> {
109109
keyboardType: TextInputType.text,
110110
decoration: InputDecoration(helperText: helperText),
111111
controller: statusController,
112-
validator:
113-
(value) =>
114-
value == null || value.isEmpty
115-
? 'This field should not be empty'
116-
: null,
112+
validator: (value) => value == null || value.isEmpty
113+
? 'This field should not be empty'
114+
: null,
117115
),
118116
DropdownButtonFormField<StatusVisibility>(
119117
value: selectedVisibility,

lib/widgets/timeline.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ class TimelineState extends State<Timeline> {
9191
child: PagedListView<String?, Status>(
9292
pagingController: _pagingController,
9393
builderDelegate: PagedChildBuilderDelegate<Status>(
94-
itemBuilder:
95-
(context, item, index) =>
96-
StatusCard(item, apiService: widget.apiService),
94+
itemBuilder: (context, item, index) =>
95+
StatusCard(item, apiService: widget.apiService),
9796
),
9897
),
9998
),

test/screens_test/user_test.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ void main() {
1414
final account = apiService.currentAccount!;
1515

1616
await tester.pumpWidget(
17-
MaterialApp(home: User(account: account, apiService: apiService)),
17+
MaterialApp(
18+
home: User(account: account, apiService: apiService),
19+
),
1820
);
1921

2022
// Expect to find the user's name

test/widgets_test/drawer_test.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ void main() {
1616
);
1717

1818
await tester.pumpWidget(
19-
MaterialApp(home: Drawer(child: FeathrDrawerHeader(account: account))),
19+
MaterialApp(
20+
home: Drawer(child: FeathrDrawerHeader(account: account)),
21+
),
2022
);
2123
expect(find.text('username'), findsOneWidget);
2224
expect(find.text('display name'), findsOneWidget);
@@ -39,7 +41,9 @@ void main() {
3941
);
4042

4143
await tester.pumpWidget(
42-
MaterialApp(home: Drawer(child: FeathrDrawerHeader(account: account))),
44+
MaterialApp(
45+
home: Drawer(child: FeathrDrawerHeader(account: account)),
46+
),
4347
);
4448

4549
final userAccountsDrawerHeader = tester.widget<UserAccountsDrawerHeader>(

0 commit comments

Comments
 (0)