makeTextInputDetails function

Widget makeTextInputDetails(
  1. {required String title,
  2. required void callback(
    1. String
    ),
  3. TextStyle? titleStyle,
  4. TextStyle? hintStyle,
  5. String hintText = ""}
)

Implementation

Widget makeTextInputDetails(
    {required String title,
    required void Function(String) callback,
    TextStyle? titleStyle,
    TextStyle? hintStyle,
    String hintText = ""}) {
  return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        _acquireInputTitleText(title: title, titleStyle: titleStyle),
        const SizedBox(height: 20),
        Padding(
          padding: const EdgeInsets.all(34.0),
          child: Builder(builder: (context) {
            TextEditingController controller =
                TextEditingController();
            controller.addListener(() {
              callback.call(controller.text);
            });
            return TextFormField(
              cursorColor: LaF.primaryColor,
              textAlign: TextAlign.center,
              controller: controller,
              decoration: InputDecoration(
                  focusColor: LaF.primaryColor,
                  border: const OutlineInputBorder(
                      borderRadius: BorderRadius.all(
                          LaF.roundedRectBorderRadius)),
                  hintText: hintText,
                  alignLabelWithHint: true,
                  hintStyle: hintStyle ??
                      const TextStyle(
                          color: Color.fromARGB(178, 133, 133, 133))),
            );
          }),
        )
      ]);
}