Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null safety and Flutter 2.0 support #164

Closed
enricobenedos opened this issue Mar 15, 2021 · 24 comments
Closed

Null safety and Flutter 2.0 support #164

enricobenedos opened this issue Mar 15, 2021 · 24 comments

Comments

@enricobenedos
Copy link

Good morning,

it will be beautiful if this package can support Flutter 2.0 and null safety. It is also needed to update dependencies on order to achieve that.

Is there any planning about this new migration?

Thank you

@codegrue
Copy link
Owner

Working on it now

@codegrue
Copy link
Owner

Hey everyone. I cannot upgrade to 2.0 until the Cupertino package is updated. I am thinking about ripping this completely out for the 2.0 and having only Material. Any concerns?

@robertoltrocha
Copy link

Hi @codegrue
I only use Material, if I can migrate or make a version only with the Material it will be welcome.
Many packages I cannot update because I depend on yours.
thanks

@codegrue
Copy link
Owner

Same. I've been restricted likewise by what this package depends on.

@codegrue
Copy link
Owner

I'm halfway through the nullsafety changes. There are over 1k lines to fix.. ugh.

@robertoltrocha
Copy link

I understand. Thank you for your commitment.

@enricobenedos
Copy link
Author

enricobenedos commented Mar 19, 2021

I'm using only material on both iOS and Android. It is not a problem to remove Cupertino widgets, even if it is a shame because I think a lot of work has been done to implement it in this package. We can try to fork the repo and create a version that support the null safety.

@codegrue
Copy link
Owner

I wanted to update everyone. I have completed migrating the code (over 1000 changes) and have it checked in locally. I need to do a full regression test before pushing it up. My goal is Friday so you can test, then to pub.dev if all is good. I branded the 1.x code so you can link to that if you still need to use the old version.

@codegrue
Copy link
Owner

I pushed the updated code up. There is still an issue with the currency field, but otherwise, I think everything is working. I will continue to test over the next few days,

@enricobenedos
Copy link
Author

enricobenedos commented Mar 23, 2021

Hey @codegrue,
can you please support the latest intl 0.17.0 stable null safety version?

Because every version of card_settings from git depends on intl >=0.16.0 <=0.17.0-nullsafety.2 and every version of flutter_localizations from sdk depends on intl 0.17.0, card_settings from git is incompatible with flutter_localizations from sdk.
So, because wamii_app depends on both flutter_localizations any from sdk and card_settings from git, version solving failed.

Thanks

@codegrue
Copy link
Owner

It's coming soon. I have other dependencies that are preventing me from releasing up update. Until then you can override in your pubspec.yaml:

dependency_overrides:
    intl: ^0.17.0

@NTMS2017
Copy link

I have been using this plugin since version 1.3.1 and I thank you for that. I am waiting nullsafety version as well.

Currently updating my app to Flutter SDK 2. I update most of the plugin and only waiting card_settings plugin.

Currently I am using following plugins in my app as shown below. When I check the plugin pub spec.yaml you update theintl version and plugin now uses intl: ^0.17.0. Which is good for me. But plugin still use flutter_cupertino_settings: ^0.3.1. Can you update this as well? If not should I have to change my cupertino_icons to version 1.0?

  cupertino_icons: ^1.0.2
  flutter_screenutil: ^5.0.0-nullsafety.11
  auto_size_text: ^3.0.0-nullsafety.0
  connectivity: ^3.0.3
  flutter_spinkit: ^5.0.0
  package_info: ^2.0.0
  in_app_update: ^2.0.0
  upgrader: ^3.1.0
  provider: ^5.0.0
  encrypt: 2.1.0
  onesignal_flutter: ^2.6.3
  convex_bottom_bar: ^3.0.0
  sailor: ^0.7.1
  http: ^0.13.1
  dots_indicator: ^2.0.0
  intl: ^0.17.0
  popup_menu: ^1.0.5
  flutter_picker: ^2.0.0
  flutter_slidable: ^0.5.7
  flutter_datetime_picker: ^1.5.0
  mailer: ^4.0.0
  path_provider: ^2.0.1
  diacritic: ^0.1.3
  image: ^3.0.2
  flutter_speed_dial: ^3.0.5

@codegrue
Copy link
Owner

The nullsafe code is checked in if you reference the Github repository directly. This needs some testing before a full release. Currency is not working yet.

