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 :: flutter list distinct 
Dart :: flutter sliverappbar 
Dart :: sliver persistent header 
Dart :: convert string date to datetime and format 
Dart :: fluter check that date is greater than another date 
Dart :: how to show snackbar in flutter 
Dart :: What is Dart? 
Dart :: dart compute example 
Dart :: Flutter bottom navigation bar change page programmatically 
Dart :: return map dart 
Dart :: regex dart 
Dart :: convert double to string flutter 
Dart :: upload a file to ec2 instance 
Dart :: flutter appbar hide 
Dart :: lifecycle methods flutter 
Dart :: dart list 
Dart :: AnimatedCrossFade 
Dart :: how to show ad every second flutter 
Dart :: flutter variables 
Dart :: dart string equals 
Dart :: flutter map 
Dart :: restrick platform orientation flutter 
Dart :: flutter signing the app 
Dart :: dart break foreach 
Dart :: dart format print 
Dart :: Convertir la liste en carte dans Dart/Flutter 
Dart :: what is the problem to aqueduct with dart 2.8 
Swift :: swift share with 
Swift :: swift enum all cases 
Swift :: swift 5 func to increase number every time call 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =