You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can either initalized `GitHubColour` before `runApp(Widget)`:
10
+
You can either initalized `GitHubColour` before `runApp(Widget)` (Call it after `WidgetsFlutterBinding.ensureInitialized()` if want to get data from offline):
then uses `getExistedInstance()` inside the `Widget`:
@@ -27,7 +35,7 @@ class YourAppWidget extends StatelessWidget {
27
35
}
28
36
```
29
37
30
-
or wrapped into `FutureBuilder`directly in`State`'s `initState` (not recommended uses `getInstance()` directly in `FutureBuilder`):
38
+
or wrapped into `FutureBuilder`with initalized `Future<GitHubColour>` variable into`State`'s `initState` (not recommended uses `getInstance()` directly in `FutureBuilder`):
31
39
32
40
```dart
33
41
class _YourAnotherAppWidgetState extends State<YourAnotherAppWidget> {
@@ -54,6 +62,8 @@ class _YourAnotherAppWidgetState extends State<YourAnotherAppWidget> {
54
62
This package supported caching system as a backup when making request failed. It uses LZMA compress data and store as a file under temporary directory (for VM)
55
63
or store as `shared_preference` (for Web, which is `LocalStorage`).
56
64
65
+
If no cache available, by default, `GitHubColour.getInstance()` will uses [local's `colors.json`](lib/colors.json) as last resort. However, this package will not make a new release when newer commit of `color.json` pushed since it minified that ensure the package can be downloaded as fast as possible.
66
+
57
67
## Note for American English developers
58
68
59
69
It's provide alias class `GitHubColor` for who uses "color" mostly.
0 commit comments