title: why are enums declared outside classes in flutter?
body: <p>I was looking at the flutter's official documentation for radio buttons and noticed that the enums have been declared outside the class. Why can't we declare them inside the class and if we can, what is the difference in declaring them inside and outside of a class?</p>
  <p>Here's the sample code :</p>
  <pre><code>class MyApp extends StatelessWidget {
    const MyApp({Key? key}) : super(key: key);
  
    static const String _title = 'Flutter Code Sample';
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: _title,
        home: Scaffold(
          appBar: AppBar(title: const Text(_title)),
          body: const Center(
            child: MyStatefulWidget(),
          ),
        ),
      );
    }
  }
  
  enum SingingCharacter { lafayette, jefferson }
  
  
  class MyStatefulWidget extends StatefulWidget {
    const MyStatefulWidget({Key? key}) : super(key: key);
  
    @override
    State&lt;MyStatefulWidget&gt; createState() =&gt; _MyStatefulWidgetState();
  }
  
  
  class _MyStatefulWidgetState extends State&lt;MyStatefulWidget&gt; {
    SingingCharacter? _character = SingingCharacter.lafayette;
  
    @override
    Widget build(BuildContext context) {
      return Column(
        children: &lt;Widget&gt;[
          ListTile(
            title: const Text('Lafayette'),
            leading: Radio&lt;SingingCharacter&gt;(
              value: SingingCharacter.lafayette,
              groupValue: _character,
              onChanged: (SingingCharacter? value) {
                setState(() {
                  _character = value;
                });
              },
            ),
          ),
          ListTile(
            title: const Text('Thomas Jefferson'),
            leading: Radio&lt;SingingCharacter&gt;(
              value: SingingCharacter.jefferson,
              groupValue: _character,
              onChanged: (SingingCharacter? value) {
                setState(() {
                  _character = value;
                });
              },
            ),
          ),
        ],
      );
    }
  }
  </code></pre>
  <p>Can someone explain ?
  Any help will be appreciated.</p>