30
loading...
This website collects cookies to deliver better user experience
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
'App Title',
),
centerTitle: true,
actions: [
IconButton(
icon: Icon(Icons.logout),
onPressed: () {},
),
],
backgroundColor: Colors.yellowAccent[600],
elevation: 50.0,
leading: IconButton(
icon: Icon(Icons.menu),
tooltip: 'Menu Icon',
onPressed: () {},
), //IconButton
brightness: Brightness.dark,
),
body: const Center(
child: Text(
"Enjoy",
style: TextStyle(fontSize: 24),
), //Text
), //Center
); //Scaffold;
}
void main() {
var list = ['London', 'Dublin', 'Paris'];
list.forEach((item) {
print('${list.indexOf(item)}: $item');
});
}
TextButton(
onPressed: () {},
style: ButtonStyle(
foregroundColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) return Colors.pink;
return null; // Defer to the widget's default.
}),
),
child: Text(
'Change My Color',
style: TextStyle(fontSize: 30),
),
),
Get.dialog(MyAlert()).then(
(value) => runSomeCode(),
);
enum Cities { London, Dublin, Paris }
extension ToString on Cities {
String get name => toString().split('.').last;
}
void main() {
print(Cities.London.name);
print(Cities.Dublin.name);
print(Cities.Paris.name);
}
class WelcomeToTheCity {
// Defining call method
String call(String a, String b, String c) => 'Welcome to $a$b$c';
}
void main() {
var welcome_to_city = WelcomeToTheCity();
// Calling the class through its instance
var welcome_msg = welcome_to_city('SanDiego ', 'CA ', 'USA');
print(welcome_msg);
}
Follow me on Twitter for more tips about #coding, #learning, #technology...etc.
Check my Apps on Google Play
30