radars search bug fixed

This commit is contained in:
MohammadTaha Basiri 2022-01-30 17:03:16 +03:30
parent 6da1f5f9f3
commit b12a294f4e
3 changed files with 6 additions and 4 deletions

View File

@ -66,8 +66,7 @@ class _RadarState extends State<Radar> {
builder: (context, state, child) => Stack( builder: (context, state, child) => Stack(
children: [ children: [
CustomScrollView( CustomScrollView(
physics: _isAnimating || physics: _isAnimating
(state.appState == AppState.busy && state.radars.isEmpty)
? const NeverScrollableScrollPhysics() ? const NeverScrollableScrollPhysics()
: const ScrollPhysics(), : const ScrollPhysics(),
controller: _scrollController, controller: _scrollController,
@ -159,7 +158,8 @@ class _RadarState extends State<Radar> {
), ),
if (state.appState != AppState.failed) CategoriesRow1(), if (state.appState != AppState.failed) CategoriesRow1(),
if (state.appState != AppState.failed) CategoriesRow2(), if (state.appState != AppState.failed) CategoriesRow2(),
if (state.appState != AppState.failed) CategoriesList(), if (state.appState != AppState.failed && !state.searching)
CategoriesList(),
], ],
), ),
); );
@ -281,6 +281,7 @@ class _RadarState extends State<Radar> {
@override @override
void dispose() { void dispose() {
_focusNode.dispose();
_scrollController.dispose(); _scrollController.dispose();
super.dispose(); super.dispose();
} }

View File

@ -48,6 +48,7 @@ class RadarDetailsState extends CoreProvier {
if (result['nextRadar'].isNotEmpty) { if (result['nextRadar'].isNotEmpty) {
nextRadar = RadarDetailsData.fromJson(result['nextRadar']); nextRadar = RadarDetailsData.fromJson(result['nextRadar']);
} }
if (isForward == null) { if (isForward == null) {
radars.addAll(List.generate(max(radar.order - 2, 0), (index) => null)); radars.addAll(List.generate(max(radar.order - 2, 0), (index) => null));
if (prevRadar != null) { if (prevRadar != null) {
@ -72,6 +73,7 @@ class RadarDetailsState extends CoreProvier {
appState = AppState.idle; appState = AppState.idle;
return; return;
} }
if (isForward == null) { if (isForward == null) {
appState = AppState.failed; appState = AppState.failed;
} }

View File

@ -125,7 +125,6 @@ class _SearchFieldState extends State<SearchField> {
@override @override
void dispose() { void dispose() {
widget.focusNode.dispose();
super.dispose(); super.dispose();
} }
} }