28 lines
707 B
Dart
28 lines
707 B
Dart
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
typedef OnAdd(String value);
|
||
|
|
|
||
|
|
class InputTextBorder extends StatelessWidget {
|
||
|
|
final OnAdd onAdd;
|
||
|
|
|
||
|
|
const InputTextBorder({Key key, this.onAdd}) : super(key: key);
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return TextFormField(
|
||
|
|
textAlign: TextAlign.center,
|
||
|
|
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),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|