Skip to content

Instantly share code, notes, and snippets.

@JEuler
Created June 5, 2022 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JEuler/9fc27d256e0379ad37778fedfa228475 to your computer and use it in GitHub Desktop.
Save JEuler/9fc27d256e0379ad37778fedfa228475 to your computer and use it in GitHub Desktop.
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