@NTMS2017
Copy link

I did but didnt work. I really need this to finish my app to upload App Store. :(

environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  intl: 0.17.0
  #card_settings: ^1.16.3
  card_settings:
    git:
      url: https://github.com/codegrue/card_settings.git
  font_awesome_flutter:
  adaptive_theme: ^2.0.0
  google_fonts: ^2.0.0
Because every version of card_settings from git depends on flutter_cupertino_settings ^0.3.1 which depends on cupertino_icons ^0.1.3, every version of card_settings from git requires cupertino_icons ^0.1.3.
So, because ntms_card163 depends on both cupertino_icons ^1.0.2 and card_settings from git, version solving failed.
pub get failed (1; So, because ntms_card163 depends on both cupertino_icons ^1.0.2 and card_settings from git, version solving failed.)

And when I try to override I got another error as:

Because ntms_card163 depends on cupertino_icons ^0.3.1 which doesn't match any versions, version solving failed.
pub get failed (1; Because ntms_card163 depends on cupertino_icons ^0.3.1 which doesn't match any versions, version solving failed.)

@NTMS2017
Copy link

OK, This looks work but didnt test yet.

  #cupertino_icons: ^1.0.2
  intl: ^0.17.0
  #card_settings: ^1.16.3
  card_settings:
    git:
      url: https://github.com/codegrue/card_settings.git
  font_awesome_flutter:
  adaptive_theme: ^2.0.0
  google_fonts: ^2.0.0

@NTMS2017
Copy link

It runs but I got an "A RenderFlex overflowed by 14 pixels on the right." issues on CardSettingsInstructions Text as shown below.

Screenshot 2021-03-29 at 10 27 13

@NTMS2017
Copy link

And when I use Apple Mode (top right menu) I got these overflowed issues on example app.

  1. CardSettingsSlider
  2. CardSettingsFilePicker (Photo)

Screenshot 2021-03-29 at 10 37 32

@NTMS2017
Copy link

And this my flutter doctor -v:


[✓] Flutter (Channel stable, 2.0.3, on macOS 11.2.3 20D91 darwin-x64, locale en-GB)
    • Flutter version 2.0.3 at /Users/***********/flutter
    • Framework revision 4d7946a68d (10 days ago), 2021-03-18 17:24:33 -0700
    • Engine revision 3459eb2436
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/***********/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/***********/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 53.1.5
    • Dart plugin version 203.7759

[✓] Connected device (2 available)
    • iPhone SE (1st generation) (mobile) • 66981500-0D1D-4345-A413-F7986CDDF88B • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • Chrome (web)                        • chrome                               • web-javascript • Google Chrome 89.0.4389.90

• No issues found!


@NTMS2017
Copy link

smaller device I got an overflow issues other than that null safety (https://github.com/codegrue/card_settings.git)version looks works perfectly. 👍 🥇
Thank you very much.

@NTMS2017
Copy link

In CardSettingsDouble the initialValue was 0.0. When try to enter a new value it doesn't clear the 0. If I try to clear zero to enter new value I get below error.

In onChanged: if no value I got Invalid double error.

======== Exception caught by widgets ===============================================================
The following FormatException was thrown while calling onChanged:
Invalid double

When the exception was thrown, this was the stack: 
#0      double.parse (dart:core-patch/double_patch.dart:111:28)
#1      NumberParser.parseNumber (package:intl/src/intl/number_parser.dart:238:23)
#2      NumberParser.parse (package:intl/src/intl/number_parser.dart:206:18)
#3      new NumberParser (package:intl/src/intl/number_parser.dart:70:13)
#4      NumberFormat.parse (package:intl/src/intl/number_format.dart:441:29)

@codegrue
Copy link
Owner

2.0 has been published with null safety. It's still unsound mode because cupertino_settings is not yet null-safe. Please log any issues found as separate tickets.

@NTMS2017
Copy link

Thanks. I will use 2.0 plugin and test again. 👍🙏

@codegrue
Copy link
Owner

This should be fixed in 2.0.1

@NTMS2017
Copy link

NTMS2017 commented Mar 29, 2021

Thank you very much, yes tested and it works perfectly.

Only thing is; in your example app there is an overflow issue on CardSettingsInstruction Text. I am not sure if is the design issue or its a plugin issue.

Screenshot 2021-03-29 at 23 06 01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants