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
e334ac11
Unverified
Commit
e334ac11
authored
Oct 26, 2022
by
Zachary Anderson
Committed by
GitHub
Oct 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Update Cupertino text input padding (#113958)" (#114102)
This reverts commit
51acda81
.
parent
7bca82c3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
43 deletions
+43
-43
search_field.dart
packages/flutter/lib/src/cupertino/search_field.dart
+2
-2
text_field.dart
packages/flutter/lib/src/cupertino/text_field.dart
+2
-2
search_field_test.dart
packages/flutter/test/cupertino/search_field_test.dart
+5
-5
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+34
-34
No files found.
packages/flutter/lib/src/cupertino/search_field.dart
View file @
e334ac11
...
@@ -109,10 +109,10 @@ class CupertinoSearchTextField extends StatefulWidget {
...
@@ -109,10 +109,10 @@ class CupertinoSearchTextField extends StatefulWidget {
this
.
backgroundColor
,
this
.
backgroundColor
,
this
.
borderRadius
,
this
.
borderRadius
,
this
.
keyboardType
=
TextInputType
.
text
,
this
.
keyboardType
=
TextInputType
.
text
,
this
.
padding
=
const
EdgeInsetsDirectional
.
fromSTEB
(
5.5
,
8
,
5.
5
,
8
),
this
.
padding
=
const
EdgeInsetsDirectional
.
fromSTEB
(
3.8
,
8
,
5
,
8
),
this
.
itemColor
=
CupertinoColors
.
secondaryLabel
,
this
.
itemColor
=
CupertinoColors
.
secondaryLabel
,
this
.
itemSize
=
20.0
,
this
.
itemSize
=
20.0
,
this
.
prefixInsets
=
const
EdgeInsetsDirectional
.
fromSTEB
(
6
,
0
,
0
,
3
),
this
.
prefixInsets
=
const
EdgeInsetsDirectional
.
fromSTEB
(
6
,
0
,
0
,
4
),
this
.
prefixIcon
=
const
Icon
(
CupertinoIcons
.
search
),
this
.
prefixIcon
=
const
Icon
(
CupertinoIcons
.
search
),
this
.
suffixInsets
=
const
EdgeInsetsDirectional
.
fromSTEB
(
0
,
0
,
5
,
2
),
this
.
suffixInsets
=
const
EdgeInsetsDirectional
.
fromSTEB
(
0
,
0
,
5
,
2
),
this
.
suffixIcon
=
const
Icon
(
CupertinoIcons
.
xmark_circle_fill
),
this
.
suffixIcon
=
const
Icon
(
CupertinoIcons
.
xmark_circle_fill
),
...
...
packages/flutter/lib/src/cupertino/text_field.dart
View file @
e334ac11
...
@@ -214,7 +214,7 @@ class CupertinoTextField extends StatefulWidget {
...
@@ -214,7 +214,7 @@ class CupertinoTextField extends StatefulWidget {
this
.
controller
,
this
.
controller
,
this
.
focusNode
,
this
.
focusNode
,
this
.
decoration
=
_kDefaultRoundedBorderDecoration
,
this
.
decoration
=
_kDefaultRoundedBorderDecoration
,
this
.
padding
=
const
EdgeInsets
.
all
(
7
.0
),
this
.
padding
=
const
EdgeInsets
.
all
(
6
.0
),
this
.
placeholder
,
this
.
placeholder
,
this
.
placeholderStyle
=
const
TextStyle
(
this
.
placeholderStyle
=
const
TextStyle
(
fontWeight:
FontWeight
.
w400
,
fontWeight:
FontWeight
.
w400
,
...
@@ -380,7 +380,7 @@ class CupertinoTextField extends StatefulWidget {
...
@@ -380,7 +380,7 @@ class CupertinoTextField extends StatefulWidget {
this
.
controller
,
this
.
controller
,
this
.
focusNode
,
this
.
focusNode
,
this
.
decoration
,
this
.
decoration
,
this
.
padding
=
const
EdgeInsets
.
all
(
7
.0
),
this
.
padding
=
const
EdgeInsets
.
all
(
6
.0
),
this
.
placeholder
,
this
.
placeholder
,
this
.
placeholderStyle
=
_kDefaultPlaceholderStyle
,
this
.
placeholderStyle
=
_kDefaultPlaceholderStyle
,
this
.
prefix
,
this
.
prefix
,
...
...
packages/flutter/test/cupertino/search_field_test.dart
View file @
e334ac11
...
@@ -107,7 +107,7 @@ void main() {
...
@@ -107,7 +107,7 @@ void main() {
expect
(
expect
(
tester
.
getTopLeft
(
find
.
text
(
'initial'
))
-
tester
.
getTopLeft
(
find
.
text
(
'initial'
))
-
tester
.
getTopLeft
(
find
.
byType
(
CupertinoSearchTextField
)),
tester
.
getTopLeft
(
find
.
byType
(
CupertinoSearchTextField
)),
const
Offset
(
31.5
,
8.0
),
const
Offset
(
29.8
,
8.0
),
);
);
},
},
);
);
...
@@ -231,7 +231,7 @@ void main() {
...
@@ -231,7 +231,7 @@ void main() {
);
);
expect
(
expect
(
tester
.
getTopRight
(
find
.
byIcon
(
CupertinoIcons
.
search
)).
dx
+
5.5
,
tester
.
getTopRight
(
find
.
byIcon
(
CupertinoIcons
.
search
)).
dx
+
3.8
,
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
);
);
...
@@ -239,7 +239,7 @@ void main() {
...
@@ -239,7 +239,7 @@ void main() {
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopLeft
(
find
.
byType
(
CupertinoSearchTextField
)).
dx
+
tester
.
getTopLeft
(
find
.
byType
(
CupertinoSearchTextField
)).
dx
+
tester
.
getSize
(
find
.
byIcon
(
CupertinoIcons
.
search
)).
width
+
tester
.
getSize
(
find
.
byIcon
(
CupertinoIcons
.
search
)).
width
+
11.5
,
9.8
,
);
);
},
},
);
);
...
@@ -258,7 +258,7 @@ void main() {
...
@@ -258,7 +258,7 @@ void main() {
);
);
expect
(
expect
(
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
+
5.
5
,
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
+
5.
0
,
tester
.
getTopLeft
(
find
.
byIcon
(
CupertinoIcons
.
xmark_circle_fill
)).
dx
,
tester
.
getTopLeft
(
find
.
byIcon
(
CupertinoIcons
.
xmark_circle_fill
)).
dx
,
);
);
...
@@ -268,7 +268,7 @@ void main() {
...
@@ -268,7 +268,7 @@ void main() {
tester
tester
.
getSize
(
find
.
byIcon
(
CupertinoIcons
.
xmark_circle_fill
))
.
getSize
(
find
.
byIcon
(
CupertinoIcons
.
xmark_circle_fill
))
.
width
-
.
width
-
10.
5
,
10.
0
,
);
);
},
},
);
);
...
...
packages/flutter/test/cupertino/text_field_test.dart
View file @
e334ac11
...
@@ -380,7 +380,7 @@ void main() {
...
@@ -380,7 +380,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
const
Size
(
200
,
31
),
// 31
is the height of the default font + padding etc.
const
Size
(
200
,
29
),
// 29
is the height of the default font + padding etc.
);
);
},
},
);
);
...
@@ -401,7 +401,7 @@ void main() {
...
@@ -401,7 +401,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
const
Size
(
200
,
31
),
// 31
is the height of the default font (17) + decoration (12).
const
Size
(
200
,
29
),
// 29
is the height of the default font (17) + decoration (12).
);
);
},
},
);
);
...
@@ -508,7 +508,7 @@ void main() {
...
@@ -508,7 +508,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
const
Size
(
200
,
6
5
),
// 65
is the height of the default font (17) * maxlines (3) + decoration height (12).
const
Size
(
200
,
6
3
),
// 63
is the height of the default font (17) * maxlines (3) + decoration height (12).
);
);
},
},
);
);
...
@@ -529,7 +529,7 @@ void main() {
...
@@ -529,7 +529,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
const
Size
(
200
,
6
5
),
const
Size
(
200
,
6
3
),
);
);
},
},
);
);
...
@@ -556,7 +556,7 @@ void main() {
...
@@ -556,7 +556,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
const
Size
(
200
,
3
8
),
const
Size
(
200
,
3
6
),
);
);
},
},
// TODO(mdebbar): Strut styles support.
// TODO(mdebbar): Strut styles support.
...
@@ -586,7 +586,7 @@ void main() {
...
@@ -586,7 +586,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)),
const
Size
(
200
,
6
8
),
const
Size
(
200
,
6
6
),
);
);
},
},
// TODO(mdebbar): Strut styles support.
// TODO(mdebbar): Strut styles support.
...
@@ -686,7 +686,7 @@ void main() {
...
@@ -686,7 +686,7 @@ void main() {
expect
(
expect
(
tester
.
getTopLeft
(
find
.
text
(
'initial'
))
-
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)),
tester
.
getTopLeft
(
find
.
text
(
'initial'
))
-
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)),
const
Offset
(
7.0
,
7
.0
),
const
Offset
(
6.0
,
6
.0
),
);
);
},
},
);
);
...
@@ -913,7 +913,7 @@ void main() {
...
@@ -913,7 +913,7 @@ void main() {
);
);
expect
(
expect
(
tester
.
getTopRight
(
find
.
byIcon
(
CupertinoIcons
.
add
)).
dx
+
7.0
,
// 7
px standard padding around input.
tester
.
getTopRight
(
find
.
byIcon
(
CupertinoIcons
.
add
)).
dx
+
6.0
,
// 6
px standard padding around input.
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
);
);
...
@@ -921,7 +921,7 @@ void main() {
...
@@ -921,7 +921,7 @@ void main() {
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dx
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dx
+
tester
.
getSize
(
find
.
byIcon
(
CupertinoIcons
.
add
)).
width
+
tester
.
getSize
(
find
.
byIcon
(
CupertinoIcons
.
add
)).
width
+
7
.0
,
+
6
.0
,
);
);
},
},
);
);
...
@@ -944,7 +944,7 @@ void main() {
...
@@ -944,7 +944,7 @@ void main() {
// The position should just be the edge of the whole text field plus padding.
// The position should just be the edge of the whole text field plus padding.
expect
(
expect
(
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dx
+
7
.0
,
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dx
+
6
.0
,
);
);
await
tester
.
enterText
(
find
.
byType
(
CupertinoTextField
),
'text input'
);
await
tester
.
enterText
(
find
.
byType
(
CupertinoTextField
),
'text input'
);
...
@@ -958,7 +958,7 @@ void main() {
...
@@ -958,7 +958,7 @@ void main() {
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dx
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dx
+
tester
.
getSize
(
find
.
byIcon
(
CupertinoIcons
.
add
)).
width
+
tester
.
getSize
(
find
.
byIcon
(
CupertinoIcons
.
add
)).
width
+
7
.0
,
+
6
.0
,
);
);
},
},
);
);
...
@@ -979,15 +979,15 @@ void main() {
...
@@ -979,15 +979,15 @@ void main() {
);
);
expect
(
expect
(
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
+
7
.0
,
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
+
6
.0
,
tester
.
getTopLeft
(
find
.
byIcon
(
CupertinoIcons
.
add
)).
dx
,
//
7
px standard padding around input.
tester
.
getTopLeft
(
find
.
byIcon
(
CupertinoIcons
.
add
)).
dx
,
//
6
px standard padding around input.
);
);
expect
(
expect
(
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopRight
(
find
.
byType
(
CupertinoTextField
)).
dx
tester
.
getTopRight
(
find
.
byType
(
CupertinoTextField
)).
dx
-
tester
.
getSize
(
find
.
byIcon
(
CupertinoIcons
.
add
)).
width
-
tester
.
getSize
(
find
.
byIcon
(
CupertinoIcons
.
add
)).
width
-
7
.0
,
-
6
.0
,
);
);
},
},
);
);
...
@@ -1170,7 +1170,7 @@ void main() {
...
@@ -1170,7 +1170,7 @@ void main() {
expect
(
expect
(
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
800.0
-
30.0
/* size of button */
-
7
.0
/* padding */
,
800.0
-
30.0
/* size of button */
-
6
.0
/* padding */
,
);
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -1188,7 +1188,7 @@ void main() {
...
@@ -1188,7 +1188,7 @@ void main() {
expect
(
find
.
byIcon
(
CupertinoIcons
.
clear_thick_circled
),
findsNothing
);
expect
(
find
.
byIcon
(
CupertinoIcons
.
clear_thick_circled
),
findsNothing
);
expect
(
expect
(
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
800.0
-
7
.0
/* padding */
,
800.0
-
6
.0
/* padding */
,
);
);
await
tester
.
enterText
(
find
.
byType
(
CupertinoTextField
),
'text input'
);
await
tester
.
enterText
(
find
.
byType
(
CupertinoTextField
),
'text input'
);
...
@@ -1198,7 +1198,7 @@ void main() {
...
@@ -1198,7 +1198,7 @@ void main() {
expect
(
find
.
text
(
'text input'
),
findsOneWidget
);
expect
(
find
.
text
(
'text input'
),
findsOneWidget
);
expect
(
expect
(
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
800.0
-
30.0
-
7
.0
,
800.0
-
30.0
-
6
.0
,
);
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -1302,7 +1302,7 @@ void main() {
...
@@ -1302,7 +1302,7 @@ void main() {
expect
(
expect
(
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
800.0
-
30.0
/* size of button */
-
7
.0
/* padding */
,
800.0
-
30.0
/* size of button */
-
6
.0
/* padding */
,
);
);
controller
.
text
=
'non empty text'
;
controller
.
text
=
'non empty text'
;
...
@@ -1314,7 +1314,7 @@ void main() {
...
@@ -1314,7 +1314,7 @@ void main() {
// Still just takes the space of one widget.
// Still just takes the space of one widget.
expect
(
expect
(
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
tester
.
getTopRight
(
find
.
byType
(
EditableText
)).
dx
,
800.0
-
24.0
/* size of button */
-
7
.0
/* padding */
,
800.0
-
24.0
/* size of button */
-
6
.0
/* padding */
,
);
);
},
},
);
);
...
@@ -1334,7 +1334,7 @@ void main() {
...
@@ -1334,7 +1334,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
31
.0
,
29
.0
,
);
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -1353,7 +1353,7 @@ void main() {
...
@@ -1353,7 +1353,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
6
4
.0
,
6
2
.0
,
);
);
},
},
);
);
...
@@ -1371,7 +1371,7 @@ void main() {
...
@@ -1371,7 +1371,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
31
.0
,
29
.0
,
);
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -1389,7 +1389,7 @@ void main() {
...
@@ -1389,7 +1389,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
6
4
.0
,
6
2
.0
,
);
);
},
},
);
);
...
@@ -1440,7 +1440,7 @@ void main() {
...
@@ -1440,7 +1440,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
31
.0
,
// Initially one line high.
29
.0
,
// Initially one line high.
);
);
await
tester
.
enterText
(
find
.
byType
(
CupertinoTextField
),
'
\n
'
);
await
tester
.
enterText
(
find
.
byType
(
CupertinoTextField
),
'
\n
'
);
...
@@ -1448,7 +1448,7 @@ void main() {
...
@@ -1448,7 +1448,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
4
8
.0
,
// Initially one line high.
4
6
.0
,
// Initially one line high.
);
);
},
},
);
);
...
@@ -1468,7 +1468,7 @@ void main() {
...
@@ -1468,7 +1468,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
31
.0
,
// Initially one line high.
29
.0
,
// Initially one line high.
);
);
await
tester
.
enterText
(
find
.
byType
(
CupertinoTextField
),
'
\n
'
);
await
tester
.
enterText
(
find
.
byType
(
CupertinoTextField
),
'
\n
'
);
...
@@ -1476,7 +1476,7 @@ void main() {
...
@@ -1476,7 +1476,7 @@ void main() {
expect
(
expect
(
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
tester
.
getSize
(
find
.
byType
(
CupertinoTextField
)).
height
,
4
8
.0
,
// Initially one line high.
4
6
.0
,
// Initially one line high.
);
);
},
},
);
);
...
@@ -3009,14 +3009,14 @@ void main() {
...
@@ -3009,14 +3009,14 @@ void main() {
expect
(
lastCharEndpoint
.
length
,
1
);
expect
(
lastCharEndpoint
.
length
,
1
);
// The last character is now on screen.
// The last character is now on screen.
expect
(
lastCharEndpoint
[
0
].
point
.
dx
,
moreOrLessEquals
(
78
4
.73
,
epsilon:
0.25
));
expect
(
lastCharEndpoint
[
0
].
point
.
dx
,
moreOrLessEquals
(
78
6
.73
,
epsilon:
0.25
));
final
List
<
TextSelectionPoint
>
firstCharEndpoint
=
renderEditable
.
getEndpointsForSelection
(
final
List
<
TextSelectionPoint
>
firstCharEndpoint
=
renderEditable
.
getEndpointsForSelection
(
const
TextSelection
.
collapsed
(
offset:
0
),
// First character's position.
const
TextSelection
.
collapsed
(
offset:
0
),
// First character's position.
);
);
expect
(
firstCharEndpoint
.
length
,
1
);
expect
(
firstCharEndpoint
.
length
,
1
);
// The first character is now offscreen to the left.
// The first character is now offscreen to the left.
expect
(
firstCharEndpoint
[
0
].
point
.
dx
,
moreOrLessEquals
(-
3
10
.20
,
epsilon:
0.25
));
expect
(
firstCharEndpoint
[
0
].
point
.
dx
,
moreOrLessEquals
(-
3
08
.20
,
epsilon:
0.25
));
},
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
,
TargetPlatform
.
macOS
}));
},
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
,
TargetPlatform
.
macOS
}));
testWidgets
(
testWidgets
(
...
@@ -4096,7 +4096,7 @@ void main() {
...
@@ -4096,7 +4096,7 @@ void main() {
child:
ListView
(
child:
ListView
(
controller:
scrollController
,
controller:
scrollController
,
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
height:
58
3
),
// Push field almost off screen.
Container
(
height:
58
5
),
// Push field almost off screen.
CupertinoTextField
(
controller:
controller
),
CupertinoTextField
(
controller:
controller
),
Container
(
height:
1000
),
Container
(
height:
1000
),
],
],
...
@@ -4111,7 +4111,7 @@ void main() {
...
@@ -4111,7 +4111,7 @@ void main() {
// The ListView has scrolled to keep the TextField and cursor handle
// The ListView has scrolled to keep the TextField and cursor handle
// visible.
// visible.
expect
(
scrollController
.
offset
,
2
5
.0
);
expect
(
scrollController
.
offset
,
2
6
.0
);
});
});
testWidgets
(
'disabled state golden'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'disabled state golden'
,
(
WidgetTester
tester
)
async
{
...
@@ -4614,7 +4614,7 @@ void main() {
...
@@ -4614,7 +4614,7 @@ void main() {
// The EditableText is at the top.
// The EditableText is at the top.
expect
(
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dy
,
moreOrLessEquals
(
size
.
height
,
epsilon:
.
0001
));
expect
(
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dy
,
moreOrLessEquals
(
size
.
height
,
epsilon:
.
0001
));
expect
(
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dy
,
moreOrLessEquals
(
20
7
.0
,
epsilon:
.
0001
));
expect
(
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dy
,
moreOrLessEquals
(
20
6
.0
,
epsilon:
.
0001
));
});
});
testWidgets
(
'align center'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'align center'
,
(
WidgetTester
tester
)
async
{
...
@@ -4708,7 +4708,7 @@ void main() {
...
@@ -4708,7 +4708,7 @@ void main() {
// The EditableText is at the bottom.
// The EditableText is at the bottom.
expect
(
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dy
,
moreOrLessEquals
(
size
.
height
,
epsilon:
.
0001
));
expect
(
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dy
,
moreOrLessEquals
(
size
.
height
,
epsilon:
.
0001
));
expect
(
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dy
,
moreOrLessEquals
(
37
6
.0
,
epsilon:
.
0001
));
expect
(
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dy
,
moreOrLessEquals
(
37
7
.0
,
epsilon:
.
0001
));
});
});
testWidgets
(
'align as a double'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'align as a double'
,
(
WidgetTester
tester
)
async
{
...
@@ -4755,7 +4755,7 @@ void main() {
...
@@ -4755,7 +4755,7 @@ void main() {
// The EditableText is near the bottom.
// The EditableText is near the bottom.
expect
(
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dy
,
moreOrLessEquals
(
size
.
height
,
epsilon:
.
0001
));
expect
(
tester
.
getTopLeft
(
find
.
byType
(
CupertinoTextField
)).
dy
,
moreOrLessEquals
(
size
.
height
,
epsilon:
.
0001
));
expect
(
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dy
,
moreOrLessEquals
(
35
4.87
5
,
epsilon:
.
0001
));
expect
(
tester
.
getTopLeft
(
find
.
byType
(
EditableText
)).
dy
,
moreOrLessEquals
(
35
5.62
5
,
epsilon:
.
0001
));
});
});
});
});
...
...
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