diff --git a/lib/country_code_picker.dart b/lib/country_code_picker.dart index 6a04445..1ba6ded 100644 --- a/lib/country_code_picker.dart +++ b/lib/country_code_picker.dart @@ -1,7 +1,5 @@ library country_code_picker; -import 'dart:io'; - import 'package:collection/collection.dart' show IterableExtension; import 'package:country_code_picker/country_code.dart'; import 'package:country_code_picker/country_codes.dart'; @@ -9,6 +7,7 @@ import 'package:country_code_picker/selection_dialog.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:modal_bottom_sheet/modal_bottom_sheet.dart'; +import 'package:universal_platform/universal_platform.dart'; export 'country_code.dart'; @@ -279,7 +278,7 @@ class CountryCodePickerState extends State { } void showCountryCodePickerDialog() { - if (kIsWeb || (!Platform.isIOS && !Platform.isAndroid)) { + if (!UniversalPlatform.isAndroid && !UniversalPlatform.isIOS) { showDialog( barrierColor: widget.barrierColor ?? Colors.grey.withOpacity(0.5), // backgroundColor: widget.backgroundColor ?? Colors.transparent, diff --git a/pubspec.yaml b/pubspec.yaml index 707eb9e..2a466f1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,6 +12,7 @@ dependencies: modal_bottom_sheet: ^2.0.0 collection: ^1.15.0 + universal_platform: ^1.0.0-nullsafety flutter: assets: