Comments (3)
child cannot be null.
class MenuItemButton extends StatefulWidget {
@override
State<MenuItemButton> createState() => _MenuItemButtonState();
}
class _MenuItemButtonState extends State<MenuItemButton> {
@override
Widget build(BuildContext context) {
Widget child = TextButton(
onPressed: widget.enabled ? _handleSelect : null,
onHover: widget.enabled ? _handleHover : null,
onFocusChange: widget.enabled ? widget.onFocusChange : null,
focusNode: _focusNode,
style: mergedStyle,
statesController: widget.statesController,
clipBehavior: widget.clipBehavior,
isSemanticButton: null,
child: _MenuItemLabel(
leadingIcon: widget.leadingIcon,
shortcut: widget.shortcut,
trailingIcon: widget.trailingIcon,
hasSubmenu: false,
child: widget.child!, <<<<<<<<<<< look here. can't null
),
);
}
}
from flutter.
but it's required
const MenuItemButton({
super.key,
this.onPressed,
this.onHover,
this.requestFocusOnHover = true,
this.onFocusChange,
this.focusNode,
this.shortcut,
this.style,
this.statesController,
this.clipBehavior = Clip.none,
this.leadingIcon,
this.trailingIcon,
this.closeOnActivate = true,
required this.child,
});
from flutter.
Hi @javaone199
I'm quite inclined to mark this as a proposal instead since the child
property is required by design. I wonder what the use case is although you can pass an empty widget (SizedBox.shrink()
or Container()
) to child
, right?
from flutter.
Related Issues (20)
- linux-30 lost external connection from phone device. HOT 2
- mac-26 lost external connection from phone device. HOT 2
- mac-27 lost external connection from phone device. HOT 1
- linux-52 lost external connection from phone device. HOT 2
- mac-9 lost external connection from phone device. HOT 2
- linux-51 is dead. HOT 2
- [Impeller] AHB swapchains on emulators are not functional. HOT 1
- DropdownMenu doesn't display selected item when clearing the search text and unfocusing HOT 4
- DropdownMenu isn't visible if it is aligned with top of keyboard HOT 2
- Create developer documention/codelab on lifecycle aware plugin creation HOT 1
- mac-2 & mac-29 lost external connection from phone device. HOT 2
- [native assets] Inconsistent logging on error. HOT 5
- [camera_android_camerax] Modify `availableCameras` to set camera name to `Camera2CameraInfo.getCameraId`
- Skip `Package.swift` when validating in flutter/packages HOT 1
- apply theme.appBarTheme.systemOverlayStyle in showSearch
- win-1 is dead. HOT 2
- [ERROR:flutter/impeller/runtime_stage/runtime_stage.cc(28)] Reached unreachable code. HOT 5
- [tool_crash] StateError: Bad state: Future already completed HOT 2
- [Android] After Samsung One UI 6.1 update, Webview is displayed as a white screen when resumed HOT 1
- mac-20 is dead. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.