Compare commits

..

No commits in common. "e74aba2d8b8ef6f329e9d7469f7c16252e366125" and "06b4cb863ede239236f0790b103b9f5b46b4a54f" have entirely different histories.

4 changed files with 6 additions and 8 deletions

View File

@ -47,12 +47,11 @@ class _ExploreScreenState extends State<ExploreScreen> {
if (res.statusCode == 200) { if (res.statusCode == 200) {
final result = final result =
PaginationResult.fromJson(jsonDecode(utf8.decode(res.bodyBytes))); PaginationResult.fromJson(jsonDecode(utf8.decode(res.bodyBytes)));
final isLastPage = (result.count - pageKey) < pageSize; final isLastPage = (result.data?.length ?? 0) < pageSize;
if (isLastPage || result.data == null) { if (isLastPage) {
paginationController.appendLastPage(feed); paginationController.appendLastPage(feed);
} else { } else {
final feed = final feed = result.data!.map((x) => Feed.fromJson(x)).toList();
result.data?.map((x) => Feed.fromJson(x)).toList() ?? List.empty();
final nextPageKey = pageKey + feed.length; final nextPageKey = pageKey + feed.length;
paginationController.appendPage(feed, nextPageKey); paginationController.appendPage(feed, nextPageKey);
} }

View File

@ -22,7 +22,7 @@ class _MomentEditorScreenState extends State<MomentEditorScreen> {
bool showRecommendationBanner = true; bool showRecommendationBanner = true;
Future<void> postMoment() async { Future<void> postMoment() async {
if (!await authClient.isAuthorized()) return; if (authClient.client == null) return;
setState(() => isSubmitting = true); setState(() => isSubmitting = true);
var res = await authClient.client!.post( var res = await authClient.client!.post(

View File

@ -51,15 +51,15 @@ class FeedItem extends StatelessWidget {
child: FlutterCarousel( child: FlutterCarousel(
options: CarouselOptions( options: CarouselOptions(
height: 240.0, height: 240.0,
viewportFraction: 1.0,
showIndicator: true, showIndicator: true,
slideIndicator: const CircularSlideIndicator(), slideIndicator: const CircularSlideIndicator(),
), ),
items: item.attachments?.map((x) { items: item.attachments?.map((x) {
return Builder( return Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return SizedBox( return Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
margin: const EdgeInsets.symmetric(horizontal: 5.0),
child: InkWell( child: InkWell(
child: Image.network( child: Image.network(
getFileUrl(x.fileId), getFileUrl(x.fileId),

View File

@ -12,7 +12,6 @@ class ImageLightbox extends StatelessWidget {
child: Center( child: Center(
child: SizedBox( child: SizedBox(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: InteractiveViewer( child: InteractiveViewer(
boundaryMargin: const EdgeInsets.all(128), boundaryMargin: const EdgeInsets.all(128),
minScale: 0.1, minScale: 0.1,