import 'package:flutter/material.dart';

typedef OnAdd(String value);

class InputTextBorder extends StatelessWidget {
  final OnAdd? onAdd;
  final TextEditingController? controller;

  const InputTextBorder({Key? key, this.onAdd, this.controller})
      : super(key: key);
  @override
  Widget build(BuildContext context) {
    return TextFormField(
      textAlign: TextAlign.center,
      controller: controller,
      onChanged: (v) {
        if (onAdd != null) onAdd!(v);
      },
      keyboardType: TextInputType.number,
      decoration: new InputDecoration(
        focusedBorder: OutlineInputBorder(
          borderSide: BorderSide(color: Colors.grey),
        ),
        enabledBorder: OutlineInputBorder(
          borderSide: BorderSide(color: Colors.grey),
        ),
      ),
    );
  }
}
