dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

Scrolling breaks when turning android phone

Open mennovanhout opened this issue 1 year ago • 7 comments

If you have a dashboard and keep it in portrait mode. When the dashboard doesn't fit rotating to landscape it just gives up rotating at all. And will never work again until restart.

mennovanhout avatar Feb 19 '24 14:02 mennovanhout

The following _TypeError was thrown building _DashboardStack<CustomDashboardItem>-[LabeledGlobalKey<_DashboardStackState<CustomDashboardItem>>#ceda8](dirty, state: _DashboardStackState<CustomDashboardItem>#dc000):
Null check operator used on a null value

The relevant error-causing widget was: 
  Dashboard<CustomDashboardItem> Dashboard:file:///C:/development/apps/hdashboards/lib/screens/dashboard.dart:298:19
When the exception was thrown, this was the stack: 
#0      _ItemCurrentLayout.isBottomSide (package:dashboard/src/models/item_current_layout.dart:900:55)
#1      _ItemCurrentLayout._currentPosition (package:dashboard/src/models/item_current_layout.dart:230:21)
#2      _DashboardStackState.buildPositioned (package:dashboard/src/widgets/dashboard_stack.dart:96:59)
#3      _DashboardStackState.build.<anonymous closure> (package:dashboard/src/widgets/dashboard_stack.dart:287:18)
#4      MappedIterator.moveNext (dart:_internal/iterable.dart:403:20)
#5      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#6      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#7      new List.of (dart:core-patch/array_patch.dart:39:18)

Looks its coming from isBottomSide in item_current_layout.dart

bool get isBottomSide {
    var last = (_layoutController._endsTree.lastKey())!; // THIS LINE
    var lIn = _layoutController.getIndexCoordinate(last);
    return _layoutController.getIndexCoordinate(_endIndex)[1] == lIn[1];
  }

mennovanhout avatar Feb 19 '24 15:02 mennovanhout

New reproducable way:

  1. Open example project
  2. Use trash icon to delete all current cards
  3. Add new card via + icon
  4. Drag the card to the bottom of the screen, it crashes!

mennovanhout avatar Feb 19 '24 21:02 mennovanhout

@Mehmetyaz i am also willing to pay to get the issues resolved please contact me.

mennovanhout avatar Feb 28 '24 10:02 mennovanhout

Hey! I am sorry. No need for money my friend. But I'm very busy right now. It's not possible for me to take care of it for a few more days. But if you can throw a PR it can be resolved sooner. Or you'll have to wait a little longer.

Mehmetyaz avatar Feb 28 '24 10:02 Mehmetyaz

Hey! I am sorry. No need for money my friend. But I'm very busy right now. It's not possible for me to take care of it for a few more days. But if you can throw a PR it can be resolved sooner. Or you'll have to wait a little longer.

I am trying to resolve it myself haha, but my in depth knowledge of flutter is not nearly enough. I found that some variables are failing within the flutter core _maxExtend being null for instance. Probably due the fact that in dashboard _scroll runs either to fast or something. But i couldn't find any solution so far, i already saw _scroll is being called on addPostFrame....

But litterly my entire company is a bit running on dashboard so please let me atleast do a donation! As your package is the core of my business, i would love to do a contribution.

mennovanhout avatar Feb 28 '24 11:02 mennovanhout

Open source is open source :) I don't think it's something that deserves sponsorship.

BUT!

I am actively looking for a job, I can work/consult at your company part time or full time and remotely. It's not just for Flutter positions either.

In any case:

I will try to solve the problem after a few days.

Mehmetyaz avatar Feb 28 '24 12:02 Mehmetyaz

Open source is open source :) I don't think it's something that deserves sponsorship.

BUT!

I am actively looking for a job, I can work/consult at your company part time or full time and remotely. It's not just for Flutter positions either.

In any case:

I will try to solve the problem after a few days.

Reach out to me via [email protected] there some things i am struggling with within flutter and things i could do better or more efficient. I would like to hire you as a freelance for s bit to help me out? Im a solo company so that would be amazing. Mail me your hourly rate etc please

mennovanhout avatar Feb 28 '24 18:02 mennovanhout