flushbar icon indicating copy to clipboard operation
flushbar copied to clipboard

Migrate to null safety

Open prasadsunny1 opened this issue 3 years ago • 6 comments

  • Migrate to null safety using flutter sdk 2.0.1
  • Bump a major version

prasadsunny1 avatar Mar 08 '21 07:03 prasadsunny1

@AndreHaueisen Any updates on this ?

pr-1 avatar Mar 22 '21 11:03 pr-1

Getting the following errors since the latest commit:

    ../../flutter/.pub-cache/git/flushbar-b67c315fbc0f0d1a21a04a88719a7b76ddc0a5dd/lib/flushbar_route.dart:283:27: Error: The argument type 'FlushbarStatus?' can't be assigned to the parameter type 'FlushbarStatus' because 'FlushbarStatus?' is nullable and 'FlushbarStatus' isn't.
     - 'FlushbarStatus' is from 'package:flushbar/flushbar.dart' ('../../flutter/.pub-cache/git/flushbar-b67c315fbc0f0d1a21a04a88719a7b76ddc0a5dd/lib/flushbar.dart').
            _onStatusChanged!(currentStatus);
                              ^
    ../../flutter/.pub-cache/git/flushbar-b67c315fbc0f0d1a21a04a88719a7b76ddc0a5dd/lib/flushbar_route.dart:289:27: Error: The argument type 'FlushbarStatus?' can't be assigned to the parameter type 'FlushbarStatus' because 'FlushbarStatus?' is nullable and 'FlushbarStatus' isn't.
     - 'FlushbarStatus' is from 'package:flushbar/flushbar.dart' ('../../flutter/.pub-cache/git/flushbar-b67c315fbc0f0d1a21a04a88719a7b76ddc0a5dd/lib/flushbar.dart').
            _onStatusChanged!(currentStatus);
                              ^
    ../../flutter/.pub-cache/git/flushbar-b67c315fbc0f0d1a21a04a88719a7b76ddc0a5dd/lib/flushbar_route.dart:293:27: Error: The argument type 'FlushbarStatus?' can't be assigned to the parameter type 'FlushbarStatus' because 'FlushbarStatus?' is nullable and 'FlushbarStatus' isn't.
     - 'FlushbarStatus' is from 'package:flushbar/flushbar.dart' ('../../flutter/.pub-cache/git/flushbar-b67c315fbc0f0d1a21a04a88719a7b76ddc0a5dd/lib/flushbar.dart').
            _onStatusChanged!(currentStatus);
                              ^
    ../../flutter/.pub-cache/git/flushbar-b67c315fbc0f0d1a21a04a88719a7b76ddc0a5dd/lib/flushbar_route.dart:303:27: Error: The argument type 'FlushbarStatus?' can't be assigned to the parameter type 'FlushbarStatus' because 'FlushbarStatus?' is nullable and 'FlushbarStatus' isn't.
     - 'FlushbarStatus' is from 'package:flushbar/flushbar.dart' ('../../flutter/.pub-cache/git/flushbar-b67c315fbc0f0d1a21a04a88719a7b76ddc0a5dd/lib/flushbar.dart').
            _onStatusChanged!(currentStatus);
                              ^

TheJulianJES avatar May 08 '21 18:05 TheJulianJES

when can this be merged?

rishabhdeepsingh avatar May 23 '21 15:05 rishabhdeepsingh

Should be able to use this for now:

  flushbar:
    git:
      url: git://github.com/prasadsunny1/flushbar
      ref: master

TheJulianJES avatar May 28 '21 23:05 TheJulianJES

ElevatedButton(
                onPressed: () {
                  FlushbarHelper.createSuccess(
                          message: 'Action Success', title: 'Success')
                      .show(context);
                },
                child: Text('Success')),

when flushbar close after 3 second after that throw error :

══╡ EXCEPTION CAUGHT BY ANIMATION LIBRARY ╞═════════════════════════════════════════════════════════ The following assertion was thrown while notifying status listeners for AnimationController: 'package:flushbar/flushbar_route.dart': Failed assertion: line 307 pos 18: 'overlayEntries.isEmpty': is not true.

When the exception was thrown, this was the stack: #2 FlushbarRoute._handleStatusChanged (package:flushbar/flushbar_route.dart:307:18) #3 AnimationLocalStatusListenersMixin.notifyStatusListeners (package:flutter/src/animation/listener_helpers.dart:199:19) #4 AnimationController._checkStatusChanged (package:flutter/src/animation/animation_controller.dart:812:7) #5 AnimationController._tick (package:flutter/src/animation/animation_controller.dart:828:5) #6 Ticker._tick (package:flutter/src/scheduler/ticker.dart:238:12) #7 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15) #8 SchedulerBinding.handleBeginFrame. (package:flutter/src/scheduler/binding.dart:1058:11) #9 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:397:8) #10 SchedulerBinding.handleBeginFrame (package:flutter/src/scheduler/binding.dart:1056:17) #11 SchedulerBinding._handleBeginFrame (package:flutter/src/scheduler/binding.dart:977:5) #15 _invoke1 (dart:ui/hooks.dart:182:10) #16 PlatformDispatcher._beginFrame (dart:ui/platform_dispatcher.dart:237:5) #17 _beginFrame (dart:ui/hooks.dart:114:31) (elided 5 frames from class _AssertionError and dart:async)

The AnimationController notifying status listeners was: AnimationController#349f1(⏮ 0.000; paused; for FlushbarRoute) ════════════════════════════════════════════════════════════════════════════════════════════════════

jayeshindianic avatar Jun 30 '21 07:06 jayeshindianic

awesome!!

gx14ac avatar Jul 12 '21 14:07 gx14ac