-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTextAreaWidget.dart
40 lines (37 loc) · 1.04 KB
/
TextAreaWidget.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import 'package:flutter/material.dart';
///Code created by following tutorial: https://www.youtube.com/watch?v=TNKtGOZRA5o
///Creates the formatting for the Text Recognizer
class TextAreaWidget extends StatelessWidget {
final String text;
final VoidCallback onClickedCopy;
const TextAreaWidget({
@required this.text,
@required this.onClickedCopy,
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) => Row(
children: [
Expanded(
child: Container(
height: 100,
decoration: BoxDecoration(border: Border.all()),
padding: EdgeInsets.all(8),
alignment: Alignment.center,
child: SelectableText(
text.isEmpty ? 'Scan an Image to get text' : text,
textAlign: TextAlign.center,
),
),
),
const SizedBox(width: 8),
Expanded(child:
IconButton(
icon: Icon(Icons.copy, color: Colors.black),
color: Colors.black12,
onPressed: onClickedCopy,
),
),
],
);
}