Skip to content

Commit 49c5680

Browse files
committed
Fix box creations in playground
1 parent 9583113 commit 49c5680

File tree

1 file changed

+3
-2
lines changed
  • packages/flutter_box_transform/example/lib

1 file changed

+3
-2
lines changed

packages/flutter_box_transform/example/lib/main.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,15 @@ class _PlaygroundState extends State<Playground> with WidgetsBindingObserver {
330330

331331
late final FocusNode focusNode = FocusNode();
332332

333+
late final PlaygroundModel model = context.read<PlaygroundModel>();
334+
333335
@override
334336
void initState() {
335337
super.initState();
336338

337339
// This is required to center the box based on screen size when the app
338340
// starts.
339341
SchedulerBinding.instance.addPostFrameCallback((_) {
340-
final PlaygroundModel model = context.read<PlaygroundModel>();
341342
model.reset(context);
342343
});
343344

@@ -347,7 +348,7 @@ class _PlaygroundState extends State<Playground> with WidgetsBindingObserver {
347348
@override
348349
void didChangeDependencies() {
349350
super.didChangeDependencies();
350-
// resetPlayground();
351+
if(model.playgroundArea == null) resetPlayground();
351352
}
352353

353354
@override

0 commit comments

Comments
 (0)