import 'package:flutter/material.dart';
void main() { runApp( MyApp()); }
class MyApp extends StatelessWidget { MyApp({super.key});
GlobalKey<ScaffoldState> keyim = new GlobalKey<ScaffoldState>(); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.blue, ), home: Scaffold( appBar: AppBar( title: Text("Anasayfa"), ), key: keyim, body: Container( padding: EdgeInsets.only(top: 200), child: InkWell( onTap: (){ keyim.currentState!.openDrawer();
}, child: Text("Anasayfa")), ), drawer: Drawer( child: ListView( children: [ SizedBox( height: 60, child: DrawerHeader( decoration: BoxDecoration( color: Colors.blue ), child: Container( child: Row(children: [ Icon(Icons.add), Text("FLUTTER YAZILIM") ],), ),), ),
ListTile( onTap: (){ print("Ayarlar"); keyim.currentState!.closeDrawer(); }, leading: Icon(Icons.settings), title: Text("Ayarlar"), trailing: Icon(Icons.arrow_right_alt_sharp), ), ListTile( onTap: (){ print("Profilim"); keyim.currentState!.closeDrawer();
}, leading: Icon(Icons.people), title: Text("Profilim"), trailing: Icon(Icons.arrow_right_alt_sharp), ), ], ), ), ), ); } }
|