Skip to content

Instantly share code, notes, and snippets.

@arn3la
Last active January 28, 2021 22:00
Show Gist options
  • Save arn3la/4f30af99c6ee09cd27319b86c38fe7bc to your computer and use it in GitHub Desktop.
Save arn3la/4f30af99c6ee09cd27319b86c38fe7bc to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
const HomePage({Key key, this.onPressed}) : super(key: key);
final VoidCallback onPressed;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
children: [
Padding(
padding: EdgeInsets.symmetric(vertical: 50),
child: Text(
'Hello World!',
style: TextStyle(fontSize: 24),
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 32),
child: ElevatedButton(
onPressed: () => onPressed?.call(),
style: ElevatedButton.styleFrom(primary: Colors.blue),
child: Row(
children: [
Padding(
padding: EdgeInsets.fromLTRB(0, 8, 16, 8),
child: Icon(
Icons.wb_sunny,
key: Key('icon_weather'),
),
),
Text('Weather today'),
],
),
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment