- 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_hook
package - Improved tests
Refactor deprecated methods in tests
- Added
full date pattern
(only available for iOS, macOS and web) - Fix returning empty string
""
instead ofnull
on windows & linux when pattern is unavailable
BREAKING CHANGES:
Removed
initialize
method -> useSDTFScope
insteadRemoved
dateFormat
getter -> usegetDatePattern()
insteadRemoved
mediumDateFormat
getter -> usegetMediumDatePattern()
insteadRemoved
longDateFormat
getter -> usegetLongDatePattern()
insteadRemoved
timeFormat
getter -> 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
SDTFScope
widget:
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
initialize
method -> useSDTFScope
insteadDeprecated
dateFormat
getter -> usegetDatePattern()
insteadDeprecated
mediumDateFormat
getter -> usegetMediumDatePattern()
insteadDeprecated
longDateFormat
getter -> usegetLongDatePattern()
insteadDeprecated
timeFormat
getter -> 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 🎉