agent-workspace / flutter /packages /flutter_localizations /lib /src /utils /date_localizations.dart
agent-workspace / flutter /packages /flutter_localizations /lib /src /utils /date_localizations.dart
Download flutter/packages/flutter_localizations/lib/src/utils/date_localizations.dart from luom2645/agent-workspace: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/luom2645/agent-workspace/resolve/7d4c5ffdb4518a5d7456ef06ab77458fcf42663a/flutter/packages/flutter_localizations/lib/src/utils/date_localizations.dart
- Command line
-
hf download hf://luom2645/agent-workspace@7d4c5ffdb4518a5d7456ef06ab77458fcf42663a/flutter/packages/flutter_localizations/lib/src/utils/date_localizations.dart
-
curl -L -o date_localizations.dart https://huggingface.co/luom2645/agent-workspace/resolve/7d4c5ffdb4518a5d7456ef06ab77458fcf42663a/flutter/packages/flutter_localizations/lib/src/utils/date_localizations.dart
1.14 kB
| // Copyright 2014 The Flutter Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| import 'package:intl/date_symbol_data_custom.dart' as date_symbol_data_custom; | |
| import 'package:intl/date_symbols.dart' as intl; | |
| import '../l10n/generated_date_localizations.dart' as date_localizations; | |
| /// Tracks if date i18n data has been loaded. | |
| bool _dateIntlDataInitialized = false; | |
| /// Loads i18n data for dates if it hasn't been loaded yet. | |
| /// | |
| /// Only the first invocation of this function loads the data. Subsequent | |
| /// invocations have no effect. | |
| void loadDateIntlDataIfNotLoaded() { | |
| if (!_dateIntlDataInitialized) { | |
| date_localizations.dateSymbols | |
| .forEach((String locale, intl.DateSymbols symbols) { | |
| // Perform initialization. | |
| assert(date_localizations.datePatterns.containsKey(locale)); | |
| date_symbol_data_custom.initializeDateFormattingCustom( | |
| locale: locale, | |
| symbols: symbols, | |
| patterns: date_localizations.datePatterns[locale], | |
| ); | |
| }); | |
| _dateIntlDataInitialized = true; | |
| } | |
| } | |