Skip to content

Commit 1f8fd9d

Browse files
committed
custom appbar function
1 parent f5d311e commit 1f8fd9d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import 'package:flutter/material.dart';
2+
3+
PreferredSize customAppBar({@required BuildContext context}) {
4+
return PreferredSize(
5+
preferredSize: Size.fromHeight(100),
6+
child: Container(
7+
height: kToolbarHeight+20,
8+
child: ListTile(
9+
contentPadding: const EdgeInsets.all(0),
10+
trailing: Container(
11+
decoration: BoxDecoration(
12+
color: Colors.white,
13+
borderRadius: BorderRadius.only(
14+
bottomLeft: Radius.circular(10.0),
15+
)),
16+
padding: const EdgeInsets.fromLTRB(8.0, 30.0, 8.0, 8.0),
17+
child: Image.asset(
18+
'assets/icon/icon.png',
19+
width: 20,
20+
),
21+
),
22+
title: Padding(
23+
padding: const EdgeInsets.only(top: 35.0, left: 16.0,),
24+
child: Text("Flutter UIs",
25+
style: TextStyle(
26+
color: Theme.of(context).primaryColor,
27+
fontWeight: FontWeight.bold,
28+
fontSize: 18.0)),
29+
),
30+
),
31+
),
32+
);
33+
}

0 commit comments

Comments
 (0)