Please make listenable True Function var pro = Provider.of
This is not the correct way to request a feature
Sorry for this,
Please make listenable True Function in GetX.
Controller controller = Get.put(Controller()); is not for update.
please make it for update or rebuild widgets.
I didn't understand what you're talking about.
Could you show a valid source code to demonstrate the current behavior and explain the behavior you want?
This Code is not Working-

But This Code is working-

If your goal with this is just to change the theme of the application, I suggest you see this code:
https://gist.github.com/RodBr/37310335c6639f486bb3c8a628052405
Reference: https://medium.com/swlh/flutter-dynamic-themes-in-3-lines-c3b375f292e3
But if you want to have access to the controller from anywhere, Get.put must be above runApp and with the permanent property equal to true:
void main() {
Get.put(Themex(), permanent: true);
runApp(App());
}
and in your widget put Get.find ():
final Themex themex = Get.find<Themex>();
Anyway, it will be necessary to use something to observe the changes, in this case Obx. See the code working:
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
Get.put(Themex(), permanent: true);
runApp(App());
}
class App extends StatelessWidget {
final Themex themex = Get.find<Themex>();
@override
Widget build(BuildContext context) {
return Obx(() => MaterialApp(
home: Scaffold(
backgroundColor: themex.bgColor.value,
body: Center(child: RaisedButton(onPressed: () => themex.changeTheme())),
),
));
}
}
class Themex extends GetxController {
Rx<Color> bgColor = Colors.white.obs;
RxBool darkTheme = false.obs;
void changeTheme() {
darkTheme.value = !darkTheme.value;
bgColor.value = darkTheme.value ? Colors.black : Colors.white;
print('>>> ${darkTheme.value}');
}
}
Okay, I need to use Obx for observe changes Directly Get.put not working, I understood.
I have a Last question, is Obx Rebuild total StatelessWidget ?
See explanation here:
https://github.com/jonataslaw/getx/blob/master/documentation/en_US/state_management.md#getbuilder-vs-getx-vs-obx-vs-mixinbuilder
With Obx only what is changed and if it is really changed will be rebuilt
Why you're using permanent: true ?
I don't find it in docs for that reason i asking you.
As you were comparing to the provider, I believe that you would need this control on other routes, so permanent configures for the controller never to be removed from memory
See explanation here:
https://github.com/jonataslaw/getx/blob/master/documentation/en_US/dependency_management.md#getput
This is not a concise feature request, and it doesn't seem to have anything to do with this package, so I'm closing it
Thank You for answering me.