Skip to content

Commit

Permalink
chore: remove unnecessary widget
Browse files Browse the repository at this point in the history
  • Loading branch information
nbetsaif committed Aug 27, 2024
1 parent f807b57 commit 44d8d96
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions lib/ui/shared/hypha_body_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,19 @@ class HyphaBodyWidget extends StatelessWidget {

@override
Widget build(BuildContext context) {
return SafeArea(
child: Builder(
builder: (context) {
switch (pageState) {
case PageState.initial:
return initial?.call(context) ?? const SizedBox.shrink();
case PageState.loading:
return loading?.call(context) ?? const Center(child: CircularProgressIndicator.adaptive());
case PageState.failure:
return failure?.call(context) ?? const HyphaErrorWidget();
case PageState.success:
return GestureDetector(onTap: () => FocusScope.of(context).unfocus(), child: success(context));
}
},
),
return Builder(
builder: (context) {
switch (pageState) {
case PageState.initial:
return initial?.call(context) ?? const SizedBox.shrink();
case PageState.loading:
return loading?.call(context) ?? const Center(child: CircularProgressIndicator.adaptive());
case PageState.failure:
return failure?.call(context) ?? const HyphaErrorWidget();
case PageState.success:
return GestureDetector(onTap: () => FocusScope.of(context).unfocus(), child: success(context));
}
},
);
}
}

0 comments on commit 44d8d96

Please sign in to comment.