Создайте ящик publi c следующим образом:
import 'package:flutter/widgets.dart';
class PublicDrawer extends StatefulWidget {
PublicDrawer({Key key}) : super(key: key);
@override
_PublicDrawerState createState() => _PublicDrawerState();
}
class _PublicDrawerState extends State<PublicDrawer> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Container();
}
}
и на всех остальных страницах используйте scaffold для реализации вашего ящика:
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:~~~~~~~/Widgets/drawer.dart';
class ProfilePage extends StatefulWidget {
ProfilePage({Key key}) : super(key: key);
@override
_ProfilePageState createState() => _ProfilePageState();
}
class _ProfilePageState extends State<ProfilePage> {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
drawer: PublicDrawer(), <----
body: Container(),
),
);
}
}