How do I implement a design as show below?
The image shows a play button with text. I won't be creating it as a container with gradient of some sort. This leaves me with 2 options
- Define 2 growable rectangles before and after the text, which can be used to scale with width of the image.
- Define 1 growable rectangle for image without text and then somehow place the text within the image and also allow the button to have scalable size.
But how do I do any of that without 9patch of native android?
EDIT:
Container(
// width: MediaQuery.of(context).size.width/2,
child: FlatButton(
onPressed: () => print('onPressed'),
padding: EdgeInsets.zero,
child: Ink.image(
image: FileImage(File('btn_default_normal.9.png')),
centerSlice: Rect.fromLTWH(18 - 1.0, 36 - 1.0, 2, 2),
child: Text(
'press me',
style: TextStyle(color: Colors.blue, fontSize: 20),
),
),
),
)
How to set the width? Uncommenting the width gives me

which means the button is taking half the screen width but not expanding.
