-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[two_dimensional_scrollables] TableView #4536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
7e42160
Recommit all generated files first
Piinks 0237815
Non generated files - the good stuff
Piinks 194a4e9
Pulled over more tests
Piinks 1e2129c
Review feedback and some tests
Piinks 35bbbbc
Comitting for now
Piinks 3c578c1
Review feedback
Piinks 67591cf
Updated some decoration logic
Piinks ed5add9
Just needs viewport tests
Piinks f29f5f3
Formatting
Piinks d8ea27c
Nit
Piinks ce83ca9
More tests
Piinks 2c0d3b1
Finished tests
Piinks 3b10a98
Golden files
Piinks b50ed42
Fix max extent
Piinks f3bc603
Non generated files - the good stuff
Piinks 7e6ef69
Pulled over more tests
Piinks 4300c3f
Comitting for now
Piinks 978aace
Review feedback
Piinks 1fd1a50
Just needs viewport tests
Piinks 3e3706e
Formatting
Piinks c6f2fe7
Finished tests
Piinks 735aeb0
Fix max extent
Piinks 9ffef3e
Review feedback
Piinks 61aa198
Progress on vroken checks
Piinks b59f182
Nit
Piinks 4b631bc
Gradle fixes
Piinks 2aec281
++
Piinks 25a5d1d
Fix golden test
Piinks 12b12a5
++
Piinks 61428ff
Still trying to satisfy CI
Piinks b947493
IDE import, rude.
Piinks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Review feedback and some tests
- Loading branch information
commit 1e2129c4b0a79df34b9a238c259d4940c2fc8bad
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Miscellaneous | ||
| *.class | ||
| *.log | ||
| *.pyc | ||
| *.swp | ||
| .DS_Store | ||
| .atom/ | ||
| .buildlog/ | ||
| .history | ||
| .svn/ | ||
| migrate_working_dir/ | ||
|
|
||
| # IntelliJ related | ||
| *.iml | ||
| *.ipr | ||
| *.iws | ||
| .idea/ | ||
|
|
||
| # The .vscode folder contains launch configuration and tasks you configure in | ||
| # VS Code which you may wish to be included in version control, so this line | ||
| # is commented out by default. | ||
| #.vscode/ | ||
|
|
||
| # Flutter/Dart/Pub related | ||
| # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
| /pubspec.lock | ||
| **/doc/api/ | ||
| .dart_tool/ | ||
| .packages | ||
| build/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # This file tracks properties of this Flutter project. | ||
| # Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
| # | ||
| # This file should be version controlled and should not be manually edited. | ||
|
|
||
| version: | ||
| revision: "0ed17dd5a24676c897b5268da976717c22e68780" | ||
| channel: "[user-branch]" | ||
|
|
||
| project_type: package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,92 +1,24 @@ | ||
| name: table_view_example | ||
Piinks marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| description: 'A sample application that uses TableView' | ||
| # The following line prevents the package from being accidentally published to | ||
| # pub.dev using `flutter pub publish`. This is preferred for private packages. | ||
| publish_to: 'none' # Remove this line if you wish to publish to pub.dev | ||
| publish_to: 'none' | ||
|
|
||
| # The following defines the version and build number for your application. | ||
| # A version number is three numbers separated by dots, like 1.2.43 | ||
| # followed by an optional build number separated by a +. | ||
| # Both the version and the builder number may be overridden in flutter | ||
| # build by specifying --build-name and --build-number, respectively. | ||
| # In Android, build-name is used as versionName while build-number used as versionCode. | ||
| # Read more about Android versioning at https://developer.android.com/studio/publish/versioning | ||
| # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. | ||
| # Read more about iOS versioning at | ||
| # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html | ||
| # In Windows, build-name is used as the major, minor, and patch parts | ||
| # of the product and file versions while build-number is used as the build suffix. | ||
| version: 1.0.0+1 | ||
|
|
||
| environment: | ||
| sdk: '>=3.1.0-331.0.dev <4.0.0' | ||
|
|
||
| # Dependencies specify other packages that your package needs in order to work. | ||
| # To automatically upgrade your package dependencies to the latest versions | ||
| # consider running `flutter pub upgrade --major-versions`. Alternatively, | ||
| # dependencies can be manually updated by changing the version numbers below to | ||
| # the latest version available on pub.dev. To see which dependencies have newer | ||
| # versions available, run `flutter pub outdated`. | ||
| dependencies: | ||
| flutter: | ||
| sdk: flutter | ||
| two_dimensional_scrollables: | ||
| path: ../ | ||
|
|
||
|
|
||
| # The following adds the Cupertino Icons font to your application. | ||
| # Use with the CupertinoIcons class for iOS style icons. | ||
| cupertino_icons: ^1.0.2 | ||
|
|
||
| dev_dependencies: | ||
| flutter_lints: ^2.0.0 | ||
| flutter_test: | ||
| sdk: flutter | ||
|
|
||
| # The "flutter_lints" package below contains a set of recommended lints to | ||
| # encourage good coding practices. The lint set provided by the package is | ||
| # activated in the `analysis_options.yaml` file located at the root of your | ||
| # package. See that file for information about deactivating specific lint | ||
| # rules and activating additional ones. | ||
| flutter_lints: ^2.0.0 | ||
|
|
||
| # For information on the generic Dart part of this file, see the | ||
| # following page: https://dart.dev/tools/pub/pubspec | ||
|
|
||
| # The following section is specific to Flutter packages. | ||
| flutter: | ||
|
|
||
| # The following line ensures that the Material Icons font is | ||
| # included with your application, so that you can use the icons in | ||
| # the material Icons class. | ||
| uses-material-design: true | ||
|
|
||
| # To add assets to your application, add an assets section, like this: | ||
| # assets: | ||
| # - images/a_dot_burr.jpeg | ||
| # - images/a_dot_ham.jpeg | ||
|
|
||
| # An image asset can refer to one or more resolution-specific "variants", see | ||
| # https://flutter.dev/assets-and-images/#resolution-aware | ||
|
|
||
| # For details regarding adding assets from package dependencies, see | ||
| # https://flutter.dev/assets-and-images/#from-packages | ||
|
|
||
| # To add custom fonts to your application, add a fonts section here, | ||
| # in this "flutter" section. Each entry in this list should have a | ||
| # "family" key with the font family name, and a "fonts" key with a | ||
| # list giving the asset and other descriptors for the font. For | ||
| # example: | ||
| # fonts: | ||
| # - family: Schyler | ||
| # fonts: | ||
| # - asset: fonts/Schyler-Regular.ttf | ||
| # - asset: fonts/Schyler-Italic.ttf | ||
| # style: italic | ||
| # - family: Trajan Pro | ||
| # fonts: | ||
| # - asset: fonts/TrajanPro.ttf | ||
| # - asset: fonts/TrajanPro_Bold.ttf | ||
| # weight: 700 | ||
| # | ||
| # For details regarding fonts from package dependencies, | ||
| # see https://flutter.dev/custom-fonts/#from-packages | ||
57 changes: 57 additions & 0 deletions
57
packages/two_dimensional_scrollables/example/test/table_view_example_test.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| // 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_test/flutter_test.dart'; | ||
| import 'package:table_view_example/main.dart'; | ||
|
|
||
| void main() { | ||
| testWidgets('Example app builds & scrolls', (WidgetTester tester) async { | ||
| await tester.pumpWidget(const TableExampleApp()); | ||
| await tester.pump(); | ||
|
|
||
| expect(find.text('Jump to Top'), findsOneWidget); | ||
| expect(find.text('Jump to Bottom'), findsOneWidget); | ||
| expect(find.text('Add 10 Rows'), findsOneWidget); | ||
|
|
||
| final Finder scrollable = find.byWidgetPredicate((Widget widget) { | ||
| if (widget is Scrollable) { | ||
| return widget.axisDirection == AxisDirection.down; | ||
| } | ||
| return false; | ||
| }); | ||
| final ScrollPosition position = | ||
| (tester.state(scrollable) as ScrollableState).position; | ||
| expect(position.axis, Axis.vertical); | ||
| expect(position.pixels, 0.0); | ||
| position.jumpTo(10); | ||
| await tester.pump(); | ||
| expect(position.pixels, 10.0); | ||
| }); | ||
|
|
||
| testWidgets('Example app buttons work', (WidgetTester tester) async { | ||
| await tester.pumpWidget(const TableExampleApp()); | ||
| await tester.pump(); | ||
|
|
||
| final Finder scrollable = find.byWidgetPredicate((Widget widget) { | ||
| if (widget is Scrollable) { | ||
| return widget.axisDirection == AxisDirection.down; | ||
| } | ||
| return false; | ||
| }); | ||
| final ScrollPosition position = | ||
| (tester.state(scrollable) as ScrollableState).position; | ||
|
|
||
| expect(position.maxScrollExtent, greaterThan(750)); | ||
| await tester.tap(find.text('Add 10 Rows')); | ||
| await tester.pump(); | ||
| expect(position.maxScrollExtent, greaterThan(1380)); | ||
| await tester.tap(find.text('Jump to Bottom')); | ||
| await tester.pump(); | ||
| expect(position.pixels, greaterThan(1380)); | ||
| await tester.tap(find.text('Jump to Top')); | ||
| await tester.pump(); | ||
| expect(position.pixels, 0.0); | ||
| }); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.