import 'package:flutter/material.dart'; import 'package:get/get.dart'; void main() => runApp(GetMaterialApp(home: Gmus())); class Controller extends GetxController { var name = ''.obs; setName(String newName) { name.value = newName; } } class Gmus extends StatelessWidget { @override Widget build(BuildContext context) { final Controller controller = Get.put(Controller()); return Scaffold( appBar: AppBar( title: Text('gmus'), ), body: Container( child: Column( children: [ Obx(() => Text("Name: ${controller.name}")), TextField( onChanged: controller.setName, decoration: InputDecoration( border: InputBorder.none, hintText: 'Set name', ), ), ], ), ), ); } }