transformer_page_view icon indicating copy to clipboard operation
transformer_page_view copied to clipboard

Migrate to null-safety

Open Zeswen opened this issue 3 years ago • 6 comments

Migrate existing code to null-safety.

Full Description Since last week, Flutter 2.0 hit stable branch. With 2.0 we've received Dart 2.12 with new sound null safety mechanism. Current transformer_page_view package doesn't support null-safety yet therefore migration is a must.

Example Code Migration will touch most of the code. Key objectives here is to utilise dart migrate so all of the heavy lifting is done. And after that, run the build and fix places, that were fixed incorrectly by the tool.

Platforms Migration will touch all of the platforms.

Research Resources null-safety is unavoidable thus sooner or later it must be done. https://dart.dev/null-safety

Additional This will be a heavy migration therefore careful code review is a must from one or more developers, after everything is done.

Zeswen avatar Mar 11 '21 12:03 Zeswen

In case anyone is interested, I've forked the repository and added null-safety to it.

Zeswen avatar Mar 15 '21 15:03 Zeswen

Hey, how do i include your fork in my app ?

In case anyone is interested, I've forked the repository and added null-safety to it.

how do i include your fork in my app brother ?

devNamanG avatar May 22 '21 09:05 devNamanG

@namangor04 Add the following to your pubspec.yaml:

dependencies: 
  transformer_page_view: 
    git: 
      url: git://github.com/zeswen/transformer_page_view.git
      ref: master

Zeswen avatar May 22 '21 09:05 Zeswen

Thank you, did it and works like a charm. I wanted to ask one more question, can we start of from a plugin which is not null safe, make it null safe, and also add some more features, and then upload it to pub.dev while giving the credit to the original author ? i have seen 1 plugin that uses native APIs on iOS/Android to display PDFs in the app itself and is not null safe, and also the code doesn't give much flexibility, and I presume it isnt maintained now as the plugin is last updated 15 months ago, the said plugin I am talking about is flutter_full_pdf_viewer ? Is it right to do that ?

devNamanG avatar May 23 '21 08:05 devNamanG

@namangor04 it's completely normal! I've seen it done in many abandoned projects and with my fork of autocomplete_textfield.

I don't have the time to maintain a package, but feel free to use my fork to create a new one!

Just re-fork my fork and start working on the new functionalities, re-add the current example (which I removed for time-purposes) and that's it :)

Zeswen avatar May 23 '21 10:05 Zeswen

@Zeswen thank you, i will probably add that package to pub.dev as soon as i am able to ensure it has no bugs. Thank you for your assistance, appreciate it😃.

devNamanG avatar May 23 '21 17:05 devNamanG