Created
June 5, 2022 19:34
-
-
Save JEuler/9fc27d256e0379ad37778fedfa228475 to your computer and use it in GitHub Desktop.
This file contains 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
class AppConfig extends InheritedWidget { | |
const AppConfig({ | |
Key? key, | |
required this.appName, | |
required this.flavorName, | |
required this.apiBaseUrl, | |
required this.coreAppBaseUrl, | |
required Widget child, | |
}) : super(child: child); | |
final String apiBaseUrl; | |
final String appName; | |
final String coreAppBaseUrl; | |
final String flavorName; | |
@override | |
bool updateShouldNotify(InheritedWidget oldWidget) => false; | |
static AppConfig? of(BuildContext context) { | |
return context.dependOnInheritedWidgetOfExactType<AppConfig>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment