Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
hack it
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahwilliams committed Aug 22, 2023
1 parent 6abe497 commit 1c7f941
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
13 changes: 12 additions & 1 deletion lib/studies/reply/mail_card_preview.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:animations/animations.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:gallery/layout/adaptive.dart';
import 'package:gallery/studies/reply/colors.dart';
Expand Down Expand Up @@ -252,6 +253,16 @@ class _MailPreview extends StatelessWidget {
}
}

bool _shouldShrinkImage() {
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
case TargetPlatform.android:
return true;
default:
return false;
}
}

class _PicturePreview extends StatelessWidget {
const _PicturePreview();

Expand All @@ -269,7 +280,7 @@ class _PicturePreview extends StatelessWidget {
'reply/attachments/paris_${index + 1}.jpg',
gaplessPlayback: true,
package: 'flutter_gallery_assets',
cacheWidth: 200,
cacheWidth: _shouldShrinkImage() ? 200 : null,
),
);
},
Expand Down
13 changes: 12 additions & 1 deletion lib/studies/reply/mail_view_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:gallery/studies/reply/model/email_model.dart';
import 'package:gallery/studies/reply/model/email_store.dart';
Expand Down Expand Up @@ -131,6 +132,16 @@ class _MailViewBody extends StatelessWidget {
}
}

bool _shouldShrinkImage() {
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
case TargetPlatform.android:
return true;
default:
return false;
}
}

class _PictureGrid extends StatelessWidget {
const _PictureGrid();

Expand All @@ -151,7 +162,7 @@ class _PictureGrid extends StatelessWidget {
gaplessPlayback: true,
package: 'flutter_gallery_assets',
fit: BoxFit.fill,
cacheWidth: 500,
cacheWidth: _shouldShrinkImage() ? 500 : null,
);
},
);
Expand Down
1 change: 1 addition & 0 deletions lib/studies/shrine/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class _ShrineAppState extends State<ShrineApp>

return ScopedModel<AppStateModel>(
model: _model.value,
// ignore: deprecated_member_use
child: WillPopScope(
onWillPop: _onWillPop,
child: MaterialApp(
Expand Down

0 comments on commit 1c7f941

Please sign in to comment.