Skip to content

Instantly share code, notes, and snippets.

@piedcipher
Last active September 22, 2020 15:07
Show Gist options
  • Save piedcipher/bf93834b694a4b083cf458cb3f643431 to your computer and use it in GitHub Desktop.
Save piedcipher/bf93834b694a4b083cf458cb3f643431 to your computer and use it in GitHub Desktop.
custom appbar
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: Scaffold(
appBar: PreferredSize(
preferredSize: Size.fromHeight(74),
child: Container(
margin: EdgeInsets.all(16),
child: AppBar(
title: TextFormField(
decoration: InputDecoration(
hintText: 'Search Notes',
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
),
),
actions: [
IconButton(
icon: Icon(
Icons.add,
color: Colors.black38,
),
onPressed: () {},
),
IconButton(
icon: Icon(
Icons.add,
color: Colors.black38,
),
onPressed: () {},
),
],
backgroundColor: Colors.white,
leading: IconButton(
onPressed: () {},
icon: Icon(
Icons.add,
color: Colors.black38,
),
),
),
),
),
body: Container(),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment