@@ -775,10 +775,9 @@ class _CupertinoTextSelectionToolbarItemsElement extends RenderObjectElement {
775775 }
776776
777777 @override
778- void insertChildRenderObject (RenderObject child, dynamic slot) {
778+ void insertRenderObjectChild (RenderObject child, dynamic slot) {
779779 if (slot is _CupertinoTextSelectionToolbarItemsSlot ) {
780780 assert (child is RenderBox );
781- assert (slot is _CupertinoTextSelectionToolbarItemsSlot );
782781 _updateRenderObject (child as RenderBox , slot);
783782 assert (renderObject.childToSlot.containsKey (child));
784783 assert (renderObject.slotToChild.containsKey (slot));
@@ -794,28 +793,30 @@ class _CupertinoTextSelectionToolbarItemsElement extends RenderObjectElement {
794793
795794 // This is not reachable for children that don't have an IndexedSlot.
796795 @override
797- void moveChildRenderObject (RenderObject child, IndexedSlot <Element > slot ) {
796+ void moveRenderObjectChild (RenderObject child, IndexedSlot <Element > oldSlot, IndexedSlot < Element > newSlot ) {
798797 assert (child.parent == renderObject);
799- renderObject.move (child as RenderBox , after: slot ? .value? .renderObject as RenderBox );
798+ renderObject.move (child as RenderBox , after: newSlot ? .value? .renderObject as RenderBox );
800799 }
801800
802801 static bool _shouldPaint (Element child) {
803802 return (child.renderObject.parentData as ToolbarItemsParentData ).shouldPaint;
804803 }
805804
806805 @override
807- void removeChildRenderObject (RenderObject child) {
806+ void removeRenderObjectChild (RenderObject child, dynamic slot ) {
808807 // Check if the child is in a slot.
809- if (renderObject.childToSlot. containsKey (child) ) {
808+ if (slot is _CupertinoTextSelectionToolbarItemsSlot ) {
810809 assert (child is RenderBox );
810+ assert (renderObject.slotToChild.containsKey (slot));
811811 assert (renderObject.childToSlot.containsKey (child));
812- _updateRenderObject (null , renderObject.childToSlot[child] );
812+ _updateRenderObject (null , slot );
813813 assert (! renderObject.childToSlot.containsKey (child));
814814 assert (! renderObject.slotToChild.containsKey (slot));
815815 return ;
816816 }
817817
818818 // Otherwise look for it in the list of children.
819+ assert (slot is IndexedSlot );
819820 assert (child.parent == renderObject);
820821 renderObject.remove (child as RenderBox );
821822 }
0 commit comments