Package selection guidance compiled from public package information, community data, and project usage.
A semantic dialog package for Flutter, developed by YY.inc, designed to provide accessible and customizable dialog components. It emphasizes proper semantics for improved screen reader support and user experience. The package is open-source and welcomes contributions from the community. Built with Flutter's widget system, it enables developers to create consistent, reusable dialogs with minimal boilerplate. Ideal for apps requiring inclusive UI design and structured dialog interactions.
Use cases
Accessibility-focused applications
Reusable dialog components
Screen reader compatible interfaces
Custom modal dialogs
Open-source collaborative development
Key features
Semantic accessibility
Customizable dialog content
Open-source contribution model
Minimal boilerplate
Cross-platform compatibility
Suitable for
Developers prioritizing accessibility
Teams building reusable UI components
Open-source contributors
Flutter projects with complex dialog needs
Considerations
Requires understanding of Flutter semantics
Limited platform-specific customization
No built-in animations
Community-driven updates
Depends on external maintenance
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Global dialog function encapsulation, with a semantic way to fill the content inside the dialog, the current function provided
Support for a few semantic component methods to populate the component content inside dialog
Support for customizing semantic components for developers to freely populate component content inside dialog
Support setting dialog background color, foreground color, position, animation, click the external disappear and other functions, see the details below
The dialog appears with the default animation available
false
margin
The margin of a dialog
EdgeInsets.all(0.0)
barrierColor
Dialog barrierColor
30% of black
decoration
Dialog decoration
null
backgroundColor
Dialog backgroundColor
white
borderRadius
Dialog borderRadius
0.0
constraints
Dialog constraints
no constraints
animatedFunc
Animation of dialog
Emerge from the middle
showCallBack
dialog show callbacks
not
dismissCallBack
dialog dismiss callbacks
not
barrierDismissible
Whether to click to pop up the external disappear
true
useRootNavigator
Whether to use root navigation
true
After setting gravity, set gravityAnimationEnable = true if animation is needed
If the decoration property is set, the backgroundColor and borderRadius are not in effect; they are mutually exclusive
Supported method
method
description
show[x,y]
show dialog
dismiss
dismiss dialog
isShowing
Is the dialog showing
⚡ Semantic Widget
The contents of the components inside the dialog are encapsulated by semantic functions in advance to quickly build the dialog, as shown in the following table
Since the existing semantic components only assist in the rapid UI construction, they are far from meeting the requirements in actual project development
So it provides the ability to insert custom semantic components into dialog
Insert the component into the dialog through 'widget()'
Application scenario: after the network request comes back, there is no Context to refer to in the callback, at this time, the Context needs to be initialized in advance, and then the dialog can be called without the Context
1、init
Call static methods before show dialog YYDialog.init(context);
classAppHomeextendsStatelessWidget{
Widgetbuild(BuildContext context) {
//1、init contextYYDialog.init(context);
//2、Subsequent use may not be required context
......
}
}
2、use
direct use YYDialog,Note that it must be called build()