From 4058ebc200c26a3af19dedf73e19ce3261d1b20d Mon Sep 17 00:00:00 2001 From: krawieck Date: Tue, 6 Oct 2020 12:06:29 +0200 Subject: [PATCH] convert some returns to => --- lib/pages/home_tab.dart | 17 ++++++++--------- lib/pages/inbox.dart | 28 +++++++++++++--------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/lib/pages/home_tab.dart b/lib/pages/home_tab.dart index 014c774..4f74668 100644 --- a/lib/pages/home_tab.dart +++ b/lib/pages/home_tab.dart @@ -259,15 +259,14 @@ class InfiniteHomeList extends HookWidget { } Future> Function(int, int) _fetcherFromInstance( - String instanceUrl, PostListingType listingType, SortType sort) { - return (page, batchSize) => LemmyApi(instanceUrl).v1.getPosts( - type: listingType, - sort: sort, - page: page, - limit: batchSize, - auth: accStore.defaultTokenFor(instanceUrl)?.raw, - ); - } + String instanceUrl, PostListingType listingType, SortType sort) => + (page, batchSize) => LemmyApi(instanceUrl).v1.getPosts( + type: listingType, + sort: sort, + page: page, + limit: batchSize, + auth: accStore.defaultTokenFor(instanceUrl)?.raw, + ); return InfiniteScroll( prepend: Column( diff --git a/lib/pages/inbox.dart b/lib/pages/inbox.dart index 84a8820..bfb17af 100644 --- a/lib/pages/inbox.dart +++ b/lib/pages/inbox.dart @@ -3,20 +3,18 @@ import 'package:flutter_hooks/flutter_hooks.dart'; class InboxPage extends HookWidget { @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - '🚧 WORK IN PROGRESS 🚧', - style: Theme.of(context).textTheme.headline5, - ) - ], + Widget build(BuildContext context) => Scaffold( + appBar: AppBar(), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '🚧 WORK IN PROGRESS 🚧', + style: Theme.of(context).textTheme.headline5, + ) + ], + ), ), - ), - ); - } + ); }