pubspec.yaml
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
assets:
- assets/images/facebook_icon.png
- assets/images/facebook_msg.png
- assets/images/facebook_search.png
lib/main.dart
import 'package:flutter/material.dart';
void main() {
runApp(FacebookAppbar());
}
class FacebookAppbar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
title: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
'assets/images/facebook_icon.png',
fit: BoxFit.cover,
height: 35.0,
),
],
),
actions: [
IconButton(
padding: EdgeInsets.all(5.0),
icon: Image.asset('assets/images/facebook_search.png'),
onPressed: () {
// Implement navigation to shopping cart page here...
print('Click Search');
},
),
IconButton(
padding: EdgeInsets.all(5.0),
icon: Image.asset('assets/images/facebook_msg.png'),
onPressed: () {
// Implement navigation to shopping cart page here...
print('Click Message');
},
),
],
),
body: Container(
decoration: BoxDecoration(color: Colors.grey),
)));
}
}
There are 0 comments