title: The ThemeData useMaterial3 isnt working in others routes or class
body: <p>As i describe in the title my have 2 route or classes a loginscreen and a homepage, the problem is that the <code>useMaterial3</code> is only working on the loginscreen and isn't work on the homepage</p>
  <p>This is the <code>main.dart</code></p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:tesis/home.dart';
  import 'package:tesis/login.dart';
  import 'package:tesis/theme/color_schemes.g.dart';
  
  void main() {
    runApp(const MyApp());
  }
  
  class MyApp extends StatelessWidget {
    const MyApp({Key? key}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'Tesis',
        theme: ThemeData(
          useMaterial3: true,
          colorScheme: lightColorScheme,
        ),
        darkTheme: ThemeData(colorScheme: darkColorScheme),
        initialRoute: '/',
        routes: {
          '/': (context) =&gt; const LoginScreen(),
          '/second': (context) =&gt; const Home(),
        },
        // home: const LoginScreen(),
      );
    }
  }
  </code></pre>
  <p>This is the loginscreen</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:tesis/home.dart';
  
  class LoginScreen extends StatefulWidget {
    const LoginScreen({Key? key}) : super(key: key);
  
    @override
    State&lt;LoginScreen&gt; createState() =&gt; _LoginScreenState();
  }
  
  class _LoginScreenState extends State&lt;LoginScreen&gt; {
    bool _visibility = true;
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        resizeToAvoidBottomInset: false,
        body: Container(
          decoration: const BoxDecoration(
            image: DecorationImage(
              image: AssetImage('images/background.jpg'),
              fit: BoxFit.cover,
            ),
          ),
          child: Center(
            child: Container(
              width: double.infinity,
              height: 447,
              clipBehavior: Clip.hardEdge,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(20),
                color: Theme.of(context).colorScheme.background,
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  const Text(
                    'Bienvenido',
                    style: TextStyle(
                      fontWeight: FontWeight.w400,
                      fontSize: 36,
                    ),
                  ),
                  const Padding(padding: EdgeInsets.all(7.0)),
                  const Text(
                    'Ingresar',
                    style: TextStyle(
                      fontWeight: FontWeight.w400,
                      fontSize: 24,
                    ),
                  ),
                  const Padding(
                    padding: EdgeInsets.all(10.0),
                  ),
                  SizedBox(
                    width: 250,
                    child: TextFormField(
                      decoration: const InputDecoration(
                        labelText: 'Usuario',
                        border: OutlineInputBorder(),
                        prefixIcon: Icon(Icons.person),
                      ),
                    ),
                  ),
                  const Padding(
                    padding: EdgeInsets.all(7.0),
                  ),
                  SizedBox(
                    width: 250,
                    child: TextFormField(
                      obscureText: _visibility,
                      decoration: InputDecoration(
                          border: const OutlineInputBorder(),
                          prefixIcon: const Icon(Icons.lock),
                          labelText: 'Contraseña',
                          suffixIcon: IconButton(
                              icon: Icon(
                                _visibility
                                    ? Icons.visibility
                                    : Icons.visibility_off,
                              ),
                              onPressed: () {
                                setState(() {
                                  _visibility = !_visibility;
                                });
                              })),
                    ),
                  ),
                  const Padding(
                    padding: EdgeInsets.all(11.0),
                  ),
                  ElevatedButton(
                    style: ElevatedButton.styleFrom(
                      // Foreground color
                      onPrimary: Colors.white,
                      // Background color
                      primary: Theme.of(context).colorScheme.primary,
                    ).copyWith(
                      elevation: ButtonStyleButton.allOrNull(0.0),
                    ),
                    onPressed: () {
                      Navigator.pushNamed(context,'/second');
                    },
                    child: const Text('Iniciar Sección'),
                  ),
                  const Padding(
                    padding: EdgeInsets.all(11.0),
                  ),
                  Text.rich(
                    TextSpan(
                        text: 'Aún no te has registrado?',
                        children: &lt;TextSpan&gt;[
                          TextSpan(
                            text: ' Registrate',
                            style: TextStyle(
                              color: Theme.of(context).colorScheme.primary,
                              fontWeight: FontWeight.w400,
                              fontSize: 14,
                            ),
                          ),
                        ]),
                  ),
                ],
              ),
            ),
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>This is the homepage</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:tesis/login.dart';
  
  class Home extends StatefulWidget {
    const Home({Key? key}) : super(key: key);
  
    @override
    State&lt;Home&gt; createState() =&gt; _HomeState();
  }
  
  class _HomeState extends State&lt;Home&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        floatingActionButton: FloatingActionButton(
          onPressed: () {},
        ),
        appBar: AppBar(
          backgroundColor: Theme.of(context).colorScheme.background,
          leading: IconButton(
            icon: Icon(Icons.menu),
            onPressed: () {
              Navigator.pushNamed(context, '/');
            },
          ),
          title: Text('Title Large'),
          centerTitle: true,
          actions: [
            IconButton(
              onPressed: (() {}),
              icon: Icon(Icons.account_circle_outlined),
            )
          ],
        ),
      );
    }
  }
  </code></pre>