layout-demo-flutter icon indicating copy to clipboard operation
layout-demo-flutter copied to clipboard

Hero page error

Open surferus opened this issue 4 years ago • 3 comments

Hi Andrea,

I don't know what that actually means. I click on all the icons and everything works fine except for the Hero Icon when it suddenly crushes giving an assertion error.

Exception caught by widgets library ═══════════════════════════════════
'package:flutter/src/widgets/framework.dart': Failed assertion: line 4377 pos 14: 'owner!._debugCurrentBuildTarget == this': is not true.
The relevant error-causing widget was
MainPage

surferus avatar Jan 17 '21 14:01 surferus

this should fix it:

diff --git a/lib/pages/hero_page.dart b/lib/pages/hero_page.dart
index 0c7639f..8b568a8 100644
--- a/lib/pages/hero_page.dart
+++ b/lib/pages/hero_page.dart
@@ -3,7 +3,7 @@ import 'package:layout_demo_flutter/layout_type.dart';
 import 'package:flutter/rendering.dart';
 import 'package:flutter/foundation.dart';

-class HeroHeader implements SliverPersistentHeaderDelegate {
+class HeroHeader extends SliverPersistentHeaderDelegate {
   HeroHeader({

tomquas avatar Jan 24 '21 07:01 tomquas

Hi! Thank you but it didn't work either like this...still crushing ^^''

surferus avatar Jan 25 '21 13:01 surferus

hmm, i did a 'flutter pub upgrade' in the project's folder, ending up with several package upgrades and am also running the latest flutter:

 sdks:
-  dart: ">=2.8.0 <3.0.0"
+  dart: ">=2.12.0-0.0 <3.0.0"

the hero page works for me.

tomquas avatar Jan 25 '21 16:01 tomquas

Should be fixed after #16.

bizz84 avatar Jan 13 '24 16:01 bizz84