“Schaltfläche für flattern” Code-Antworten

Schaltfläche für flattern

TextButton(
  onPressed: () {
      // Respond to button press
  },
  child: Text("TEXT BUTTON"),
)
PHDinStackoverflow

Flattern Textbutton

TextButton(
          onPressed: () {},
            child: Text('click me!!!'),    
        )
Hey Argon

Flutter Widget TextButton Widget

// Basic
TextButton(
  child: const Text('Submit'),
  onPressed: () {},
),


// Icon & Text()
TextButton.icon(
  icon: const Icon(Icons.shopping_cart),
  label: const Text('Shopping Cart'),
  onPressed: () {},
),


// Specific style to 
TextButton.icon(
  icon: const Icon(Icons.shopping_cart),
  label: const Text('Shopping Cart'),
  style: TextButton.styleFrom(
    primary: Colors.white,
    backgroundColor: Colors.purple,
    side: const BorderSide(color: Colors.orange, width: 2),
    shape: BeveledRectangleBorder(
        borderRadius: BorderRadius.circular(5)),
    shadowColor: Colors.pink,
    elevation: 10,
  ),
  onPressed: () {},
),


// Global:: In ThemeData()
 @override
  Widget build(BuildContext context) {
    return MaterialApp(
  debugShowCheckedModeBanner: false,
  title: _title,
  theme: ThemeData(
    primarySwatch: Colors.purple,
    textButtonTheme: TextButtonThemeData(
      style: TextButton.styleFrom(
        primary: Colors.white,
        backgroundColor: Colors.purple,
        side: const BorderSide(color: Colors.orange, width: 2),
        shape:
            BeveledRectangleBorder(borderRadius: BorderRadius.circular(5)),
        shadowColor: Colors.pink,
        elevation: 10,
      ),
    ),
  ),
  home: Scaffold(
    appBar: AppBar(),
    body: Column()
Sore Sardine

Textbutton flattern

final ButtonStyle flatButtonStyle = TextButton.styleFrom(
  primary: Colors.black87,
  minimumSize: Size(88, 36),
  padding: EdgeInsets.symmetric(horizontal: 16.0),
  shape: const RoundedRectangleBorder(
    borderRadius: BorderRadius.all(Radius.circular(2.0)),
  ),
);

TextButton(
  style: flatButtonStyle,
  onPressed: () { },
  child: Text('Looks like a FlatButton'),
)
Abanoub Rasme

Textbutton flattern

final ButtonStyle raisedButtonStyle = ElevatedButton.styleFrom(
  onPrimary: Colors.black87,
  primary: Colors.grey[300],
  minimumSize: Size(88, 36),
  padding: EdgeInsets.symmetric(horizontal: 16),
  shape: const RoundedRectangleBorder(
    borderRadius: BorderRadius.all(Radius.circular(2)),
  ),
);
ElevatedButton(
  style: raisedButtonStyle,
  onPressed: () { },
  child: Text('Looks like a RaisedButton'),
)
Abanoub Rasme

Ähnliche Antworten wie “Schaltfläche für flattern”

Fragen ähnlich wie “Schaltfläche für flattern”

Weitere verwandte Antworten zu “Schaltfläche für flattern” auf Dart

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen