这是indexloc提供的服务,不要输入任何密码
Skip to content

Add sample code for SliverAppBar #125785

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 5 commits into from
May 5, 2023
Merged

Conversation

Istiak-Ahmed78
Copy link
Contributor

This PR adds an another example for SliverAppBar, showing the use of stretch and onStretchTrigger

Screenrecorder-2023-05-01-12-54-00-483.mp4

Fixes #125651

Adds sample code for SliverAppBar [stretch, onStretchTrigger]

This PR adds an another simple and easily understandable example code for SliverAppBar.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos documentation f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels May 1, 2023
@google-cla
Copy link

google-cla bot commented May 1, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Istiak-Ahmed78 Istiak-Ahmed78 changed the title Doc update Add sample code for SliverAppBar May 1, 2023
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Istiak-Ahmed78! Welcome, thanks for contributing. :)

Can you sign the CLA so we can review this PR? Also, it looks like there are some analysis failures here.

@Istiak-Ahmed78
Copy link
Contributor Author

Hi @Piinks !
This is my first contribution. The issue I'm facing is I can't sign CLA.
Screenshot 2023-05-02 072747

It's logging in automatically with my another email address (aistiak6@gmail.com) instead my github email address (aistiak2078@gmail.com) from where I submitted this PR, and I can't change the logged in email address to get the License Agreement.

Is there any support or doc that can help me?

@stMerlHin
Copy link
Contributor

Hi @Piinks ! This is my first contribution. The issue I'm facing is I can't sign CLA. Screenshot 2023-05-02 072747

It's logging in automatically with my another email address (aistiak6@gmail.com) instead my github email address (aistiak2078@gmail.com) from where I submitted this PR, and I can't change the logged in email address to get the License Agreement.

Is there any support or doc that can help me?

Hello @Istiak-Ahmed78, I was also facing the same problem. I just tried to access the cla site with another browser that I hadn't linked any Google account to before, so I was prompted to sign in.

@Istiak-Ahmed78 Istiak-Ahmed78 requested a review from Piinks May 2, 2023 09:26
@Istiak-Ahmed78
Copy link
Contributor Author

Hi @Istiak-Ahmed78! Welcome, thanks for contributing. :)

Can you sign the CLA so we can review this PR? Also, it looks like there are some analysis failures here.

Hello @Piinks , can you please check again? I signed CLA.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the CLA is all set, thank you!

Can you fix the analysis failure? It looks like there is some whitespace:

/b/s/w/ir/x/w/Á flutter sdk/packages/flutter/lib/src/material/app_bar.dart:1406: trailing U+0020 space character
/b/s/w/ir/x/w/Á flutter sdk/packages/flutter/lib/src/material/app_bar.dart:1410: trailing U+0020 space character

SliverAppBar(
stretch: _stretch,
onStretchTrigger: () async {
// Triggers when stretching
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When stretching to the extent of stretchTriggerOffset, this would be nice to clarify or add to the sample.

@Istiak-Ahmed78
Copy link
Contributor Author

Istiak-Ahmed78 commented May 2, 2023

@Piinks, thanks for you suggestions.
I have cleared the extra whitespaces and also added stretchTriggerOffset to the sample.
Can you please check again?

@Istiak-Ahmed78 Istiak-Ahmed78 requested a review from Piinks May 2, 2023 18:06
@Istiak-Ahmed78
Copy link
Contributor Author

@Piinks , I would be so happy if you review it again please.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flutter_LGTM
Thanks again for the contribution!

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label May 4, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 4, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented May 4, 2023

auto label is removed for flutter/flutter, pr: 125785, due to This PR has not met approval requirements for merging. You have project association NONE and need 1 more review(s) in order to merge this PR.

  • Merge guidelines: You need at least one approved review if you are already part of flutter-hackers or two member reviews if you are not a flutter-hacker before re-applying the autosubmit label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@auto-submit
Copy link
Contributor

auto-submit bot commented May 4, 2023

auto label is removed for flutter/flutter, pr: 125785, due to Validations Fail.

@Piinks
Copy link
Contributor

Piinks commented May 4, 2023

Oh right, let me find a second reviewer for this. :)

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits 👍

Thanks for making the docs better!

/// ** See code in examples/api/lib/material/app_bar/sliver_app_bar.4.dart **
/// {@end-tool}
///
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one empty line is needed here.


import 'package:flutter/material.dart';

/// Flutter code sample for [SliverAppBar].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Flutter code sample for [SliverAppBar].
/// Flutter code sample for [SliverAppBar] using [stretch] and [onStretchTrigger].

@Istiak-Ahmed78
Copy link
Contributor Author

Istiak-Ahmed78 commented May 5, 2023

LGTM with nits 👍

Thanks for making the docs better!

Hello @justinmc , @Piinks , I think this PR needs autosubmit label to be merged. I don't have access to add that. Can you please add this? thanks!

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label May 5, 2023
@auto-submit auto-submit bot merged commit 042eaf6 into flutter:master May 5, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2023
tarrinneal pushed a commit to flutter/packages that referenced this pull request May 6, 2023
Manual roll Flutter from 0b65723 to 43ac23b (30 revisions)

Manual roll requested by tarrinneal@google.com

flutter/flutter@0b65723...43ac23b

2023-05-05 kevmoo@users.noreply.github.com targets/web.dart - fix typo
(flutter/flutter#126114)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
6b467df16e11 to 758cbadfac1f (2 revisions) (flutter/flutter#126175)
2023-05-05 44755140+werainkhatri@users.noreply.github.com add tests for
dominant bottom sheet in scaffold (flutter/flutter#124472)
2023-05-05 98486346+lindsaypj@users.noreply.github.com Added
CupertinoDatepicker monthYear mode (flutter#93508)
(flutter/flutter#125603)
2023-05-05 36861262+QuncCccccc@users.noreply.github.com Add
`Switch.trackOutlineWidth` property (flutter/flutter#125848)
2023-05-05 47866232+chunhtai@users.noreply.github.com Rename
iosdeeplinksettings to iosuniversallinksettings (flutter/flutter#126173)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
f3efe11f4449 to 6b467df16e11 (3 revisions) (flutter/flutter#126174)
2023-05-05 49291509+albertoazinar@users.noreply.github.com improvement :
removed required kotlin dependency (flutter/flutter#125002)
2023-05-05 b7woreo@gmail.com Fix incorrect assert hint in flutter.groovy
(flutter/flutter#125283)
2023-05-05 102626803+drewroengoogle@users.noreply.github.com Update
.cirrus.yml (flutter/flutter#126166)
2023-05-05 kevmoo@users.noreply.github.com tool: replace top-level
functions with enum properties (flutter/flutter#126167)
2023-05-05 jacksongardner@google.com Use direct dart API from
`dart:ui_web` rather than JS shim. (flutter/flutter#123443)
2023-05-05 68919043+Istiak-Ahmed78@users.noreply.github.com Add sample
code for SliverAppBar (flutter/flutter#125785)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
cef0e9d1a94f to f3efe11f4449 (3 revisions) (flutter/flutter#126163)
2023-05-05 leroux_bruno@yahoo.fr Add a ReorderableListView example with
cards + cleanup existing tests (flutter/flutter#126155)
2023-05-05 engine-flutter-autoroll@skia.org Roll Packages from
6bd59cd to a0f8fd8 (4 revisions) (flutter/flutter#126161)
2023-05-05 102626803+drewroengoogle@users.noreply.github.com Bring back
the failing build_test's (flutter/flutter#126014)
2023-05-05 mdebbar@google.com [web] Use plain platform views in
benchmarks (flutter/flutter#126080)
2023-05-05 tessertaha@gmail.com Fix Material 3 tab indicator weight and
position (flutter/flutter#125883)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
b0f53e7751ad to cef0e9d1a94f (1 revision) (flutter/flutter#126150)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
6f26066144fb to b0f53e7751ad (2 revisions) (flutter/flutter#126148)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
764991e046c6 to 6f26066144fb (1 revision) (flutter/flutter#126141)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
e7cd29153aa9 to 764991e046c6 (1 revision) (flutter/flutter#126137)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
a885ed472eea to e7cd29153aa9 (1 revision) (flutter/flutter#126135)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
c97a0deccbc1 to a885ed472eea (1 revision) (flutter/flutter#126129)
2023-05-05 pateltirth454@gmail.com [NavigationDrawer] adds padding
property in NavigationDrawer Widget (flutter/flutter#123961)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
269ce2deebeb to c97a0deccbc1 (1 revision) (flutter/flutter#126124)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
4d5070672859 to 269ce2deebeb (16 revisions) (flutter/flutter#126115)
2023-05-05 ian@hixie.ch Minor fixes found while working on blankcanvas
(flutter/flutter#125751)
2023-05-05 kevmoo@users.noreply.github.com tool-web: use ProcessUtil.run
to invoke child processes (flutter/flutter#126109)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC
rmistry@google.com,stuartmorgan@google.com,tarrinneal@google.com on the
revert to ensure that a human
is aware of the problem.

To file a bug in Packages:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
...
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
)

Manual roll Flutter from 0b65723 to 43ac23b (30 revisions)

Manual roll requested by tarrinneal@google.com

flutter/flutter@0b65723...43ac23b

2023-05-05 kevmoo@users.noreply.github.com targets/web.dart - fix typo
(flutter/flutter#126114)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
6b467df16e11 to 758cbadfac1f (2 revisions) (flutter/flutter#126175)
2023-05-05 44755140+werainkhatri@users.noreply.github.com add tests for
dominant bottom sheet in scaffold (flutter/flutter#124472)
2023-05-05 98486346+lindsaypj@users.noreply.github.com Added
CupertinoDatepicker monthYear mode (flutter#93508)
(flutter/flutter#125603)
2023-05-05 36861262+QuncCccccc@users.noreply.github.com Add
`Switch.trackOutlineWidth` property (flutter/flutter#125848)
2023-05-05 47866232+chunhtai@users.noreply.github.com Rename
iosdeeplinksettings to iosuniversallinksettings (flutter/flutter#126173)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
f3efe11f4449 to 6b467df16e11 (3 revisions) (flutter/flutter#126174)
2023-05-05 49291509+albertoazinar@users.noreply.github.com improvement :
removed required kotlin dependency (flutter/flutter#125002)
2023-05-05 b7woreo@gmail.com Fix incorrect assert hint in flutter.groovy
(flutter/flutter#125283)
2023-05-05 102626803+drewroengoogle@users.noreply.github.com Update
.cirrus.yml (flutter/flutter#126166)
2023-05-05 kevmoo@users.noreply.github.com tool: replace top-level
functions with enum properties (flutter/flutter#126167)
2023-05-05 jacksongardner@google.com Use direct dart API from
`dart:ui_web` rather than JS shim. (flutter/flutter#123443)
2023-05-05 68919043+Istiak-Ahmed78@users.noreply.github.com Add sample
code for SliverAppBar (flutter/flutter#125785)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
cef0e9d1a94f to f3efe11f4449 (3 revisions) (flutter/flutter#126163)
2023-05-05 leroux_bruno@yahoo.fr Add a ReorderableListView example with
cards + cleanup existing tests (flutter/flutter#126155)
2023-05-05 engine-flutter-autoroll@skia.org Roll Packages from
6bd59cd to a0f8fd8 (4 revisions) (flutter/flutter#126161)
2023-05-05 102626803+drewroengoogle@users.noreply.github.com Bring back
the failing build_test's (flutter/flutter#126014)
2023-05-05 mdebbar@google.com [web] Use plain platform views in
benchmarks (flutter/flutter#126080)
2023-05-05 tessertaha@gmail.com Fix Material 3 tab indicator weight and
position (flutter/flutter#125883)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
b0f53e7751ad to cef0e9d1a94f (1 revision) (flutter/flutter#126150)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
6f26066144fb to b0f53e7751ad (2 revisions) (flutter/flutter#126148)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
764991e046c6 to 6f26066144fb (1 revision) (flutter/flutter#126141)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
e7cd29153aa9 to 764991e046c6 (1 revision) (flutter/flutter#126137)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
a885ed472eea to e7cd29153aa9 (1 revision) (flutter/flutter#126135)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
c97a0deccbc1 to a885ed472eea (1 revision) (flutter/flutter#126129)
2023-05-05 pateltirth454@gmail.com [NavigationDrawer] adds padding
property in NavigationDrawer Widget (flutter/flutter#123961)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
269ce2deebeb to c97a0deccbc1 (1 revision) (flutter/flutter#126124)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
4d5070672859 to 269ce2deebeb (16 revisions) (flutter/flutter#126115)
2023-05-05 ian@hixie.ch Minor fixes found while working on blankcanvas
(flutter/flutter#125751)
2023-05-05 kevmoo@users.noreply.github.com tool-web: use ProcessUtil.run
to invoke child processes (flutter/flutter#126109)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC
rmistry@google.com,stuartmorgan@google.com,tarrinneal@google.com on the
revert to ensure that a human
is aware of the problem.

To file a bug in Packages:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App c: contributor-productivity Team-specific productivity, code health, technical debt. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add sample code for SliverAppBar [stretch, onStretchTrigger]
4 participants