xxxxxxxxxx
TextButton(
onPressed: () => Navigator.pop(context),
style: TextButton.styleFrom(
padding: EdgeInsets.zero,
minimumSize: Size(50, 30),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
alignment: Alignment.centerLeft),
child: Icon(
CupertinoIcons.back,
color: Colors.black,
size: 18,
),
),
xxxxxxxxxx
import 'package:flutter/material.dart';
class MyButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Text Button with Padding'),
),
body: Center(
child: Padding(
padding: EdgeInsets.all(16.0), // Adjust the padding value as needed
child: TextButton(
onPressed: () {},
child: Text('My Button'),
),
),
),
),
);
}
}
void main() {
runApp(MyButton());
}