我正在尝试按照这个 github 问题在颤振中实现自定义脚手架:https : //github.com/flutter/flutter/issues/19606
import 'package:flutter/material.dart';
class MyCustomScaffold extends Scaffold {
static GlobalKey<ScaffoldState> _keyScaffold = GlobalKey();
MyCustomScaffold({
AppBar appBar,
Widget body,
Widget floatingActionButton,
FloatingActionButtonLocation floatingActionButtonLocation,
FloatingActionButtonAnimator floatingActionButtonAnimator,
List<Widget> persistentFooterButtons,
Widget drawer,
Widget endDrawer,
Widget bottomNavigationBar,
Widget bottomSheet,
Color backgroundColor,
bool resizeToAvoidBottomPadding = true,
bool primary = true,
}) : super(
key: _keyScaffold,
appBar: endDrawer != null &&
appBar.actions != null &&
appBar.actions.isNotEmpty
? _buildEndDrawerButton(appBar)
: appBar,
body: body,
floatingActionButton: floatingActionButton,
floatingActionButtonLocation: floatingActionButtonLocation,
floatingActionButtonAnimator: floatingActionButtonAnimator,
persistentFooterButtons: persistentFooterButtons,
drawer: drawer, …Run Code Online (Sandbox Code Playgroud)