Files
fcs/lib/pages/carton/input_text_border.dart

31 lines
806 B
Dart
Raw Normal View History

2020-12-07 17:18:26 +06:30
import 'package:flutter/material.dart';
typedef OnAdd(String value);
class InputTextBorder extends StatelessWidget {
2021-09-10 12:00:08 +06:30
final OnAdd? onAdd;
final TextEditingController? controller;
2020-12-07 17:18:26 +06:30
2021-09-10 12:00:08 +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,
controller: controller,
2020-12-07 17:18:26 +06:30
onChanged: (v) {
2021-09-10 12:00:08 +06:30
if (onAdd != null) onAdd!(v);
2020-12-07 17:18:26 +06:30
},
keyboardType: TextInputType.number,
decoration: new InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
),
),
);
}
}