Я новичок в флаттере и создании пользовательского RisedButton У меня есть эта кнопка
import 'package:flutter/material.dart';
class EasyButton extends StatelessWidget {
final onPressed;
final text;
EasyButton(this.onPressed, this.text);
@override
Widget build(BuildContext context) {
return RaisedButton(
onPressed: this.onPressed,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(60),
),
padding: EdgeInsets.all(0),
elevation: 2,
splashColor: Colors.blue[300],
child: Ink(
decoration: new BoxDecoration(
borderRadius: BorderRadius.circular(60),
gradient: new LinearGradient(
colors: [Colors.blue, Colors.blue[800]],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
padding: EdgeInsets.symmetric(horizontal: 30, vertical: 10),
child: new Text(this.text, style: TextStyle(color: Colors.white)),
),
);
}
}
Но когда я использую ее с расширенным виджетом, я получаю этот результат
![enter image description here](https://i.stack.imgur.com/Sdo47.png)
Как я могу увеличить ширину родительского элемента на 100%?
С double.infinity
![enter image description here](https://i.stack.imgur.com/XjmzY.png)
С контейнером
![enter image description here](https://i.stack.imgur.com/TbFMI.png)