-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from yelmuratoff/feat/icons
Feat/icons
- Loading branch information
Showing
24 changed files
with
102 additions
and
128 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
arb-dir: lib/src/core/l10n/translations | ||
template-arb-file: intl_en.arb | ||
output-localization-file: app_localizations.g.dart | ||
output-dir: lib/src/core/l10n/generated | ||
synthetic-package: false | ||
nullable-getter: false | ||
untranslated-messages-file: untranslated_messages.txt |
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:base_starter/src/core/l10n/generated/app_localizations.g.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_localizations/flutter_localizations.dart'; | ||
|
||
/// Localization class which is used to localize app. | ||
/// This class provides handy methods and tools. | ||
/// Usage: | ||
/// Before using L10n.localizations, ensure to call L10n.load(locale). | ||
/// Example: | ||
/// L10n.load(Locale('en')); | ||
/// var myString = L10n.localizations.someTranslation; | ||
final class L10n { | ||
static late AppLocalizations _localizations; | ||
|
||
/// Initialize the L10n class with the correct localization | ||
static void load(Locale locale) { | ||
_localizations = lookupAppLocalizations(locale); | ||
} | ||
|
||
/// Access localized strings directly | ||
static AppLocalizations get current => _localizations; | ||
|
||
static LocalizationsDelegate<Object> get delegate => | ||
AppLocalizations.delegate; | ||
|
||
static List<Locale> get supportedLocales => AppLocalizations.supportedLocales; | ||
|
||
static Locale get computeDefaultLocale { | ||
final locale = WidgetsBinding.instance.platformDispatcher.locale; | ||
|
||
if (AppLocalizations.delegate.isSupported(locale)) return locale; | ||
|
||
return const Locale('en'); | ||
} | ||
|
||
static List<LocalizationsDelegate<dynamic>> get delegates => [ | ||
AppLocalizations.delegate, | ||
GlobalMaterialLocalizations.delegate, | ||
GlobalCupertinoLocalizations.delegate, | ||
GlobalWidgetsLocalizations.delegate, | ||
]; | ||
} |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
Oops, something went wrong.