marco.pms.mobileapp/lib/helpers/extensions/app_localization_delegate.dart
Vaibhav Surve 5c53a3f4be Refactor project structure and rename from 'marco' to 'on field work'
- Updated import paths across multiple files to reflect the new package name.
- Changed application name and identifiers in CMakeLists.txt, Runner.rc, and other configuration files.
- Modified web index.html and manifest.json to update the app title and name.
- Adjusted macOS and Windows project settings to align with the new application name.
- Ensured consistency in naming across all relevant files and directories.
2025-11-22 14:20:37 +05:30

27 lines
797 B
Dart

import 'package:on_field_work/helpers/services/localizations/language.dart';
import 'package:on_field_work/helpers/theme/app_notifier.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AppLocalizationsDelegate extends LocalizationsDelegate {
final BuildContext context;
const AppLocalizationsDelegate(this.context);
@override
bool isSupported(Locale locale) =>
Language.getLanguagesCodes().contains(locale.languageCode);
@override
Future load(Locale locale) => _load(locale);
Future _load(Locale locale) async {
Provider.of<AppNotifier>(context, listen: false)
.changeLanguage(Language.getLanguageFromCode(locale.languageCode));
return;
}
@override
bool shouldReload(LocalizationsDelegate old) => false;
}