diff --git a/lib/components/composed_component.dart b/lib/components/composed_component.dart index 61251b7eb..8518940c8 100644 --- a/lib/components/composed_component.dart +++ b/lib/components/composed_component.dart @@ -9,7 +9,7 @@ import 'package:ordered_set/ordered_set.dart'; /// A component that lets your component be composed by others /// It resembles [BaseGame]. It has an [components] property and an [add] method -mixin ComposedComponent on Component, Resizable { +mixin ComposedComponent on Component { OrderedSet components = new OrderedSet(Comparing.on((c) => c.priority())); @override @@ -34,7 +34,7 @@ mixin ComposedComponent on Component, Resizable { void add(Component c) { this.components.add(c); - if(this is Resizable){ + if (this is Resizable) { // first time resize Resizable thisResizable = this as Resizable; if (thisResizable.size != null) { @@ -43,14 +43,6 @@ mixin ComposedComponent on Component, Resizable { } } - List children() => this.components.where((r) => r is Resizable).cast(); - - @override - void resize(Size size) { - if(this is Resizable){ - Resizable thisResizable = this as Resizable; - thisResizable.size = size; - components.forEach((c) => c.resize(size)); - } - } + List children() => + this.components.where((r) => r is Resizable).cast().toList(); } \ No newline at end of file