ChangeThemeMode Error UI.
Describe the bug ChangeThemeMode Error UI.
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetMaterialApp(
title: 'Flutter Demo',
theme: ThemeData.light(),
darkTheme: ThemeData.dark(),
themeMode: ThemeMode.system,
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Theme Switcher', style: Get.textTheme.bodyLarge),
// title: Text('Theme Switcher'), // it is ok.
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Press the button to toggle theme mode.', style: Get.textTheme.bodyLarge),
// Text('Press the button to toggle theme mode.'), // it is ok.
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Get.changeThemeMode(Get.isDarkMode ? ThemeMode.light : ThemeMode.dark);
},
child: Text('Toggle Theme Mode', style: Get.textTheme.bodyLarge),
// child: Text('Toggle Theme Mode'), // it is ok.
),
],
),
),
);
}
}
Screenshots
--------- tap Toggle Theme Mode Button, text style not change. -------------
Flutter Version: Flutter 3.19.6 • channel stable • [email protected]:flutter/flutter.git Framework • revision 54e66469a9 (3 months ago) • 2024-04-17 13:08:03 -0700 Engine • revision c4cd48e186 Tools • Dart 3.3.4 • DevTools 2.31.1
Getx Version: get: ^4.6.6
Describe on which device you found the bug: iPhone 15, iOS17.4
The same, have you fixed this?
I got same problem here
same problem. https://github.com/jonataslaw/getx/issues/2621#issuecomment-2604249471 Here is a temporary solution provided