Search
 
SCRIPT & CODE EXAMPLE
 

DART

textbutton flutter

TextButton(
  child: Text('Click me'),
  onPressed: () {
    print('Pressed');
  },
),
Comment

flutter text button

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

flutter textbutton

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

flutter textbutton

TextButton(
              onPressed: (){}, 
              child: const Text('TextButton')
            ),
Comment

TextButton Flutter

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'),
)
Comment

text button flutter

TextButton.icon({
  Key key, 
  @required VoidCallback onPressed, 
  VoidCallback onLongPress, 
  ButtonStyle style, 
  FocusNode focusNode, 
  bool autofocus, 
  Clip clipBehavior, 
  @required Widget icon, 
  @required Widget label
})
// Example:
TextButton.icon(
            icon: Icon(Icons.camera),
            label: Text('Take A Photo'),
            onPressed: () {},
          )
Comment

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()
Comment

TextButton Flutter

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'),
)
Comment

PREVIOUS NEXT
Code Example
Dart :: getting internet connectivity in flutter with getx 
Dart :: initialroute flutter 
Dart :: dart flutter countdown timer 
Dart :: What is Dart? 
Dart :: flutter auto size text 
Dart :: flutter get image file from assets 
Dart :: flutter pass onchanged callback in arguments 
Dart :: flutter define type 
Dart :: dart list from 0 to n 
Dart :: flutter inheritance 
Dart :: flutter iterate over list widget 
Dart :: get in dart 
Dart :: add fullscreen modal on a page in flutter app 
Dart :: binary tree in dart 
Dart :: flutter custom error widget 
Dart :: show shadow on focus input flutter 
Dart :: add a button that changes the text in flutter 
Dart :: flutter variables 
Dart :: how to color text in flutter 
Dart :: use a class variable in other class in flutter 
Dart :: dart how to tell if an object is an instance of a class 
Dart :: flutter biometrics 
Dart :: Wraps Text Flutter 
Dart :: seach flutter 
Dart :: dart get href attribute 
Dart :: convert seconds to minutes in Dart 
Swift :: How do I check if a string contains another string in Swift 
Swift :: swiftui checkbox 
Swift :: gap between table header uitableview 
Swift :: swift comments 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =