Complete Code For Trasparent Appbar With Full Screen Image Background In Flutter
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Page()
)
);
}
}
class Page extends StatefulWidget {
PageState createState() => PageState();
}
class PageState extends State<Page>{
final controller = PageController(
initialPage: 0,
);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/2.jpg'),
fit: BoxFit.cover,
),
),
child: Center(
child: Text(
'BajarangiSoft.com',
style: TextStyle(
color: Colors.white,
fontSize: 30,
),
),
),
),
Positioned(
child: AppBar(
leading: Icon(Icons.chevron_left),
title: Text("Transparent AppBar"),
backgroundColor: Colors.transparent,
elevation: 0,
actions: <Widget>[
IconButton(
icon: Icon(Icons.notifications_none),
onPressed: () {},
tooltip: 'notification',
),
],
),
)
],
),
);
}
}