You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:localization/localization.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../controllers/providers/settings/setting_provider.dart';
|
|
|
|
|
import '../models/enums/translation_keys.dart';
|
|
|
|
|
|
|
|
|
|
extension BuildContextExtension on BuildContext {
|
|
|
|
|
String translate(TranslationKeys translationKey) {
|
|
|
|
|
return translationKey.name.i18n([Localizations.localeOf(this).toString()]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool get isDark => Provider.of<SettingProvider>(this).theme == "dark";
|
|
|
|
|
}
|