1
I’m having trouble creating the SiderBar
. The Drawer
nothing appears. Everything is blank.
My man who calls this file is:
import 'package:Cardapio/consts/consts_app.dart';
import 'package:flutter/material.dart';
class AppBarHome extends StatelessWidget {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return Container(
child: Scaffold(
floatingActionButton: Padding(
padding: EdgeInsets.only(right: 10, top: 60),
child: FloatingActionButton(
child: Icon(Icons.menu),
backgroundColor: Colors.red,
onPressed: () {
Scaffold.of(context).openDrawer();
},
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
appBar: PreferredSize(
preferredSize: Size.fromHeight(150),
child: Stack(
children: <Widget>[
Positioned(
top: -(240 / 3.5),
left: screenWidth - (240 / 1.57),
child: Opacity(
child:
Image.asset(ConstsApp.darkFire, height: 200, width: 200),
opacity: 0.2,
),
),
],
),
),
drawer: Drawer(
child: ListView(
children: <Widget>[
DrawerHeader(
child: Text('Drawer Header'),
decoration: BoxDecoration(
color: Colors.blue,
),
),
ListTile(
title: Text('Item 1'),
onTap: () {
Navigator.pop(context);
},
),
ListTile(
title: Text('Item 2'),
onTap: () {
Navigator.pop(context);
},
),
],
),
),
),
);
}
}