import 'package:calculator_app/util/constants.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';
class CustomBox extends StatelessWidget {
String parameterName;
CustomBox({
super.key,
required this.parameterName,
});
@override
Widget build(BuildContext context) {
return Container(
width: Get.width * 0.45,
height: Get.height * 0.1,
decoration: BoxDecoration(
color: sheetBgColor,
borderRadius: BorderRadius.circular(10),
),
child: Column(
children: [
Text(
parameterName,
style: GoogleFonts.ubuntu(
fontSize: 15,
color: white,
fontWeight: FontWeight.w700,
),
),
TextField(
style: GoogleFonts.ubuntu(color: white),
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: white,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: white,
),
),
hintText: 'Enter $parameterName',
hintStyle: GoogleFonts.ubuntu(color: white),),
onChanged:
),
],
),
);
}
}
I’m trying to make this widget update the value of age and weight in a GetxController in real time but i cant quite figure out how.
I’ve tried assigning the controller parameters directly and also updating them with setters and getters.