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
480a0827
Unverified
Commit
480a0827
authored
Sep 18, 2020
by
Haeseok Lee
Committed by
GitHub
Sep 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dart-pad example code for CupertinoSliverRefreshControl (#65164)
parent
409e994c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
refresh.dart
packages/flutter/lib/src/cupertino/refresh.dart
+54
-0
No files found.
packages/flutter/lib/src/cupertino/refresh.dart
View file @
480a0827
...
...
@@ -268,6 +268,60 @@ typedef RefreshCallback = Future<void> Function();
/// sliver such as [CupertinoSliverNavigationBar] and your main scrollable
/// content's sliver.
///
/// {@tool dartpad --template=stateful_widget_material}
///
/// When the user scrolls past [refreshTriggerPullDistance],
/// this sample shows the default ios pull to refresh indicator for 1 second and
/// adds a new item to the top of the list view.
///
/// ```dart imports
/// import 'package:flutter/cupertino.dart';
/// ```
///
/// ```dart
/// List<Color> colors = [
/// CupertinoColors.systemYellow,
/// CupertinoColors.systemOrange,
/// CupertinoColors.systemPink
/// ];
/// List<Widget> items = [
/// Container(color: CupertinoColors.systemPink, height: 100.0),
/// Container(color: CupertinoColors.systemOrange, height: 100.0),
/// Container(color: CupertinoColors.systemYellow, height: 100.0),
/// ];
///
/// @override
/// Widget build(BuildContext context) {
/// return CupertinoApp(
/// home: CupertinoPageScaffold(
/// child: CustomScrollView(
/// physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
/// slivers: <Widget>[
/// const CupertinoSliverNavigationBar(largeTitle: Text('Scroll down')),
/// CupertinoSliverRefreshControl(
/// refreshTriggerPullDistance: 100.0,
/// refreshIndicatorExtent: 60.0,
/// onRefresh: () async {
/// await Future.delayed(Duration(milliseconds: 1000));
/// setState(() {
/// items.insert(0, Container(color: colors[items.length % 3], height: 100.0));
/// });
/// },
/// ),
/// SliverList(
/// delegate: SliverChildBuilderDelegate(
/// (BuildContext context, int index) => items[index],
/// childCount: items.length,
/// ),
/// ),
/// ],
/// )
/// )
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [CustomScrollView], a typical sliver holding scroll view this control
...
...
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