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
In Android app ,
NestedScrollView / SliverAppBar, ,Appbar is not hiding
import 'package:flutter/material.dart'; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; class ScrollablePositionedDemo extends StatefulWidget { const ScrollablePositionedDemo({Key? key}) : super(key: key); @override State<ScrollablePositionedDemo> createState() => _ScrollablePositionedDemoState(); } class _ScrollablePositionedDemoState extends State<ScrollablePositionedDemo> { late bool scrolltbutton; bool scrolllockbutton = false; late double sleft; late double stop; final scrollDirection = Axis.vertical; final ItemScrollController itemScrollController = ItemScrollController(); final ItemPositionsListener itemPositionsListener = ItemPositionsListener.create(); List<String> dataList = [ "2K", "86-DOS", "A/UX", "Acados", "ACP (Airline Control Program)", "AdaOS", "ADMIRAL", "Adrenaline", "aerolitheOS", "Aimos", "AIOS", "AIX", "Allegro", "AllianceOS", ]; @override void initState() { super.initState(); initposition(); } initposition() { sleft = 110; stop = 100; } sentback() { Navigator.of(context).pop(); } Widget scrolllockappbutton() { return IconButton( icon: scrolllockbutton ? const Icon(Icons.lock, color: Colors.red, size: 25) : const Icon(Icons.lock_open_sharp, color: Colors.green, size: 25), onPressed: () { setState(() { scrolllockbutton = !scrolllockbutton; }); } //) ); } @override Widget build(BuildContext context) { return Scaffold( body: Stack(children: [ NestedScrollView( // controller: ancon, floatHeaderSlivers: true, headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { return <Widget>[ SliverAppBar( snap: true, pinned: false, floating: true, title: const Text("Demo"), actions: <Widget>[ scrolllockappbutton(), ], ), ]; }, body: // child: Column( children: [ Expanded( child: ScrollablePositionedList.builder( itemScrollController: itemScrollController, itemPositionsListener: itemPositionsListener, itemCount: dataList.length, itemBuilder: (context, index) { return Column(children: [ ListTile( title: Text( '\n${dataList[index]}', style: const TextStyle(fontSize: 50), ), onTap: () { print('object'); }, ), const Divider( height: 1, color: Colors.grey, ) ]); }), ), ], ), // ), ), Positioned( left: sleft, top: stop, child: scrolllockbutton ? showbutton() : Draggable( feedback: showbutton(), child: showbutton(), onDragEnd: (drag) { final renderbox = context.findRenderObject() as RenderBox; Offset off = renderbox.globalToLocal(drag.offset); setState(() { stop = off.dy - 55; sleft = off.dx + 5; }); }, ), ), ]), ); } showbutton() { return Material( child: ClipRRect( borderRadius: BorderRadius.circular(5.0), child: Container( color: Colors.red.shade100, child: IconButton( color: Colors.blue, icon: const Icon(Icons.add_a_photo), onPressed: () { print('showbutton'); }, ), )), ); } }
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
This can be solved with #445 . Although, you have to wrap the ScrollablePositionedList with DraggableScrollableSheet for it to work.
No branches or pull requests
In Android app ,
NestedScrollView / SliverAppBar, ,Appbar is not hiding
code sample
The text was updated successfully, but these errors were encountered: