|
//debug release profile |
|
//assets file binary network |
|
//container |
|
// Material , Cupertino |
|
//Stateless .Stateful |
|
|
|
import 'dart:developer'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
//asset file network memory |
|
void main() { |
|
runApp(const MaterialApp(debugShowCheckedModeBanner: false, home: Home())); |
|
} |
|
|
|
class Home extends StatelessWidget { |
|
const Home({Key? key}) : super(key: key); |
|
|
|
@override |
|
Widget build(BuildContext context) { |
|
return Scaffold( |
|
appBar: AppBar( |
|
title: const Text('Buttons'), |
|
), |
|
body: Center( |
|
child: Column( |
|
children: [ |
|
ElevatedButton.icon( |
|
style: ElevatedButton.styleFrom( |
|
backgroundColor: Colors.indigo, |
|
foregroundColor: Colors.yellow, |
|
shadowColor: Colors.green, |
|
), |
|
onPressed: click, |
|
onLongPress: (){ |
|
showSnackBar(context); |
|
}, |
|
icon: const Icon(Icons.alarm,color: Colors.white,), |
|
label: const Text('Alarm'),), |
|
TextButton( |
|
style: TextButton.styleFrom( |
|
foregroundColor: Colors.indigo, |
|
shadowColor: Colors.black |
|
), |
|
onPressed: (){ |
|
showSnackBar(context); |
|
}, child: const Text('Text Button')), |
|
OutlinedButton( |
|
style: OutlinedButton.styleFrom( |
|
foregroundColor: Colors.indigo, |
|
side: BorderSide(color: Colors.red,width: 3) |
|
), |
|
onPressed: (){ |
|
showSnackBar(context); |
|
}, child: const Text('Oulined Button')), |
|
IconButton( |
|
color: Colors.blue, |
|
tooltip: 'Notification', |
|
onPressed: (){ |
|
|
|
}, icon: Icon(Icons.notifications)), |
|
FloatingActionButton( |
|
child: Icon(Icons.notifications), |
|
onPressed: (){ |
|
showSnackBar(context); |
|
}) |
|
], |
|
), |
|
), |
|
); |
|
} |
|
void click(){ |
|
debugPrint('I am clicking the button'); |
|
} |
|
void showSnackBar(BuildContext context){ |
|
ScaffoldMessenger.of(context) |
|
.showSnackBar(const |
|
SnackBar( |
|
content: Text('You are pressing the button'), |
|
backgroundColor: Colors.indigo, |
|
|
|
)); |
|
} |
|
} |