mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(mobile): refactor to use context helpers for consistency (#14235)
refactor to use context helpers for consistency Co-authored-by: dvbthien <dvbthien@gmail.com>
This commit is contained in:
parent
45ba0cc3ac
commit
e8da6604c9
28 changed files with 66 additions and 46 deletions
|
|
@ -202,7 +202,7 @@ class PeopleCollectionCard extends ConsumerWidget {
|
|||
builder: (context, constraints) {
|
||||
final isTablet = constraints.maxWidth > 600;
|
||||
final widthFactor = isTablet ? 0.25 : 0.5;
|
||||
final size = MediaQuery.of(context).size.width * widthFactor - 20.0;
|
||||
final size = context.width * widthFactor - 20.0;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => context.pushRoute(const PeopleCollectionRoute()),
|
||||
|
|
@ -272,7 +272,7 @@ class LocalAlbumsCollectionCard extends HookConsumerWidget {
|
|||
builder: (context, constraints) {
|
||||
final isTablet = constraints.maxWidth > 600;
|
||||
final widthFactor = isTablet ? 0.25 : 0.5;
|
||||
final size = MediaQuery.of(context).size.width * widthFactor - 20.0;
|
||||
final size = context.width * widthFactor - 20.0;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => context.pushRoute(
|
||||
|
|
@ -335,7 +335,7 @@ class PlacesCollectionCard extends StatelessWidget {
|
|||
builder: (context, constraints) {
|
||||
final isTablet = constraints.maxWidth > 600;
|
||||
final widthFactor = isTablet ? 0.25 : 0.5;
|
||||
final size = MediaQuery.of(context).size.width * widthFactor - 20.0;
|
||||
final size = context.width * widthFactor - 20.0;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => context.pushRoute(const PlacesCollectionRoute()),
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ class PeopleCollectionPage extends HookConsumerWidget {
|
|||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final isTablet = constraints.maxWidth > 600;
|
||||
final isPortrait =
|
||||
MediaQuery.of(context).orientation == Orientation.portrait;
|
||||
final isPortrait = context.orientation == Orientation.portrait;
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ class SharedLinkEditPage extends HookConsumerWidget {
|
|||
|
||||
void copyLinkToClipboard() {
|
||||
Clipboard.setData(ClipboardData(text: newShareLink.value)).then((_) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
context.scaffoldMessenger.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
"shared_link_clipboard_copied_massage",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue