mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(mobile): build context extensions (#4923)
* refactor: move all extensions to separate package * refactor(mobile): add BuildContext extension * refactor(mobile): use theme getters from context * refactor(mobile): use media query size from context * refactor(mobile): use auto router methods from context * refactor(mobile): use navigator methods from context --------- Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
a147dee4b6
commit
bffc2cdf60
106 changed files with 660 additions and 628 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
||||
import 'package:immich_mobile/shared/models/store.dart';
|
||||
import 'package:immich_mobile/utils/capitalize.dart';
|
||||
import 'package:immich_mobile/extensions/string_extensions.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ThumbnailWithInfo extends StatelessWidget {
|
||||
|
|
@ -22,8 +23,8 @@ class ThumbnailWithInfo extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
||||
var textAndIconColor = isDarkMode ? Colors.grey[100] : Colors.grey[700];
|
||||
var textAndIconColor =
|
||||
context.isDarkTheme ? Colors.grey[100] : Colors.grey[700];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTap();
|
||||
|
|
@ -34,7 +35,7 @@ class ThumbnailWithInfo extends StatelessWidget {
|
|||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
color: isDarkMode ? Colors.grey[900] : Colors.grey[100],
|
||||
color: context.isDarkTheme ? Colors.grey[900] : Colors.grey[100],
|
||||
),
|
||||
child: imageUrl != null
|
||||
? ClipRRect(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue