merhaba iyi günler projmde yan bar için bir komponent oluşturdum , bu komponentimde sadece bir ikon bulunuyor ve tıklayınca driwer açılıyor ancak hata aldım , sorunu bilen var mıdır
`class Yan_bar extends StatelessWidget {
final GlobalKey<ScaffoldState> scaffoldKeyy ;
Yan_bar({required this.scaffoldKeyy});
@override
Widget build(BuildContext context) {
final width = MediaQuery.of(context).size.width;
final height = MediaQuery.of(context).size.height;
return Scaffold(
drawer: DriwirComponents(),
body:Container(
width: width * 0.2,
height: height * 1,
color: Constant.dark,
child: Padding(
padding: EdgeInsets.only(top: height * 0.06),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
IconButton(
icon: SvgPicture.asset(Assets.icons.menuuSVG,width: 33),
onPressed: () {
scaffoldKeyy.currentState?.openDrawer();
},
tooltip: MaterialLocalizations.of(context)
.openAppDrawerTooltip,
),
],
),
),
),
);
}
}`
yan bar bu şekilde .
Sayfada çağırma kısmı :
Yan_bar(scaffoldKeyy: scaffoldKey,)
Aldığım hata :
throw FlutterError.fromParts(<DiagnosticsNode>[
...information,
DiagnosticsProperty<BoxConstraints>('The constraints that applied to the $runtimeType were', constraints, style: DiagnosticsTreeStyle.errorProperty),
DiagnosticsProperty<Size>('The exact size it was given was', _size, style: DiagnosticsTreeStyle.errorProperty),
ErrorHint('See https://flutter.dev/docs/development/ui/layout/box-constraints for more information.'),
]);