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
93ca2b5a
Unverified
Commit
93ca2b5a
authored
Jun 28, 2021
by
Hans Muller
Committed by
GitHub
Jun 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed ButtonBar from flutter_gallery (#85351)
parent
dec122a4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
55 deletions
+107
-55
buttons_demo.dart
...tests/flutter_gallery/lib/demo/material/buttons_demo.dart
+17
-12
cards_demo.dart
...n_tests/flutter_gallery/lib/demo/material/cards_demo.dart
+18
-14
login.dart
...egration_tests/flutter_gallery/lib/demo/shrine/login.dart
+28
-29
buttons_demo_test.dart
...flutter_gallery/test/demo/material/buttons_demo_test.dart
+44
-0
No files found.
dev/integration_tests/flutter_gallery/lib/demo/material/buttons_demo.dart
View file @
93ca2b5a
...
...
@@ -127,8 +127,9 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
ButtonBar
(
mainAxisSize:
MainAxisSize
.
min
,
const
SizedBox
(
height:
2
),
OverflowBar
(
spacing:
8
,
children:
<
Widget
>[
ElevatedButton
(
style:
style
,
...
...
@@ -143,8 +144,9 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
),
],
),
ButtonBar
(
mainAxisSize:
MainAxisSize
.
min
,
const
SizedBox
(
height:
16
),
OverflowBar
(
spacing:
8
,
children:
<
Widget
>[
ElevatedButton
.
icon
(
style:
style
,
...
...
@@ -174,8 +176,9 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
ButtonBar
(
mainAxisSize:
MainAxisSize
.
min
,
const
SizedBox
(
height:
2
),
OverflowBar
(
spacing:
8
,
children:
<
Widget
>[
TextButton
(
style:
style
,
...
...
@@ -190,8 +193,8 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
),
],
),
Button
Bar
(
mainAxisSize:
MainAxisSize
.
min
,
Overflow
Bar
(
spacing:
8
,
children:
<
Widget
>[
TextButton
.
icon
(
style:
style
,
...
...
@@ -221,8 +224,9 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
ButtonBar
(
mainAxisSize:
MainAxisSize
.
min
,
const
SizedBox
(
height:
2
),
OverflowBar
(
spacing:
8
,
children:
<
Widget
>[
OutlinedButton
(
style:
style
,
...
...
@@ -238,8 +242,9 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
),
],
),
ButtonBar
(
mainAxisSize:
MainAxisSize
.
min
,
const
SizedBox
(
height:
16
),
OverflowBar
(
spacing:
8
,
children:
<
Widget
>[
OutlinedButton
.
icon
(
style:
style
,
...
...
dev/integration_tests/flutter_gallery/lib/demo/material/cards_demo.dart
View file @
93ca2b5a
...
...
@@ -314,8 +314,11 @@ class TravelDestinationContent extends StatelessWidget {
),
if
(
destination
.
type
==
CardDemoType
.
standard
)
// share, explore buttons
ButtonBar
(
Padding
(
padding:
const
EdgeInsetsDirectional
.
only
(
start:
8
,
top:
8
),
child:
OverflowBar
(
alignment:
MainAxisAlignment
.
start
,
spacing:
8
,
children:
<
Widget
>[
TextButton
(
style:
textButtonStyle
,
...
...
@@ -329,6 +332,7 @@ class TravelDestinationContent extends StatelessWidget {
),
],
),
),
],
);
}
...
...
dev/integration_tests/flutter_gallery/lib/demo/shrine/login.dart
View file @
93ca2b5a
...
...
@@ -82,9 +82,10 @@ class _LoginPageState extends State<LoginPage> {
),
),
),
Wrap
(
children:
<
Widget
>[
ButtonBar
(
const
SizedBox
(
height:
12.0
),
OverflowBar
(
spacing:
8
,
alignment:
MainAxisAlignment
.
end
,
children:
<
Widget
>[
TextButton
(
style:
TextButton
.
styleFrom
(
...
...
@@ -117,8 +118,6 @@ class _LoginPageState extends State<LoginPage> {
),
],
),
],
),
),
);
}
...
...
dev/integration_tests/flutter_gallery/test/demo/material/buttons_demo_test.dart
0 → 100644
View file @
93ca2b5a
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
import
'package:flutter_gallery/demo/material/buttons_demo.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
testWidgets
(
'Button locations are OK'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/pull/85351
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
ButtonsDemo
()));
expect
(
find
.
byType
(
ElevatedButton
).
evaluate
().
length
,
2
);
final
Offset
topLeft1
=
tester
.
getTopLeft
(
find
.
byType
(
ElevatedButton
).
first
);
final
Offset
topLeft2
=
tester
.
getTopLeft
(
find
.
byType
(
ElevatedButton
).
last
);
expect
(
topLeft1
.
dx
,
203
);
expect
(
topLeft2
.
dx
,
453
);
expect
(
topLeft1
.
dy
,
topLeft2
.
dy
);
}
{
await
tester
.
tap
(
find
.
text
(
'TEXT'
));
await
tester
.
pumpAndSettle
();
expect
(
find
.
byType
(
TextButton
).
evaluate
().
length
,
2
);
final
Offset
topLeft1
=
tester
.
getTopLeft
(
find
.
byType
(
TextButton
).
first
);
final
Offset
topLeft2
=
tester
.
getTopLeft
(
find
.
byType
(
TextButton
).
last
);
expect
(
topLeft1
.
dx
,
247
);
expect
(
topLeft2
.
dx
,
425
);
expect
(
topLeft1
.
dy
,
topLeft2
.
dy
);
}
{
await
tester
.
tap
(
find
.
text
(
'OUTLINED'
));
await
tester
.
pumpAndSettle
();
expect
(
find
.
byType
(
OutlinedButton
).
evaluate
().
length
,
2
);
final
Offset
topLeft1
=
tester
.
getTopLeft
(
find
.
byType
(
OutlinedButton
).
first
);
final
Offset
topLeft2
=
tester
.
getTopLeft
(
find
.
byType
(
OutlinedButton
).
last
);
expect
(
topLeft1
.
dx
,
203
);
expect
(
topLeft2
.
dx
,
453
);
expect
(
topLeft1
.
dy
,
topLeft2
.
dy
);
}
});
}
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