2020-12-07 17:18:26 +06:30
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
typedef OnAdd(String value);
|
|
|
|
|
|
|
|
|
|
class InputTextBorder extends StatelessWidget {
|
|
|
|
|
final OnAdd onAdd;
|
2020-12-08 20:24:15 +06:30
|
|
|
final TextEditingController controller;
|
2020-12-07 17:18:26 +06:30
|
|
|
|
2020-12-08 20:24:15 +06:30
|
|
|
const InputTextBorder({Key key, this.onAdd, this.controller})
|
|
|
|
|
: super(key: key);
|
2020-12-07 17:18:26 +06:30
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return TextFormField(
|
|
|
|
|
textAlign: TextAlign.center,
|
2020-12-08 20:24:15 +06:30
|
|
|
controller: controller,
|
2020-12-07 17:18:26 +06:30
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|