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
7ce88694
Unverified
Commit
7ce88694
authored
Mar 10, 2023
by
Kate Lovett
Committed by
GitHub
Mar 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up scrollable.dart for 2D (#122357)
Clean up scrollable.dart for 2D
parent
670f9d20
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
541 additions
and
443 deletions
+541
-443
app.dart
packages/flutter/lib/src/widgets/app.dart
+1
-1
default_text_editing_shortcuts.dart
...utter/lib/src/widgets/default_text_editing_shortcuts.dart
+1
-1
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+1
-0
reorderable_list.dart
packages/flutter/lib/src/widgets/reorderable_list.dart
+1
-0
scroll_configuration.dart
packages/flutter/lib/src/widgets/scroll_configuration.dart
+1
-0
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+40
-441
scrollable_helpers.dart
packages/flutter/lib/src/widgets/scrollable_helpers.dart
+443
-0
scrollbar.dart
packages/flutter/lib/src/widgets/scrollbar.dart
+1
-0
widgets.dart
packages/flutter/lib/widgets.dart
+1
-0
scrollable_test.dart
packages/flutter/test/widgets/scrollable_test.dart
+51
-0
No files found.
packages/flutter/lib/src/widgets/app.dart
View file @
7ce88694
...
@@ -23,7 +23,7 @@ import 'pages.dart';
...
@@ -23,7 +23,7 @@ import 'pages.dart';
import
'performance_overlay.dart'
;
import
'performance_overlay.dart'
;
import
'restoration.dart'
;
import
'restoration.dart'
;
import
'router.dart'
;
import
'router.dart'
;
import
'scrollable.dart'
;
import
'scrollable
_helpers
.dart'
;
import
'semantics_debugger.dart'
;
import
'semantics_debugger.dart'
;
import
'shared_app_data.dart'
;
import
'shared_app_data.dart'
;
import
'shortcuts.dart'
;
import
'shortcuts.dart'
;
...
...
packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
View file @
7ce88694
...
@@ -9,7 +9,7 @@ import 'package:flutter/services.dart';
...
@@ -9,7 +9,7 @@ import 'package:flutter/services.dart';
import
'actions.dart'
;
import
'actions.dart'
;
import
'focus_traversal.dart'
;
import
'focus_traversal.dart'
;
import
'framework.dart'
;
import
'framework.dart'
;
import
'scrollable.dart'
;
import
'scrollable
_helpers
.dart'
;
import
'shortcuts.dart'
;
import
'shortcuts.dart'
;
import
'text_editing_intents.dart'
;
import
'text_editing_intents.dart'
;
...
...
packages/flutter/lib/src/widgets/editable_text.dart
View file @
7ce88694
...
@@ -35,6 +35,7 @@ import 'scroll_controller.dart';
...
@@ -35,6 +35,7 @@ import 'scroll_controller.dart';
import
'scroll_physics.dart'
;
import
'scroll_physics.dart'
;
import
'scroll_position.dart'
;
import
'scroll_position.dart'
;
import
'scrollable.dart'
;
import
'scrollable.dart'
;
import
'scrollable_helpers.dart'
;
import
'shortcuts.dart'
;
import
'shortcuts.dart'
;
import
'spell_check.dart'
;
import
'spell_check.dart'
;
import
'tap_region.dart'
;
import
'tap_region.dart'
;
...
...
packages/flutter/lib/src/widgets/reorderable_list.dart
View file @
7ce88694
...
@@ -16,6 +16,7 @@ import 'scroll_controller.dart';
...
@@ -16,6 +16,7 @@ import 'scroll_controller.dart';
import
'scroll_physics.dart'
;
import
'scroll_physics.dart'
;
import
'scroll_view.dart'
;
import
'scroll_view.dart'
;
import
'scrollable.dart'
;
import
'scrollable.dart'
;
import
'scrollable_helpers.dart'
;
import
'sliver.dart'
;
import
'sliver.dart'
;
import
'sliver_prototype_extent_list.dart'
;
import
'sliver_prototype_extent_list.dart'
;
import
'ticker_provider.dart'
;
import
'ticker_provider.dart'
;
...
...
packages/flutter/lib/src/widgets/scroll_configuration.dart
View file @
7ce88694
...
@@ -11,6 +11,7 @@ import 'framework.dart';
...
@@ -11,6 +11,7 @@ import 'framework.dart';
import
'overscroll_indicator.dart'
;
import
'overscroll_indicator.dart'
;
import
'scroll_physics.dart'
;
import
'scroll_physics.dart'
;
import
'scrollable.dart'
;
import
'scrollable.dart'
;
import
'scrollable_helpers.dart'
;
import
'scrollbar.dart'
;
import
'scrollbar.dart'
;
const
Color
_kDefaultGlowColor
=
Color
(
0xFFFFFFFF
);
const
Color
_kDefaultGlowColor
=
Color
(
0xFFFFFFFF
);
...
...
packages/flutter/lib/src/widgets/scrollable.dart
View file @
7ce88694
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/scrollable_helpers.dart
0 → 100644
View file @
7ce88694
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/scrollbar.dart
View file @
7ce88694
...
@@ -22,6 +22,7 @@ import 'scroll_metrics.dart';
...
@@ -22,6 +22,7 @@ import 'scroll_metrics.dart';
import
'scroll_notification.dart'
;
import
'scroll_notification.dart'
;
import
'scroll_position.dart'
;
import
'scroll_position.dart'
;
import
'scrollable.dart'
;
import
'scrollable.dart'
;
import
'scrollable_helpers.dart'
;
import
'ticker_provider.dart'
;
import
'ticker_provider.dart'
;
const
double
_kMinThumbExtent
=
18.0
;
const
double
_kMinThumbExtent
=
18.0
;
...
...
packages/flutter/lib/widgets.dart
View file @
7ce88694
...
@@ -115,6 +115,7 @@ export 'src/widgets/scroll_position_with_single_context.dart';
...
@@ -115,6 +115,7 @@ export 'src/widgets/scroll_position_with_single_context.dart';
export
'src/widgets/scroll_simulation.dart'
;
export
'src/widgets/scroll_simulation.dart'
;
export
'src/widgets/scroll_view.dart'
;
export
'src/widgets/scroll_view.dart'
;
export
'src/widgets/scrollable.dart'
;
export
'src/widgets/scrollable.dart'
;
export
'src/widgets/scrollable_helpers.dart'
;
export
'src/widgets/scrollbar.dart'
;
export
'src/widgets/scrollbar.dart'
;
export
'src/widgets/selectable_region.dart'
;
export
'src/widgets/selectable_region.dart'
;
export
'src/widgets/selection_container.dart'
;
export
'src/widgets/selection_container.dart'
;
...
...
packages/flutter/test/widgets/scrollable_test.dart
View file @
7ce88694
...
@@ -1690,6 +1690,57 @@ void main() {
...
@@ -1690,6 +1690,57 @@ void main() {
expect
(
tester
.
takeException
(),
isNull
);
expect
(
tester
.
takeException
(),
isNull
);
semantics
.
dispose
();
semantics
.
dispose
();
});
});
testWidgets
(
'deltaToScrollOrigin getter'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
CustomScrollView
(
slivers:
<
Widget
>[
SliverToBoxAdapter
(
child:
SizedBox
(
height:
2000.0
)),
],
),
)
);
final
TestGesture
gesture
=
await
tester
.
startGesture
(
tester
.
getCenter
(
find
.
byType
(
Scrollable
),
warnIfMissed:
true
),
kind:
ui
.
PointerDeviceKind
.
unknown
);
expect
(
getScrollOffset
(
tester
),
0.0
);
await
gesture
.
moveBy
(
const
Offset
(
0.0
,
-
200
));
await
tester
.
pump
();
await
tester
.
pumpAndSettle
();
expect
(
getScrollOffset
(
tester
),
200
);
final
ScrollableState
scrollable
=
tester
.
state
(
find
.
byType
(
Scrollable
));
expect
(
scrollable
.
deltaToScrollOrigin
,
const
Offset
(
0.0
,
200
));
});
testWidgets
(
'resolvedPhysics getter'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
.
light
().
copyWith
(
platform:
TargetPlatform
.
android
,
),
home:
const
CustomScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
slivers:
<
Widget
>[
SliverToBoxAdapter
(
child:
SizedBox
(
height:
2000.0
)),
],
),
)
);
final
TestGesture
gesture
=
await
tester
.
startGesture
(
tester
.
getCenter
(
find
.
byType
(
Scrollable
),
warnIfMissed:
true
),
kind:
ui
.
PointerDeviceKind
.
unknown
);
expect
(
getScrollOffset
(
tester
),
0.0
);
await
gesture
.
moveBy
(
const
Offset
(
0.0
,
-
200
));
await
tester
.
pump
();
await
tester
.
pumpAndSettle
();
expect
(
getScrollOffset
(
tester
),
200
);
final
ScrollableState
scrollable
=
tester
.
state
(
find
.
byType
(
Scrollable
));
String
types
(
ScrollPhysics
?
value
)
=>
value
!.
parent
==
null
?
'
${value.runtimeType}
'
:
'
${value.runtimeType}
${types(value.parent)}
'
;
expect
(
types
(
scrollable
.
resolvedPhysics
),
'AlwaysScrollableScrollPhysics ClampingScrollPhysics RangeMaintainingScrollPhysics'
,
);
});
}
}
// ignore: must_be_immutable
// ignore: must_be_immutable
...
...
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