Skip to content

Commit e5bebb7

Browse files
committed
Pagination: Removing scroll notifications on home view
1 parent bc170c7 commit e5bebb7

File tree

1 file changed

+60
-65
lines changed

1 file changed

+60
-65
lines changed

lib/src/views/home_view.dart

Lines changed: 60 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -81,78 +81,73 @@ class _HomeViewState extends State<HomeView> implements AutomaticKeepAliveClient
8181
currentFocus.unfocus();
8282
}
8383
},
84-
child: NotificationListener<ScrollEndNotification>(
85-
onNotification: client.rss.isMoreToFetch ? (ScrollEndNotification notif) {
86-
return true;
87-
} : null,
88-
child: CustomScrollView(
89-
controller: controller,
90-
shrinkWrap: true,
91-
slivers: [
92-
SliverAppBar(
93-
backgroundColor: Theme.of(context).colorScheme.background,
94-
toolbarHeight: MediaQuery.of(context).size.height * .05,
95-
collapsedHeight: MediaQuery.of(context).size.height * .05,
96-
expandedHeight: MediaQuery.of(context).size.height * .1,
97-
pinned: true,
98-
elevation: 20,
99-
centerTitle: true,
100-
flexibleSpace: const PersistentSearchBar()
101-
),
102-
SliverToBoxAdapter(
103-
child: Center(
104-
child: RichText(
105-
text: TextSpan(
106-
text: "Track",
107-
style: TextStyle(
108-
color: Theme.of(context).colorScheme.onBackground,
109-
fontSize: 35,
110-
fontWeight: FontWeight.bold
111-
),
112-
children: [
113-
TextSpan(
114-
text: " your light",
115-
style: TextStyle(
116-
color: Theme.of(context).colorScheme.tertiary,
117-
fontSize: 35,
118-
fontWeight: FontWeight.bold
119-
),
120-
)
121-
]
122-
),
123-
)
124-
),
125-
),
126-
SliverToBoxAdapter(
127-
child: SizedBox(height: MediaQuery.of(context).size.height *.025)
128-
),
129-
SliverToBoxAdapter(
130-
child: Center(
131-
child: Text(
132-
"View all your statistics on the same platform.",
133-
textAlign: TextAlign.center,
84+
child: CustomScrollView(
85+
controller: controller,
86+
shrinkWrap: true,
87+
slivers: [
88+
SliverAppBar(
89+
backgroundColor: Theme.of(context).colorScheme.background,
90+
toolbarHeight: MediaQuery.of(context).size.height * .05,
91+
collapsedHeight: MediaQuery.of(context).size.height * .05,
92+
expandedHeight: MediaQuery.of(context).size.height * .1,
93+
pinned: true,
94+
elevation: 20,
95+
centerTitle: true,
96+
flexibleSpace: const PersistentSearchBar()
97+
),
98+
SliverToBoxAdapter(
99+
child: Center(
100+
child: RichText(
101+
text: TextSpan(
102+
text: "Track",
134103
style: TextStyle(
135104
color: Theme.of(context).colorScheme.onBackground,
136-
fontSize: 20,
137-
fontWeight: FontWeight.w500
105+
fontSize: 35,
106+
fontWeight: FontWeight.bold
138107
),
139-
)
140-
),
141-
),
142-
SliverToBoxAdapter(
143-
child: SizedBox(height: MediaQuery.of(context).size.height *.05)
108+
children: [
109+
TextSpan(
110+
text: " your light",
111+
style: TextStyle(
112+
color: Theme.of(context).colorScheme.tertiary,
113+
fontSize: 35,
114+
fontWeight: FontWeight.bold
115+
),
116+
)
117+
]
118+
),
119+
)
144120
),
145-
PagedSliverList(
146-
pagingController: pController,
147-
builderDelegate: PagedChildBuilderDelegate<NewsArticle>(
148-
itemBuilder: (BuildContext context, NewsArticle item, int index) => NewsArticleItem(
149-
rssInformation: item
121+
),
122+
SliverToBoxAdapter(
123+
child: SizedBox(height: MediaQuery.of(context).size.height *.025)
124+
),
125+
SliverToBoxAdapter(
126+
child: Center(
127+
child: Text(
128+
"View all your statistics on the same platform.",
129+
textAlign: TextAlign.center,
130+
style: TextStyle(
131+
color: Theme.of(context).colorScheme.onBackground,
132+
fontSize: 20,
133+
fontWeight: FontWeight.w500
150134
),
151-
animateTransitions: false
152135
)
136+
),
137+
),
138+
SliverToBoxAdapter(
139+
child: SizedBox(height: MediaQuery.of(context).size.height *.05)
140+
),
141+
PagedSliverList(
142+
pagingController: pController,
143+
builderDelegate: PagedChildBuilderDelegate<NewsArticle>(
144+
itemBuilder: (BuildContext context, NewsArticle item, int index) => NewsArticleItem(
145+
rssInformation: item
146+
),
147+
animateTransitions: false
153148
)
154-
],
155-
),
149+
)
150+
],
156151
),
157152
)
158153
);

0 commit comments

Comments
 (0)