Created
December 12, 2018 15:44
-
-
Save nhancv/9ed728ef4287e96d46f4915b4f1be822 to your computer and use it in GitHub Desktop.
Global env
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| import 'package:meta/meta.dart'; | |
| class Env { | |
| Env._({@required this.apiBaseUrl}); | |
| final String apiBaseUrl; | |
| factory Env.dev() { | |
| return new Env._(apiBaseUrl: "https://api.github.com"); | |
| } | |
| } | |
| class Global { | |
| static final Global _instance = Global._private(); | |
| Global._private(); | |
| factory Global() => _instance; | |
| Env env = Env.dev(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment