Skip to content

Commit de4cd26

Browse files
committed
style: update formatting differences
1 parent 77550d4 commit de4cd26

28 files changed

+1276
-1492
lines changed

lib/app.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ class FeathrApp extends StatelessWidget {
2929
final args = settings.arguments as UserScreenArguments;
3030
return MaterialPageRoute(
3131
builder: (context) {
32-
return User(
33-
account: args.account,
34-
apiService: apiService,
35-
);
32+
return User(account: args.account, apiService: apiService);
3633
},
3734
);
3835
}

lib/data/account.dart

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ class Account {
2828
/// URL to the user's set header
2929
final String? headerUrl;
3030

31-
Account(
32-
{required this.id,
33-
required this.username,
34-
required this.displayName,
35-
required this.acct,
36-
required this.isLocked,
37-
required this.isBot,
38-
this.avatarUrl,
39-
this.headerUrl});
31+
Account({
32+
required this.id,
33+
required this.username,
34+
required this.displayName,
35+
required this.acct,
36+
required this.isLocked,
37+
required this.isBot,
38+
this.avatarUrl,
39+
this.headerUrl,
40+
});
4041

4142
/// Given a Json-like [Map] with information for an account,
4243
/// build and return the respective [Account] instance.

lib/data/status.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import 'package:relative_time/relative_time.dart';
55

66
/// The [StatusVisibility] enum represents the visibility of a status
77
/// in a Mastodon instance.
8-
enum StatusVisibility {
9-
public,
10-
unlisted,
11-
private,
12-
}
8+
enum StatusVisibility { public, unlisted, private }
139

1410
/// The [Status] class represents information for a given status (toot)
1511
/// made in a Mastodon instance.

lib/helpers/auth.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class FeathrOAuth2Client extends OAuth2Client {
1717
final String instanceUrl;
1818

1919
FeathrOAuth2Client({required this.instanceUrl})
20-
: super(
21-
authorizeUrl: '$instanceUrl/oauth/authorize',
22-
tokenUrl: '$instanceUrl/oauth/token',
23-
redirectUri: featherRedirectUri,
24-
customUriScheme: featherUriScheme,
25-
);
20+
: super(
21+
authorizeUrl: '$instanceUrl/oauth/authorize',
22+
tokenUrl: '$instanceUrl/oauth/token',
23+
redirectUri: featherRedirectUri,
24+
customUriScheme: featherUriScheme,
25+
);
2626
}
2727

2828
/// Returns an instance of the [OAuth2Helper] helper class that serves as a

lib/screens/about.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ class AboutState extends State<About> {
5656
Column(
5757
mainAxisAlignment: MainAxisAlignment.spaceBetween,
5858
children: <Widget>[
59-
const Center(
60-
child: TitleWidget("feathr"),
61-
),
59+
const Center(child: TitleWidget("feathr")),
6260
Text(getVersionTag()),
6361
const Divider(),
6462
const Text(

lib/screens/login.dart

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ class _LoginState extends State<Login> {
7979
void selectInstanceAction() {
8080
showDialog(
8181
context: context,
82-
builder: (context) => AlertDialog(
83-
title: const Text("Enter your Mastodon instance"),
84-
content: InstanceForm(onSuccessfulSubmit: logInAction),
85-
),
82+
builder:
83+
(context) => AlertDialog(
84+
title: const Text("Enter your Mastodon instance"),
85+
content: InstanceForm(onSuccessfulSubmit: logInAction),
86+
),
8687
);
8788
}
8889

@@ -93,10 +94,7 @@ class _LoginState extends State<Login> {
9394
showLoginButton = true;
9495
});
9596
widget.apiService.resetApiServiceState();
96-
showSnackBar(
97-
context,
98-
message,
99-
);
97+
showSnackBar(context, message);
10098
}
10199

102100
/// Attempts to register an app on a Mastodon instance (given by its URL),
@@ -174,9 +172,7 @@ class _LoginState extends State<Login> {
174172
Column(
175173
mainAxisAlignment: MainAxisAlignment.spaceBetween,
176174
children: <Widget>[
177-
const Center(
178-
child: TitleWidget("feathr"),
179-
),
175+
const Center(child: TitleWidget("feathr")),
180176
Text(getVersionTag()),
181177
],
182178
),

lib/screens/timeline_tabs.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ class _TimelineTabsState extends State<TimelineTabs> {
133133
appBar: AppBar(
134134
toolbarHeight: 48.0,
135135
title: const Text(TimelineTabs.title),
136-
bottom: TabBar(
137-
tabs: tabs.map((tab) => tab.tabIcon).toList(),
138-
),
136+
bottom: TabBar(tabs: tabs.map((tab) => tab.tabIcon).toList()),
139137
),
140138
drawer: getDrawer(context),
141139
body: Stack(

lib/services/api.dart

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,11 @@ class ApiService {
155155
/// (according to the `timelineType`), using `maxId` as an optional
156156
/// starting point.
157157
Future<List<Status>> getStatusList(
158-
TimelineType timelineType, String? maxId, int limit,
159-
{String? accountId}) async {
158+
TimelineType timelineType,
159+
String? maxId,
160+
int limit, {
161+
String? accountId,
162+
}) async {
160163
// Depending on the type, we select and restrict the api URL to use,
161164
// limiting the amount of posts we're requesting according to `limit`
162165
String apiUrl;
@@ -271,10 +274,12 @@ class ApiService {
271274
/// Given a status content, requests the Mastodon API to post a new status
272275
/// on the user's timeline. Returns the (new) [Status] instance the API
273276
/// responds with.
274-
Future<Status> postStatus(String content,
275-
{Status? replyToStatus,
276-
StatusVisibility visibility = StatusVisibility.public,
277-
String spoilerText = ""}) async {
277+
Future<Status> postStatus(
278+
String content, {
279+
Status? replyToStatus,
280+
StatusVisibility visibility = StatusVisibility.public,
281+
String spoilerText = "",
282+
}) async {
278283
final apiUrl = "${instanceUrl!}/api/v1/statuses";
279284
// TODO: Support sensitivity, language, scheduling, polls and media
280285
Map<String, String> body = {
@@ -286,8 +291,11 @@ class ApiService {
286291
body["in_reply_to_id"] = replyToStatus.id;
287292
}
288293

289-
http.Response resp =
290-
await helper!.post(apiUrl, body: body, httpClient: httpClient);
294+
http.Response resp = await helper!.post(
295+
apiUrl,
296+
body: body,
297+
httpClient: httpClient,
298+
);
291299

292300
if (resp.statusCode == 200) {
293301
Map<String, dynamic> jsonData = jsonDecode(resp.body);
@@ -359,7 +367,8 @@ class ApiService {
359367
/// Note that this request is not tied to the current user or its instance,
360368
/// as it's a public endpoint. Returns a list of custom emojis, if any.
361369
Future<Map<String, String>> getCustomEmojis(
362-
String mastodonInstanceUrl) async {
370+
String mastodonInstanceUrl,
371+
) async {
363372
final apiUrl = "$mastodonInstanceUrl/api/v1/custom_emojis";
364373
http.Response resp = await _apiGet(apiUrl);
365374

@@ -370,7 +379,7 @@ class ApiService {
370379

371380
return {
372381
for (var item in jsonData)
373-
item['shortcode'] as String: item['url'] as String
382+
item['shortcode'] as String: item['url'] as String,
374383
};
375384
}
376385

@@ -381,7 +390,8 @@ class ApiService {
381390

382391
/// Fetches custom emojis for a Mastodon instance, using cache if available
383392
Future<Map<String, String>> getCachedCustomEmojis(
384-
String mastodonInstanceUrl) async {
393+
String mastodonInstanceUrl,
394+
) async {
385395
if (_customEmojisCache.containsKey(mastodonInstanceUrl)) {
386396
return _customEmojisCache[mastodonInstanceUrl]!;
387397
}

lib/widgets/buttons.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ class FeathrActionButton extends StatelessWidget {
66
final void Function()? onPressed;
77
final String buttonText;
88

9-
const FeathrActionButton(
10-
{required this.onPressed, required this.buttonText, super.key});
9+
const FeathrActionButton({
10+
required this.onPressed,
11+
required this.buttonText,
12+
super.key,
13+
});
1114

1215
@override
1316
Widget build(BuildContext context) {
@@ -18,10 +21,7 @@ class FeathrActionButton extends StatelessWidget {
1821
style: ElevatedButton.styleFrom(backgroundColor: Colors.deepPurple),
1922
child: Text(
2023
buttonText,
21-
style: const TextStyle(
22-
fontFamily: "Urbanist",
23-
fontSize: 18,
24-
),
24+
style: const TextStyle(fontFamily: "Urbanist", fontSize: 18),
2525
),
2626
),
2727
);

lib/widgets/drawer.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ class FeathrDrawerHeader extends StatelessWidget {
3434
account.avatarUrl != null ? NetworkImage(account.avatarUrl!) : null,
3535
),
3636
decoration: BoxDecoration(
37-
image: account.headerUrl != null
38-
? DecorationImage(
39-
image: NetworkImage(account.headerUrl!),
40-
fit: BoxFit.cover,
41-
)
42-
: null,
37+
image:
38+
account.headerUrl != null
39+
? DecorationImage(
40+
image: NetworkImage(account.headerUrl!),
41+
fit: BoxFit.cover,
42+
)
43+
: null,
4344
color: account.headerUrl == null ? Colors.teal : null,
4445
),
4546
);

0 commit comments

Comments
 (0)