Created
October 3, 2022 11:00
-
-
Save vovaklh/0c67dc8cf8d84b2bd041c69bff16ea75 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
import 'package:flutter/material.dart'; | |
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | |
import 'package:meta_app/presentation/themes/theme.dart'; | |
extension BuildContextExt on BuildContext { | |
AppLocalizations get localizations => AppLocalizations.of(this)!; | |
ThemeTextStyles get text => Theme.of(this).extension<ThemeTextStyles>()!; | |
ThemeColors get color => Theme.of(this).extension<ThemeColors>()!; | |
ThemeGradients get gradient => Theme.of(this).extension<ThemeGradients>()!; | |
bool get isDarkMode => Theme.of(this).brightness == Brightness.dark; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment