No top-level getter <className> declared
<p>I am expanding on the flutter_gallery example.</p>

<p>I try to create new Gallery Item</p>

<pre><code>new GalleryItem(
  title: 'Journal',
  subtitle: 'Example app coding',
  category: 'Apps',
  routeName: JournalDemo.routeName,
  buildRoute: (BuildContext context) =&gt; new JournalDemo()
),
</code></pre>

<p>and I imported <code>import '../journal/journal_all.dart';</code></p>

<p>Inside I have <code>export 'journal_demo.dart';
</code></p>

<p><code>JournalDemo</code> class is the same class as <code>ListDemo</code>, I only changed the class name and state name:</p>

<pre><code>class JournalDemo extends StatefulWidget {
  JournalDemo({ Key key }) : super(key: key);

  static const String routeName = '/journal';

  @override
  JournalDemoState createState() =&gt; new JournalDemoState();
} 

class JournalDemoState extends State&lt;JournalDemo&gt; {
 .......
</code></pre>

<p>This is the exception I get</p>

<p><code>I/flutter : ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter : The following NoSuchMethodError was thrown building GalleryApp(dirty; state:
I/flutter : GalleryAppState(48280642)):
I/flutter : No top-level getter 'JournalDemo' declared.
I/flutter : NoSuchMethodError: method not found: 'JournalDemo'
I/flutter : Receiver: top-level
I/flutter : Arguments: [...]
I/flutter : When the exception was thrown, this was the stack:
I/flutter : #0      NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:184)
I/flutter : #1      kAllGalleryItems (/Users/matej/IdeaProjects/flutter/journal/lib/gallery/item.dart:51)
I/flutter : #2      kAllGalleryItems (/Users/matej/IdeaProjects/flutter/journal/lib/gallery/item.dart:45)
</code></p>

<p>What should I change?</p>

<p>Thank you</p>