@@ -9,7 +9,7 @@ import 'package:mdc_web/mdc_web.dart' show MDCDialog;
99import 'deferred/markdown.dart' deferred as md;
1010
1111/// Displays a message via the modal window.
12- Future modalMessage (String title, Element content) async {
12+ Future < void > modalMessage (String title, Element content) async {
1313 await modalWindow (
1414 titleText: title,
1515 content: content,
@@ -85,9 +85,9 @@ Element _buildDialog({
8585
8686 /// The callback will be called with `true` when "OK" was clicked, and `false`
8787 /// when "Cancel" was clicked.
88- required Function (bool ) closing,
88+ required void Function (bool ) closing,
8989}) =>
90- Element . div ()
90+ DivElement ()
9191 ..classes.add ('mdc-dialog' )
9292 ..attributes.addAll ({
9393 'role' : 'alertdialog' ,
@@ -96,25 +96,25 @@ Element _buildDialog({
9696 'aria-describedby' : 'pub-dialog-content' ,
9797 })
9898 ..children = [
99- Element . div ()
99+ DivElement ()
100100 ..classes.add ('mdc-dialog__container' )
101101 ..children = [
102- Element . div ()
102+ DivElement ()
103103 ..classes.add ('mdc-dialog__surface' )
104104 ..children = [
105- Element . tag ( 'h2' )
105+ HeadingElement . h2 ( )
106106 ..classes.add ('mdc-dialog__title' )
107107 ..id = 'pub-dialog-title'
108108 ..innerText = titleText,
109- Element . div ()
109+ DivElement ()
110110 ..classes.add ('mdc-dialog__content' )
111111 ..id = 'pub-dialog-content'
112112 ..children = [content],
113113 Element .footer ()
114114 ..classes.add ('mdc-dialog__actions' )
115115 ..children = [
116116 if (isQuestion)
117- Element . tag ( 'button' )
117+ ButtonElement ( )
118118 ..classes.addAll ([
119119 'mdc-button' ,
120120 'mdc-dialog__button' ,
@@ -126,11 +126,11 @@ Element _buildDialog({
126126 closing (false );
127127 })
128128 ..children = [
129- Element . span ()
129+ SpanElement ()
130130 ..classes.add ('mdc-button__label' )
131131 ..innerText = cancelButtonText ?? 'Cancel' ,
132132 ],
133- Element . tag ( 'button' )
133+ ButtonElement ( )
134134 ..classes.addAll ([
135135 'mdc-button' ,
136136 'mdc-dialog__button' ,
@@ -142,18 +142,18 @@ Element _buildDialog({
142142 closing (true );
143143 })
144144 ..children = [
145- Element . span ()
145+ SpanElement ()
146146 ..classes.add ('mdc-button__label' )
147147 ..innerText = okButtonText ?? 'Ok' ,
148148 ],
149149 ],
150150 ],
151151 ],
152- Element . div ()..classes.add ('mdc-dialog__scrim' ),
152+ DivElement ()..classes.add ('mdc-dialog__scrim' ),
153153 ];
154154
155155/// Creates an [Element] with unformatted [text] content.
156- Element text (String text) => Element . div ()..text = text;
156+ Element text (String text) => DivElement ()..text = text;
157157
158158/// Creates an [Element] with Markdown-formatted content.
159159Future <Element > markdown (String text) async {
@@ -203,12 +203,12 @@ bool _isInsideContent(Element e, Element content) {
203203/// Disables all focusable elements, except for the elements inside
204204/// [allowedComponents] . Returns a [Function] that will restore the
205205/// original focusability state of the disabled elements.
206- Function disableAllFocusability ({
206+ void Function () disableAllFocusability ({
207207 required List <Element > allowedComponents,
208208}) {
209209 final focusableElements =
210210 document.body! .querySelectorAll (_focusableSelectors.join (', ' ));
211- final restoreFocusabilityFns = < Function > [];
211+ final restoreFocusabilityFns = < void Function () > [];
212212 for (final e in focusableElements) {
213213 if (allowedComponents.any ((content) => _isInsideContent (e, content))) {
214214 continue ;
@@ -224,7 +224,7 @@ Function disableAllFocusability({
224224
225225/// Update [e] to disable focusability and return a [Function] that can be
226226/// called to revert its original state.
227- Function _disableFocusability (Element e) {
227+ void Function () _disableFocusability (Element e) {
228228 final isLink = e.tagName.toLowerCase () == 'a' ;
229229 final hasTabindex = e.hasAttribute ('tabindex' );
230230 final attributesToSet = < String , String > {
0 commit comments