├── .gitignore
├── .idea
├── codeStyles
│ └── codeStyleConfig.xml
├── encodings.xml
├── hasFlutterPassedReactnativeYet.iml
├── libraries
│ ├── Dart_Packages.xml
│ └── Dart_SDK.xml
├── misc.xml
├── modules.xml
├── vcs.xml
└── workspace.xml
├── CHANGELOG.md
├── README.md
├── analysis_options.yaml
├── pubspec.yaml
├── screenshot
└── 1.png
└── web
├── favicon.ico
├── index.html
├── main.dart
└── styles.css
/.gitignore:
--------------------------------------------------------------------------------
1 | # Files and directories created by pub
2 | .dart_tool/
3 | .packages
4 | # Remove the following pattern if you wish to check in your lock file
5 | pubspec.lock
6 |
7 | # Conventional directory for build outputs
8 | build/
9 |
10 | # Directory created by dartdoc
11 | doc/api/
12 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/hasFlutterPassedReactnativeYet.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_Packages.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | stargazers
47 | reacc
48 | react
49 | Has Flutter passed React Native yet?
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 | 1553012969141
132 |
133 |
134 | 1553012969141
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.0.0
2 |
3 | - Initial version, created by Stagehand
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [Has Flutter passed React Native yet?](https://piedcipher.github.io/hasFlutterPassedReactNativeYet/)
2 |
3 | > :dart: A Dart Web App to compare :left_right_arrow: GitHub stars of Flutter and React Native
4 |
5 | 
6 |
7 | ## Development Tools
8 | - [Dart](https://webdev.dartlang.org/tools/sdk#install)
9 | - [Web Storm](https://www.jetbrains.com/webstorm/)
10 |
11 | ## Development
12 | ```
13 | $ git clone https://github.com/piedcipher/hasFlutterPassedReactNativeYet.git
14 | $ cd hasFlutterPassedReactNativeYet
15 | $ pub get && webdev run
16 | ```
17 |
18 | ## Building (JavaScript)
19 | ```
20 | $ pub global run webdev build --output=web:build
21 | $ cp -t hasFlutterPassedReactNativeYet/ web/index.html web/style.css web/main.dart.js
22 | ```
23 |
24 | ## Todo
25 | - [ ] Visual Polish
26 | - [ ] Refresh Button
27 | - [ ] Deployment on Netlify
28 |
29 | ## Inspired By
30 | [hasvuepassedreactyet](https://github.com/stursby/hasvuepassedreactyet) Created by [Charlie Hield](https://github.com/stursby/)
31 |
32 | ## Credits
33 | Created from templates made available by Stagehand under a BSD-style
34 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE).
35 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # Defines a default set of lint rules enforced for
2 | # projects at Google. For details and rationale,
3 | # see https://github.com/dart-lang/pedantic#enabled-lints.
4 | include: package:pedantic/analysis_options.yaml
5 |
6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
7 | # Uncomment to specify additional rules.
8 | # linter:
9 | # rules:
10 | # - camel_case_types
11 |
12 | analyzer:
13 | # exclude:
14 | # - path/to/excluded/files/**
15 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: hasFlutterPassedReactnativeYet
2 | description: A Dart Web App to compare GitHub stars of Flutter and React Native.
3 | version: 0.2.1
4 | homepage: https://piedcipher.github.io/hasFlutterPassedReactNativeYet/
5 | author: piedcipher
6 |
7 | environment:
8 | sdk: '>=2.1.0 <3.0.0'
9 |
10 | #dependencies:
11 | # path: ^1.4.1
12 |
13 | dev_dependencies:
14 | build_runner: ^1.1.2
15 | build_web_compilers: ^1.0.0
16 | pedantic: ^1.0.0
17 |
--------------------------------------------------------------------------------
/screenshot/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piedcipher/hasFlutterPassedReactNativeYet/8c2174ac98cbe73d9d7d63480b870e7e36b73175/screenshot/1.png
--------------------------------------------------------------------------------
/web/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piedcipher/hasFlutterPassedReactNativeYet/8c2174ac98cbe73d9d7d63480b870e7e36b73175/web/favicon.ico
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Has Flutter passed React Native yet?
9 |
10 |
11 |
12 |
13 |
14 |
15 | Fork me on GitHub
16 |
17 |
18 |
19 |
20 |
Has Flutter passed React Native yet?
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
30 | |
31 |
32 |
34 | |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/web/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 | import 'dart:html';
4 | import 'package:http/http.dart' as http;
5 |
6 | void main() async {
7 | String apiURL = 'https://api.github.com/repos';
8 | String flutterRepoURL = '$apiURL/flutter/flutter';
9 | String reactnativeRepoURL = '$apiURL/facebook/react-native';
10 |
11 | double flutterStargazersCount = await getStargazersCount(flutterRepoURL);
12 | double reactnativeStargazersCount =
13 | await getStargazersCount(reactnativeRepoURL);
14 |
15 | double difference =
16 | (flutterStargazersCount - reactnativeStargazersCount).abs();
17 | bool hasIt = flutterStargazersCount > reactnativeStargazersCount;
18 |
19 | querySelector('#hasIt').text = hasIt ? 'YES' : 'Not Yet';
20 | querySelector('#diff').text = !hasIt
21 | ? 'Only ${difference.toString()} stars away!'
22 | : 'Ahead by ${difference.toString()} stars!';
23 | querySelector('#flutter_stargazers_count').innerHtml =
24 | '${flutterStargazersCount.toString()} ★';
25 | querySelector('#reactnative_stargazers_count').innerHtml =
26 | '${reactnativeStargazersCount.toString()} ★';
27 | }
28 |
29 | Future getStargazersCount(String repoURL) async {
30 | var response = await http.get(repoURL);
31 | var json = jsonDecode(response.body);
32 | return json['stargazers_count'];
33 | }
34 |
--------------------------------------------------------------------------------
/web/styles.css:
--------------------------------------------------------------------------------
1 | @import url(https://fonts.googleapis.com/css?family=Roboto);
2 |
3 | html, body {
4 | width: 100%;
5 | height: 100%;
6 | margin: 0;
7 | padding: 0;
8 | font-family: 'Roboto', sans-serif;
9 | display: flex;
10 | align-items: center;
11 | justify-content: center;
12 | }
13 |
14 | #hasIt {
15 | font-weight: bolder;
16 | }
17 |
18 | tr {
19 | width: 100%;
20 | }
21 |
22 | td {
23 | font-size: 20px;
24 | }
25 |
--------------------------------------------------------------------------------