diff --git a/CHANGELOG.md b/CHANGELOG.md index 54bded7..fd74ed6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.1 + +Improve pub.dev score + ## 2.0.0 * Update gradle diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index 3d18851..b3fca04 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -10,8 +10,8 @@ void main() { // Verify that platform version is retrieved. expect( find.byWidgetPredicate( - (Widget widget) => - widget is Text && + (Widget widget) => + widget is Text && widget.data?.startsWith('Local timezone:') == true, ), findsOneWidget, diff --git a/lib/flutter_native_timezone_web.dart b/lib/flutter_native_timezone_web.dart index 9f45ab4..394aa41 100644 --- a/lib/flutter_native_timezone_web.dart +++ b/lib/flutter_native_timezone_web.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:html' as html; import 'package:flutter/services.dart'; import 'package:flutter_web_plugins/flutter_web_plugins.dart'; @@ -12,9 +11,10 @@ import 'package:js/js.dart'; class FlutterNativeTimezonePlugin { static void registerWith(Registrar registrar) { final MethodChannel channel = MethodChannel( - 'flutter_native_timezone', - const StandardMethodCodec(), - registrar.messenger); + 'flutter_native_timezone', + const StandardMethodCodec(), + registrar, + ); final FlutterNativeTimezonePlugin instance = FlutterNativeTimezonePlugin(); channel.setMethodCallHandler(instance.handleMethodCall); } @@ -24,11 +24,12 @@ class FlutterNativeTimezonePlugin { case 'getLocalTimezone': return _getLocalTimeZone(); case 'getAvailableTimezones': - return [ _getLocalTimeZone() ]; + return [_getLocalTimeZone()]; default: throw PlatformException( code: 'Unimplemented', - details: "The flutter_native_timezone plugin for web doesn't implement " + details: + "The flutter_native_timezone plugin for web doesn't implement " "the method '${call.method}'"); } } @@ -37,9 +38,7 @@ class FlutterNativeTimezonePlugin { /// local time zone when running on the web. /// String _getLocalTimeZone() { - return jsDateTimeFormat() - .resolvedOptions() - .timeZone; + return jsDateTimeFormat().resolvedOptions().timeZone; } } @@ -57,4 +56,3 @@ abstract class _JSResolvedOptions { @JS() external String get timeZone; } - diff --git a/pubspec.yaml b/pubspec.yaml index 050fe4a..aa75eee 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_native_timezone -description: A flutter plugin for getting the local timezone of the os. -version: 2.0.0 +description: A flutter plugin for getting the local timezone of the device. +version: 2.0.1 homepage: https://github.com/pinkfish/flutter_native_timezone environment: diff --git a/test/flutter_native_timezone_test.dart b/test/flutter_native_timezone_test.dart index 0ad208b..64e16bc 100644 --- a/test/flutter_native_timezone_test.dart +++ b/test/flutter_native_timezone_test.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - + const MethodChannel channel = MethodChannel('flutter_native_timezone'); setUp(() {