We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import 'dart:async'; import 'package:flutter/material.dart' hide NestedScrollView; import 'package:frefresh/frefresh.dart'; import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'; import '../commons/index.dart' show Util; class CustomScrollViewPage extends StatefulWidget { @override _CustomScrollViewPageState createState() => _CustomScrollViewPageState(); } class _CustomScrollViewPageState extends State<CustomScrollViewPage> { FRefreshController _fRefreshController; List<String> _tabs = ['111', '222', '333', '444', '555', '666']; String _appID = ''; @override void initState() { super.initState(); _getAppID(); _fRefreshController = FRefreshController(); _fRefreshController.setOnStateChangedCallback((state) { print('state = $state'); }); } _getAppID() async { _appID = await Util.appID(); setState(() {}); } @override Widget build(BuildContext context) { final double statusBarHeight = MediaQuery.of(context).padding.top; double pinnedHeaderHeight = statusBarHeight + kToolbarHeight; List<Widget> _silverBuilder(BuildContext context, bool innerBoxIsScrolled) { return <Widget>[ SliverToBoxAdapter( child: Container( height: 368.0, color: Colors.yellow, child: Center( child: Text( _appID, style: TextStyle(color: Colors.red), ), ), ), ), ]; } return FRefresh( controller: _fRefreshController, header: Image.asset( "assets/icon_refresh4.gif", height: 80.0, fit: BoxFit.fitHeight, ), headerHeight: 80.0, onRefresh: () { Timer(Duration(milliseconds: 3000), () { _fRefreshController.finishRefresh(); }); }, child: Scaffold( body: Stack( children: <Widget>[ DefaultTabController( length: _tabs.length, // This is the number of tabs. child: NestedScrollView( headerSliverBuilder: _silverBuilder, pinnedHeaderSliverHeightBuilder: () { return pinnedHeaderHeight; }, body: Column( children: <Widget>[ TabBar( labelColor: Theme.of(context).accentColor, unselectedLabelColor: Theme.of(context).hintColor, indicatorSize: TabBarIndicatorSize.label, isScrollable: true, tabs: _tabs.map((String name) => Tab(text: name)).toList(), ), Divider( height: 0, ), Expanded( child: TabBarView( children: _tabs.map((String name) { return MediaQuery.removePadding( context: context, removeTop: true, removeBottom: false, child: ListView.separated( key: PageStorageKey<String>(name), itemCount: 100, itemBuilder: (BuildContext context, int index) { return ListTile( title: Text('title: ' + index.toString())); }, separatorBuilder: (BuildContext context, int index) { return Divider( height: 0, ); }, ), ); }).toList(), ), ) ], ), ), ), Positioned( left: 0, top: 0, right: 0, child: Container( padding: EdgeInsets.only(top: statusBarHeight), color: Theme.of(context).accentColor, height: pinnedHeaderHeight, child: Container( height: kToolbarHeight, color: Colors.red, child: Row( children: <Widget>[ Text('data'), Icon(Icons.home), ], ), ), ), ), ], ), ), ); } } [✓] Flutter (Channel stable, v1.17.3, on Mac OS X 10.15.5 19F101, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 11.5) [✓] Android Studio (version 4.0) [✓] VS Code (version 1.45.1) [✓] Connected device (1 available) • No issues found!
The text was updated successfully, but these errors were encountered:
Hello developer,
NestedScrollView needs to use Container, SizeBox... to limit it's size.
In addition, due to the special sliding effect of NestedScrollView, FRefresh and NestedScrollView have scroll conflicts.
Therefore, you need to control the refresh and stop the refresh through FRefreshController.
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: