Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
4c2c1798
Commit
4c2c1798
authored
Oct 24, 2019
by
Daniel
Committed by
LongCatIsLooong
Oct 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CupertinoDialogAction is missing super call (#42924)
parent
42d31972
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
dialog.dart
packages/flutter/lib/src/cupertino/dialog.dart
+3
-1
dialog_test.dart
packages/flutter/test/cupertino/dialog_test.dart
+30
-0
No files found.
packages/flutter/lib/src/cupertino/dialog.dart
View file @
4c2c1798
...
...
@@ -1039,6 +1039,7 @@ class _ActionButtonParentData extends MultiChildLayoutParentData {
class
CupertinoDialogAction
extends
StatelessWidget
{
/// Creates an action for an iOS-style dialog.
const
CupertinoDialogAction
({
Key
key
,
this
.
onPressed
,
this
.
isDefaultAction
=
false
,
this
.
isDestructiveAction
=
false
,
...
...
@@ -1046,7 +1047,8 @@ class CupertinoDialogAction extends StatelessWidget {
@required
this
.
child
,
})
:
assert
(
child
!=
null
),
assert
(
isDefaultAction
!=
null
),
assert
(
isDestructiveAction
!=
null
);
assert
(
isDestructiveAction
!=
null
),
super
(
key:
key
);
/// The callback that is called when the button is tapped or otherwise
/// activated.
...
...
packages/flutter/test/cupertino/dialog_test.dart
View file @
4c2c1798
...
...
@@ -1023,6 +1023,36 @@ void main() {
transition
=
tester
.
widgetList
(
find
.
byType
(
FadeTransition
)).
elementAt
(
1
);
expect
(
transition
.
opacity
.
value
,
closeTo
(
0.0
,
0.001
));
});
testWidgets
(
'Actions are accessible by key'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
createAppWithButtonThatLaunchesDialog
(
dialogBuilder:
(
BuildContext
context
)
{
return
const
CupertinoAlertDialog
(
title:
Text
(
'The Title'
),
content:
Text
(
'The message'
),
actions:
<
Widget
>[
CupertinoDialogAction
(
key:
Key
(
'option_1'
),
child:
Text
(
'Option 1'
),
),
CupertinoDialogAction
(
key:
Key
(
'option_2'
),
child:
Text
(
'Option 2'
),
),
],
);
},
),
);
await
tester
.
tap
(
find
.
text
(
'Go'
));
await
tester
.
pump
();
expect
(
find
.
byKey
(
const
Key
(
'option_1'
)),
findsOneWidget
);
expect
(
find
.
byKey
(
const
Key
(
'option_2'
)),
findsOneWidget
);
expect
(
find
.
byKey
(
const
Key
(
'option_3'
)),
findsNothing
);
});
}
RenderBox
findActionButtonRenderBoxByTitle
(
WidgetTester
tester
,
String
title
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment