mirror of
https://github.com/ChronosX88/wind.git
synced 2024-12-05 02:22:17 +00:00
Make little fixes: add scrollbar to thread list and fix scroll position reset in thread list when trying to load more threads
This commit is contained in:
parent
839f91d735
commit
650461a883
@ -40,6 +40,7 @@ class NewsgroupListViewState extends State<NewsgroupListView> {
|
|||||||
|
|
||||||
Widget _newsgroupListView(List<GroupInfo> data) {
|
Widget _newsgroupListView(List<GroupInfo> data) {
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
|
controller: ScrollController(),
|
||||||
itemCount: data.length,
|
itemCount: data.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
|
@ -56,30 +56,33 @@ class ThreadListViewState extends State<ThreadListView> {
|
|||||||
|
|
||||||
Widget _threadView() {
|
Widget _threadView() {
|
||||||
return _items.isNotEmpty
|
return _items.isNotEmpty
|
||||||
? ListView.builder(
|
? Scrollbar(
|
||||||
itemCount: _items.length,
|
child: ListView.builder(
|
||||||
itemBuilder: (context, index) {
|
key: PageStorageKey("threadList"),
|
||||||
if (_items[index].number == -100500) {
|
itemCount: _items.length,
|
||||||
return Container(
|
itemBuilder: (context, index) {
|
||||||
height: 100,
|
if (_items[index].number == -100500) {
|
||||||
padding: EdgeInsets.all(20),
|
return Container(
|
||||||
child: TextButton(
|
height: 100,
|
||||||
style: ButtonStyle(
|
padding: EdgeInsets.all(20),
|
||||||
foregroundColor:
|
child: TextButton(
|
||||||
MaterialStateProperty.all<Color>(Colors.blue),
|
style: ButtonStyle(
|
||||||
),
|
foregroundColor:
|
||||||
onPressed: () {
|
MaterialStateProperty.all<Color>(Colors.blue),
|
||||||
setState(() {
|
),
|
||||||
_pageNum += 1;
|
onPressed: () {
|
||||||
_items.removeLast();
|
setState(() {
|
||||||
});
|
_pageNum += 1;
|
||||||
},
|
_items.removeLast();
|
||||||
child: Text('Load more'),
|
});
|
||||||
),
|
},
|
||||||
);
|
child: Text('Load more'),
|
||||||
} else
|
),
|
||||||
return ThreadListItemView(item: _items[index]);
|
);
|
||||||
})
|
} else
|
||||||
|
return ThreadListItemView(item: _items[index]);
|
||||||
|
}),
|
||||||
|
)
|
||||||
: Center(
|
: Center(
|
||||||
child: Text("This newsgroup is empty",
|
child: Text("This newsgroup is empty",
|
||||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16)));
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16)));
|
||||||
|
Loading…
Reference in New Issue
Block a user