Answers for "textButton style in flutter"

4

how to style text button in flutter

TextButton(
                      style: ButtonStyle(
                          elevation: MaterialStateProperty.all(0),
                          backgroundColor: MaterialStateProperty.all(
                              Theme.of(context).accentColor),
                          padding: MaterialStateProperty.all(
                              const EdgeInsets.symmetric(
                                  horizontal: 20, vertical: 20)),
                          textStyle: MaterialStateProperty.all(TextStyle(
                            color: Colors.black,
                          )),
                          shape:
                              MaterialStateProperty.all<RoundedRectangleBorder>(
                                  RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(10.0),
                          ))),
                      onPressed: () {
                  // do logic here
                      },
                      child: Text("My Button",
                          style: Theme.of(context).textTheme.bodyText2.copyWith(
                              color: Colors.white,
                              fontWeight: FontWeight.normal)),
                    ),
Posted by: Guest on June-13-2021
12

rich text flutter

RichText(
    text: TextSpan(
        style: TextStyle(color: Colors.black, fontSize: 36),
        children: <TextSpan>[
          TextSpan(text: 'Woolha ', style: TextStyle(color: Colors.blue)),
          TextSpan(text: 'dot '),
          TextSpan(text: 'com', style: TextStyle(decoration: TextDecoration.underline))
        ],
    ),
    textScaleFactor: 0.5,
  )
Posted by: Guest on August-01-2020
3

text button flutter style

TextButton(
	child: Text('Text'),
    style: TextButton.styleFrom(primary: Colors.blue),
    onPressed: () {
    	print('Pressed');
    },
)
Posted by: Guest on June-08-2021
0

how to style a text button in flutter

TextButton(
    child: Text('Text'),
    style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.red)),
    onPressed: () {
         // action on pressed
    },
),
Posted by: Guest on October-11-2021

Code answers related to "textButton style in flutter"

Browse Popular Code Answers by Language