rajath_pai

ninja9 IconButton

Jul 30th, 2021
857
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() => runApp(MaterialApp(
  4.       home: Home(),
  5.     ));
  6.  
  7. class Home extends StatelessWidget {
  8.   @override
  9.   Widget build(BuildContext context) {
  10.     return Scaffold(
  11.       appBar: AppBar(
  12.         title: Text(
  13.           'App bar',
  14.           style: TextStyle(color: Colors.white),
  15.         ),
  16.         centerTitle: true,
  17.         backgroundColor: Colors.red,
  18.       ),
  19.       body: Center(
  20.         child:  IconButton(
  21.           onPressed : (){
  22.             print('You clicked me');
  23.           },
  24.           icon : Icon(Icons.alternate_email),
  25.           color : Colors.amber,
  26.         ),
  27.       ),
  28.       floatingActionButton: FloatingActionButton(
  29.         child: Text('click me'),
  30.         onPressed: null,
  31.         backgroundColor: Colors.red,
  32.       ),
  33.     );
  34.   }
  35. }
  36.  
RAW Paste Data