- Fix bug on android:
A problem occurred configuring project ':system_date_time_format'. Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl. Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
- Update dependencies
Added full date pattern for android
- Updated README info about ->
system_date_time_format_hookpackage - Improved tests
Refactor deprecated methods in tests
- Added
full date pattern(only available for iOS, macOS and web) - Fix returning empty string
""instead ofnullon windows & linux when pattern is unavailable
BREAKING CHANGES:
Removed
initializemethod -> useSDTFScopeinsteadRemoved
dateFormatgetter -> usegetDatePattern()insteadRemoved
mediumDateFormatgetter -> usegetMediumDatePattern()insteadRemoved
longDateFormatgetter -> usegetLongDatePattern()insteadRemoved
timeFormatgetter -> usegetTimePattern()instead
Updated the SDK constraint to '>=2.18.6 <4.0.0'
- Fixed attachments in README
- Fixed typos
- Updated dependencies
Added logo
Fixed deprecated usage in comments
- Introduced
SDTFScopewidget:
void main() {
runApp(const SDTFScope(child: App()));
}
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
final patterns = SystemDateTimeFormat.of(context);
final datePattern = patterns.datePattern;
final mediumDatePattern = patterns.mediumDatePattern;
final longDatePattern = patterns.longDatePattern;
final timePattern = patterns.timePattern;
print(datePattern); // e.g. "M/d/yy"
print(mediumDatePattern); // e.g. "MMM d,y"
print(longDatePattern); // e.g. "MMMM d,y"
print(timePattern); // e.g. "HH:mm"
}
}- Introduced raw async getters:
final format = SystemDateTimeFormat();
final datePattern = await format.getDatePattern();
final mediumDatePattern = await format.getMediumDatePattern();
final longDatePattern = await format.getLongDatePattern();
final timePattern = await format.getTimePattern();
print(datePattern); // e.g. "M/d/yy"
print(mediumDatePattern); // e.g. "MMM d,y"
print(longDatePattern); // e.g. "MMMM d,y"
print(timePattern); // e.g. "HH:mm"Warning
Deprecated
initializemethod -> useSDTFScopeinsteadDeprecated
dateFormatgetter -> usegetDatePattern()insteadDeprecated
mediumDateFormatgetter -> usegetMediumDatePattern()insteadDeprecated
longDateFormatgetter -> usegetLongDatePattern()insteadDeprecated
timeFormatgetter -> usegetTimePattern()instead
Added linux support
- Fixed library names conflict
- Improved documentation
Added web support
Added windows support
Added macOS support
- Formatted code
- Updated screenshots
- Improved README
Initial release 🎉