Skip to content

Commit be55605

Browse files
committed
chore: reformat with Dart 3.9
1 parent 6ecfae2 commit be55605

File tree

10 files changed

+168
-132
lines changed

10 files changed

+168
-132
lines changed

lib/app.dart

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,37 @@ class App extends StatelessComponent {
99

1010
@override
1111
Component build(BuildContext context) {
12-
return Component.element(tag: 'main', classes: 'main', children: [
13-
Router(routes: [
14-
Route(
15-
path: '/',
16-
title: 'Saber: Handwritten Notes',
17-
builder: (context, state) => const Home(),
18-
settings: RouteSettings(priority: 1),
12+
return Component.element(
13+
tag: 'main',
14+
classes: 'main',
15+
children: [
16+
Router(
17+
routes: [
18+
Route(
19+
path: '/',
20+
title: 'Saber: Handwritten Notes',
21+
builder: (context, state) => const Home(),
22+
settings: RouteSettings(priority: 1),
23+
),
24+
Route(
25+
path: '/privacy-policy',
26+
title: 'Saber\'s Privacy Policy',
27+
builder: (context, state) => const PrivacyPolicy(),
28+
settings: RouteSettings(priority: 0.7),
29+
),
30+
Route(
31+
path: '/privacy_policy',
32+
redirect: (context, state) => '/privacy-policy',
33+
settings: RouteSettings(priority: 0),
34+
),
35+
Route(
36+
path: '/support',
37+
title: 'Support with Saber',
38+
builder: (context, state) => const Support(),
39+
),
40+
],
1941
),
20-
Route(
21-
path: '/privacy-policy',
22-
title: 'Saber\'s Privacy Policy',
23-
builder: (context, state) => const PrivacyPolicy(),
24-
settings: RouteSettings(priority: 0.7),
25-
),
26-
Route(
27-
path: '/privacy_policy',
28-
redirect: (context, state) => '/privacy-policy',
29-
settings: RouteSettings(priority: 0),
30-
),
31-
Route(
32-
path: '/support',
33-
title: 'Support with Saber',
34-
builder: (context, state) => const Support(),
35-
),
36-
]),
37-
]);
42+
],
43+
);
3844
}
3945
}

lib/components/badges.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ class Badges extends AsyncStatelessComponent {
88
const Badges({super.key});
99

1010
Future<String> getVersionName() async {
11-
final response = await http
12-
.get(Uri.parse('https://api.github.com/repos/saber-notes/saber/tags'));
13-
assert(response.statusCode >= 200 && response.statusCode < 300,
14-
'Failed to fetch version name: ${response.statusCode} ${response.body}');
11+
final response = await http.get(
12+
Uri.parse('https://api.github.com/repos/saber-notes/saber/tags'),
13+
);
14+
assert(
15+
response.statusCode >= 200 && response.statusCode < 300,
16+
'Failed to fetch version name: ${response.statusCode} ${response.body}',
17+
);
1518
final json = jsonDecode(response.body) as List<dynamic>;
1619
final versionWithV = json[0]['name'] as String;
1720
assert(versionWithV.startsWith('v'));

lib/components/features.dart

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,66 @@ class Features extends StatelessComponent {
1010
h2([text('Private')]),
1111
p([text('Only you can access your notes!')]),
1212
p([
13-
text('You can sync your notes across devices knowing that they are '
14-
'encrypted and stored securely, and not even the server can read '
15-
'them.')
13+
text(
14+
'You can sync your notes across devices knowing that they are '
15+
'encrypted and stored securely, and not even the server can read '
16+
'them.',
17+
),
1618
]),
1719
p([
1820
text('You can also read the '),
1921
a(href: '/privacy-policy', [text('privacy policy')]),
2022
text('.'),
21-
])
23+
]),
2224
]),
2325
div(classes: 'feature', [
2426
h2([text('Cross-platform')]),
2527
p([
26-
text('You can sync and edit your notes across all your devices, '
27-
'whether they\'re a phone, tablet, or computer.')
28+
text(
29+
'You can sync and edit your notes across all your devices, '
30+
'whether they\'re a phone, tablet, or computer.',
31+
),
2832
]),
2933
]),
3034
div(classes: 'feature', [
3135
h2([text('The perfect highlighter')]),
3236
p([
3337
text(
34-
'Saber\'s highlighter doesn\'t overlap with itself and change color '
35-
'when you go over the same area again.')
38+
'Saber\'s highlighter doesn\'t overlap with itself and change color '
39+
'when you go over the same area again.',
40+
),
3641
]),
3742
p([
3843
text('The highlighter also renders '),
3944
span(classes: 'underlineMe', [text('underneath')]),
40-
text(' the text, so you can still see the text clearly.')
45+
text(' the text, so you can still see the text clearly.'),
4146
]),
4247
]),
4348
div(classes: 'feature', [
4449
h2([text('Stay organized')]),
4550
p([
4651
text(
47-
'Saber lets you organize your notes into unlimited nested folders.')
52+
'Saber lets you organize your notes into unlimited nested folders.',
53+
),
4854
]),
4955
p([
5056
text(
51-
'You can also quickly access your most recent notes from the home screen.')
57+
'You can also quickly access your most recent notes from the home screen.',
58+
),
5259
]),
5360
]),
5461
div(classes: 'feature', [
5562
h2([text('Cohesive dark mode')]),
5663
p([
5764
text(
58-
'Saber\'s dark mode doesn\'t just darken the UI; it also darkens the '
59-
'notes themselves.')
65+
'Saber\'s dark mode doesn\'t just darken the UI; it also darkens the '
66+
'notes themselves.',
67+
),
6068
]),
6169
p([
6270
text(
63-
'This means that you can read your notes in the dark without hurting your eyes.')
71+
'This means that you can read your notes in the dark without hurting your eyes.',
72+
),
6473
]),
6574
]),
6675
div(classes: 'feature', [
@@ -77,7 +86,7 @@ class Features extends StatelessComponent {
7786
width: 100,
7887
height: 41,
7988
),
80-
text('GitHub')
89+
text('GitHub'),
8190
]),
8291
text('.'),
8392
]),

