Skip to content

Commit a524af0

Browse files
committed
Add github_summary.dart
1 parent 56a247e commit a524af0

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

lib/main.dart

+12-21
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:window_to_front/window_to_front.dart';
44

55
import 'github_oauth_credentials.dart';
66
import 'src/github_login.dart';
7+
import 'src/github_summary.dart';
78

89
void main() {
910
runApp(const MyApp());
@@ -35,23 +36,14 @@ class MyHomePage extends StatelessWidget {
3536
return GithubLoginWidget(
3637
builder: (context, httpClient) {
3738
WindowToFront.activate();
38-
return FutureBuilder<CurrentUser>(
39-
future: viewerDetail(httpClient.credentials.accessToken),
40-
builder: (context, snapshot) {
41-
return Scaffold(
42-
appBar: AppBar(
43-
title: Text(title),
44-
elevation: 2,
45-
),
46-
body: Center(
47-
child: Text(
48-
snapshot.hasData
49-
? 'Hello ${snapshot.data!.login}!'
50-
: 'Retrieving viewer login details...',
51-
),
52-
),
53-
);
54-
},
39+
return Scaffold(
40+
appBar: AppBar(
41+
title: Text(title),
42+
elevation: 2,
43+
),
44+
body: GitHubSummary(
45+
gitHub: _getGitHub(httpClient.credentials.accessToken),
46+
),
5547
);
5648
},
5749
githubClientId: githubClientId,
@@ -61,7 +53,6 @@ class MyHomePage extends StatelessWidget {
6153
}
6254
}
6355

64-
Future<CurrentUser> viewerDetail(String accessToken) async {
65-
final gitHub = GitHub(auth: Authentication.withToken(accessToken));
66-
return gitHub.users.getCurrentUser();
67-
}
56+
GitHub _getGitHub(String accessToken) {
57+
return GitHub(auth: Authentication.withToken(accessToken));
58+
}

macos/Podfile.lock

+6
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@ PODS:
22
- FlutterMacOS (1.0.0)
33
- url_launcher_macos (0.0.1):
44
- FlutterMacOS
5+
- window_to_front (0.0.1):
6+
- FlutterMacOS
57

68
DEPENDENCIES:
79
- FlutterMacOS (from `Flutter/ephemeral`)
810
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
11+
- window_to_front (from `Flutter/ephemeral/.symlinks/plugins/window_to_front/macos`)
912

1013
EXTERNAL SOURCES:
1114
FlutterMacOS:
1215
:path: Flutter/ephemeral
1316
url_launcher_macos:
1417
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
18+
window_to_front:
19+
:path: Flutter/ephemeral/.symlinks/plugins/window_to_front/macos
1520

1621
SPEC CHECKSUMS:
1722
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
1823
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
24+
window_to_front: 7662b5b0b260707d71f9bc26383a6328c4f13ceb
1925

2026
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
2127

0 commit comments

Comments
 (0)