Update convert page btns.
This commit is contained in:
@@ -30,8 +30,8 @@ class _ConvertPageState extends State<ConvertPage>
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_textEditingController = TextEditingController();
|
_textEditingController = TextEditingController(text: '');
|
||||||
_textEditingControllerResult = TextEditingController();
|
_textEditingControllerResult = TextEditingController(text: '');
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -104,30 +104,51 @@ class _ConvertPageState extends State<ConvertPage>
|
|||||||
Widget _buildTypeOption() {
|
Widget _buildTypeOption() {
|
||||||
return Card(
|
return Card(
|
||||||
child: ExpansionTile(
|
child: ExpansionTile(
|
||||||
leading: TextButton(
|
tilePadding: const EdgeInsets.only(left: 7, right: 27),
|
||||||
|
childrenPadding: EdgeInsets.zero,
|
||||||
|
title: Row(
|
||||||
|
children: [
|
||||||
|
TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
foregroundColor: MaterialStateProperty.all(primaryColor)),
|
foregroundColor: MaterialStateProperty.all(primaryColor)),
|
||||||
child: SizedBox(
|
child: const Icon(Icons.change_circle),
|
||||||
width: _media.size.width * 0.3,
|
|
||||||
child: Row(
|
|
||||||
children: const [Icon(Icons.change_circle), Text(' Upside down')],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final temp = _textEditingController.text;
|
final temp = _textEditingController.text;
|
||||||
_textEditingController.text = _textEditingControllerResult.text;
|
_textEditingController.text = _textEditingControllerResult.text;
|
||||||
_textEditingControllerResult.text = temp;
|
_textEditingControllerResult.text = temp;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
title: const SizedBox(),
|
TextButton(
|
||||||
trailing: SizedBox(
|
style: ButtonStyle(
|
||||||
width: _media.size.width * 0.4,
|
foregroundColor: MaterialStateProperty.all(primaryColor)),
|
||||||
child: Text(
|
child: const Icon(Icons.copy),
|
||||||
_typeOption[_typeOptionIndex],
|
onPressed: () => FlutterClipboard.copy(
|
||||||
|
_textEditingControllerResult.text == ''
|
||||||
|
? ' '
|
||||||
|
: _textEditingControllerResult.text),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
trailing: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(maxWidth: _media.size.width * 0.35),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(_typeOption[_typeOptionIndex],
|
||||||
|
textScaleFactor: 1.0,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: primaryColor),
|
color: primaryColor)),
|
||||||
|
const Text(
|
||||||
|
'Current Mode',
|
||||||
|
textScaleFactor: 1.0,
|
||||||
|
textAlign: TextAlign.right,
|
||||||
|
style: TextStyle(fontSize: 9.0, color: Colors.grey),
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
children: _typeOption
|
children: _typeOption
|
||||||
@@ -148,18 +169,7 @@ class _ConvertPageState extends State<ConvertPage>
|
|||||||
Widget _buildResult() {
|
Widget _buildResult() {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: _media.size.height * 0.33,
|
height: _media.size.height * 0.33,
|
||||||
child: Stack(
|
child: _buildInput(_textEditingControllerResult),
|
||||||
children: [
|
|
||||||
_buildInput(_textEditingControllerResult),
|
|
||||||
Positioned(
|
|
||||||
right: 7,
|
|
||||||
top: 7,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () =>
|
|
||||||
FlutterClipboard.copy(_textEditingControllerResult.text),
|
|
||||||
icon: const Icon(Icons.copy)))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user