lib/components/privacy_policy_from_markdown.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ class PrivacyPolicyFromMarkdown extends AsyncStatelessComponent {
77

88
@override
99
Future<Component> build(BuildContext context) async {
10-
final response = await http.get(Uri.parse(
11-
'https://raw.githubusercontent.com/saber-notes/saber/main/privacy_policy.md'));
12-
assert(response.statusCode >= 200 && response.statusCode < 300,
13-
'Failed to fetch privacy policy: ${response.statusCode} ${response.body}');
10+
final response = await http.get(
11+
Uri.parse(
12+
'https://raw.githubusercontent.com/saber-notes/saber/main/privacy_policy.md',
13+
),
14+
);
15+
assert(
16+
response.statusCode >= 200 && response.statusCode < 300,
17+
'Failed to fetch privacy policy: ${response.statusCode} ${response.body}',
18+
);
1419
final markdown = response.body;
1520

1621
return Markdown(markdown: markdown);

lib/components/rough_notation_initiator.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import 'package:jaspr/jaspr.dart';
22
import 'package:universal_web/js_interop.dart';
33
import 'package:universal_web/web.dart';
44

5-
@Import.onWeb('package:saber_landing/rough_notation.dart',
6-
show: [#RoughNotationController])
5+
@Import.onWeb(
6+
'package:saber_landing/rough_notation.dart',
7+
show: [#RoughNotationController],
8+
)
79
import 'rough_notation_initiator.imports.dart';
810

911
@client
@@ -22,7 +24,10 @@ class _RoughNotationInitiatorState extends State<RoughNotationInitiator> {
2224
super.initState();
2325
if (kIsWeb) {
2426
window.setTimeout(
25-
roughNotationController.showAnnotations.toJS, null, 300);
27+
roughNotationController.showAnnotations.toJS,
28+
null,
29+
300,
30+
);
2631
}
2732
}
2833

lib/main.dart

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,30 @@ import 'package:saber_landing/styles/globals.css.dart';
66
void main() {
77
Jaspr.initializeApp(options: defaultJasprOptions);
88

9-
runApp(Document(
10-
title: 'Saber',
11-
lang: 'en',
12-
styles: globalsCss,
13-
meta: const {
14-
'color-scheme': 'light dark',
15-
'description': 'The notes app built for handwriting',
16-
},
17-
head: [
18-
link(href: 'https://fonts.googleapis.com', rel: 'preconnect'),
19-
link(href: 'https://fonts.gstatic.com', rel: 'preconnect', attributes: {
20-
'crossorigin': '',
21-
}),
22-
link(
23-
rel: 'stylesheet',
24-
href:
25-
'https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,200..800;1,200..800&family=Neucha&display=swap',
26-
),
27-
link(href: '/favicon.ico', rel: 'icon'),
28-
],
29-
body: const App(),
30-
));
9+
runApp(
10+
Document(
11+
title: 'Saber',
12+
lang: 'en',
13+
styles: globalsCss,
14+
meta: const {
15+
'color-scheme': 'light dark',
16+
'description': 'The notes app built for handwriting',
17+
},
18+
head: [
19+
link(href: 'https://fonts.googleapis.com', rel: 'preconnect'),
20+
link(
21+
href: 'https://fonts.gstatic.com',
22+
rel: 'preconnect',
23+
attributes: {'crossorigin': ''},
24+
),
25+
link(
26+
rel: 'stylesheet',
27+
href:
28+
'https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,200..800;1,200..800&family=Neucha&display=swap',
29+
),
30+
link(href: '/favicon.ico', rel: 'icon'),
31+
],
32+
body: const App(),
33+
),
34+
);
3135
}

lib/pages/support.dart

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,38 @@ class Support extends StatelessComponent {
1414
text(
1515
'If you have any questions, feedback, or need assistance with Saber, '
1616
'you can reach out to the community and me here...',
17-
)
17+
),
1818
]),
1919
h2([text('GitHub')]),
20-
p([
21-
text('GitHub is the primary platform for all things Saber!'),
22-
]),
20+
p([text('GitHub is the primary platform for all things Saber!')]),
2321
div(classes: 'btn-wrap', [
2422
a(
2523
href: '$repoUrl/issues/new?template=bug_report.yaml',
2624
classes: 'btn btn-primary',
27-
[
28-
text('Report a bug'),
29-
],
25+
[text('Report a bug')],
3026
),
3127
a(
3228
href: '$repoUrl/issues/new?template=feature_request.yaml',
3329
classes: 'btn',
34-
[
35-
text('Request a feature'),
36-
],
30+
[text('Request a feature')],
3731
),
3832
a(href: '$repoUrl/discussions', classes: 'btn', [
3933
text('Discuss with the community'),
4034
]),
41-
a(href: repoUrl, classes: 'btn', [
42-
text('View the code'),
43-
]),
35+
a(href: repoUrl, classes: 'btn', [text('View the code')]),
4436
]),
4537
h2([text('Email')]),
4638
p([
47-
text(
48-
'You can also reach out to me directly via email at ',
49-
),
39+
text('You can also reach out to me directly via email at '),
5040
a(href: 'mailto:[email protected]', [
5141
5242
]),
53-
text('. Please note that while I will do my best to respond, '
54-
'I get a LOT of emails and aren\'t always able to reply promptly. '
55-
'Please consider using GitHub instead where we have '
56-
'more visibility and can help each other out.'),
43+
text(
44+
'. Please note that while I will do my best to respond, '
45+
'I get a LOT of emails and aren\'t always able to reply promptly. '
46+
'Please consider using GitHub instead where we have '
47+
'more visibility and can help each other out.',
48+
),
5749
]),
5850
]);
5951
}

lib/rough_notation.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,21 @@ class RoughNotationController {
7676
annotate(
7777
element,
7878
AnnotationConfig(
79-
type: 'highlight', color: highlightColor.value, iterations: 2),
79+
type: 'highlight',
80+
color: highlightColor.value,
81+
iterations: 2,
82+
),
8083
)
8184
else
8285
annotate(
8386
element,
8487
AnnotationConfig(
85-
type: 'underline', color: highlightColor.value, iterations: 2),
88+
type: 'underline',
89+
color: highlightColor.value,
90+
iterations: 2,
91+
),
8692
),
87-
])
88-
..show();
93+
])..show();
8994
}
9095

9196
void hideAnnotations() {

0 commit comments

Comments
 (0)