Skip to content

Instantly share code, notes, and snippets.

@abdulazizahwan
Last active November 30, 2019 17:17
Show Gist options
  • Save abdulazizahwan/54546d5fdec65d876bf2d08b55d9ea25 to your computer and use it in GitHub Desktop.
Save abdulazizahwan/54546d5fdec65d876bf2d08b55d9ea25 to your computer and use it in GitHub Desktop.
Main.dart file of Flutter Tutorial - 18 Understanding Row and Column Widget
import 'package:flutter/material.dart';
var assetImage =AssetImage('assets/dribbble_16.png');
var image = Image(
image: assetImage, fit: BoxFit.cover,
);
void main(){
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
title: "My First Page",
home: FirstPage(),
));
}
class FirstPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Home'),
backgroundColor: Colors.black,
leading: IconButton(icon: Icon(Icons.menu),
onPressed: (){
print("Leading Clicked");
},),
actions: <Widget>[
IconButton(icon: Icon(Icons.notifications_none),
onPressed: (){
print("Notification Clicked");
},),
IconButton(icon: Icon(Icons.search),
onPressed: (){
print("Search Clicked");
},),
],
elevation: 6,
titleSpacing: 12,
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: (){
print("FAB Clicked");
},
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))),
elevation: 5,
highlightElevation: 10,
),
body: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
CircleAvatar(
backgroundImage: NetworkImage('https://i.ytimg.com/vi/ZnW0YA_UJ-c/maxresdefault.jpg'),
backgroundColor: Colors.blue,
radius: 32,
),
Text("Aziz Ahwan", style: TextStyle(fontSize: 24),)
],)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment