Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get.forceAppUpdate() in 5.0.0-release-candidate-9.2.1 does not work #3231

Open
CalmLuo opened this issue Oct 2, 2024 · 2 comments
Open

Get.forceAppUpdate() in 5.0.0-release-candidate-9.2.1 does not work #3231

CalmLuo opened this issue Oct 2, 2024 · 2 comments
Assignees

Comments

@CalmLuo
Copy link

CalmLuo commented Oct 2, 2024

When I change the theme using Get.forceAppUpdate(), the build is called, but the GetMaterialApp is not modified, it is the same theme data as before.

This is not valid in 5.0.0-release-candidate-9.2.1, but is valid in get 4.6.6

The code is as follows:

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    final c = AppController.to;
    debugPrint("MyApp: ${c.themeMode.value}, ${c.colorSelected.value}"); // Value has changed

    return GetMaterialApp(
      title: 'Calmonel',
      debugShowCheckedModeBanner: false,

      themeMode: c.themeMode.value,
      theme: ThemeData(
        brightness: Brightness.light,
        useMaterial3: c.useMaterial3.value,
        colorSchemeSeed: c.colorSelected.value.color,
        dividerTheme: const DividerThemeData(
          space: .0,
          indent: 16,
          thickness: .5,
          color: Color.fromRGBO(0, 0, 0, .1),
        ),
      ),
      darkTheme: ThemeData(
        brightness: Brightness.dark,
        useMaterial3: c.useMaterial3.value,
        colorSchemeSeed: c.colorSelected.value.color,
        dividerTheme: const DividerThemeData(
          space: .0,
          indent: 16,
          thickness: .5,
          color: Color.fromRGBO(255, 255, 255, .1),
        ),
      ),
     ...
}
@ZhuJHua
Copy link

ZhuJHua commented Oct 5, 2024

just try Get.changeTheme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@jonataslaw @CalmLuo @ZhuJHua and others