I have two screens with each having a different ScaffoldPrelayoutGeometry. This causes FAB to jump sporadically when switching screens.
This is caused by the static/shared/global ExpandableFab.location, which stores scaffold geometry in its field:
@immutable
class ExpandableFab extends StatefulWidget {
/// The location of the ExpandableFab on the screen.
static final FloatingActionButtonLocation location = _ExpandableFabLocation();
// ...
}
class _ExpandableFabLocation extends StandardFabLocation {
final ValueNotifier<ScaffoldPrelayoutGeometry?> scaffoldGeometry =
ValueNotifier(null);
// ...
}
Because scaffoldGeometry is a field in a static instance and updated by different scaffolds, this causes multiple FABs fighting for last-one-wins scaffold geometry, which causes constant jumping during animation.
I have two screens with each having a different
ScaffoldPrelayoutGeometry. This causes FAB to jump sporadically when switching screens.This is caused by the static/shared/global
ExpandableFab.location, which stores scaffold geometry in its field:Because
scaffoldGeometryis a field in a static instance and updated by different scaffolds, this causes multiple FABs fighting for last-one-wins scaffold geometry, which causes constant jumping during animation.