Skip to content

Commit

Permalink
Add empty media screen
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-pratik-k committed Dec 24, 2024
1 parent da24a9a commit d12a9d0
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 29 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
47 changes: 47 additions & 0 deletions app/assets/images/il_no_media_found.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
3 changes: 3 additions & 0 deletions app/assets/locales/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
"download_require_text": "Download required",
"download_require_message": "To watch the video, simply download it first. Tap the download button to begin downloading the video.",
"download_in_progress_text": "Download in progress",
"empty_media_title": "Oh Snap! No Media Found!",
"empty_media_message": "Looks like your gallery is taking a little break.",


"@_MEDIA_INFO":{},
"name_text": "Name",
Expand Down
4 changes: 2 additions & 2 deletions app/lib/components/error_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ErrorScreen extends StatelessWidget {

Widget _noInternetConnectionScreen(BuildContext context) => PlaceHolderScreen(
icon: SvgPicture.asset(
Assets.images.icNoInternet,
Assets.images.ilNoInternet,
height: 120,
width: 120,
),
Expand All @@ -37,7 +37,7 @@ class ErrorScreen extends StatelessWidget {

Widget _errorScreen(BuildContext context) => PlaceHolderScreen(
icon: SvgPicture.asset(
Assets.images.icError,
Assets.images.ilError,
height: 120,
width: 120,
),
Expand Down
42 changes: 23 additions & 19 deletions app/lib/gen/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class NoInternetConnectionHint extends ConsumerWidget {
Row(
children: [
SvgPicture.asset(
Assets.images.icNoInternet,
Assets.images.ilNoInternet,
height: 50,
width: 50,
),
Expand Down
16 changes: 15 additions & 1 deletion app/lib/ui/flow/home/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'dart:io';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import '../../../components/app_page.dart';
import '../../../components/error_screen.dart';
import '../../../components/place_holder_screen.dart';
import '../../../domain/extensions/widget_extensions.dart';
import '../../../domain/formatter/date_formatter.dart';
import '../../../domain/extensions/context_extensions.dart';
Expand Down Expand Up @@ -131,6 +133,18 @@ class _HomeScreenState extends ConsumerState<HomeScreen> {
children: [
const HomeScreenHints(),
const NoInternetConnectionHint(),
if (state.medias.isEmpty)
Padding(
padding: const EdgeInsets.symmetric(vertical: 40),
child: PlaceHolderScreen(
icon: SvgPicture.asset(
Assets.images.ilNoMediaFound,
width: 150,
),
title: context.l10n.empty_media_title,
message: context.l10n.empty_media_message,
),
),
],
);
} else if (index == state.medias.length + 1) {
Expand Down Expand Up @@ -232,7 +246,7 @@ class HomeAppTitle extends StatelessWidget {
children: [
if (Platform.isIOS) const SizedBox(width: 10),
Image.asset(
Assets.images.appLogo.path,
Assets.images.appIcon.path,
width: 28,
),
const SizedBox(width: 10),
Expand Down
10 changes: 8 additions & 2 deletions app/lib/ui/flow/media_preview/media_preview_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:io';
import 'package:data/storage/app_preferences.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
import 'package:style/animations/dismissible_page.dart';
import '../../../components/app_page.dart';
Expand All @@ -9,6 +10,7 @@ import '../../../components/snack_bar.dart';
import '../../../domain/extensions/context_extensions.dart';
import '../../../domain/extensions/widget_extensions.dart';
import '../../../domain/image_providers/app_media_image_provider.dart';
import '../../../gen/assets.gen.dart';
import 'components/download_require_view.dart';
import 'components/local_media_image_preview.dart';
import 'components/network_image_preview/network_image_preview.dart';
Expand Down Expand Up @@ -172,8 +174,12 @@ class _MediaPreviewState extends ConsumerState<MediaPreview> {
onTap: _notifier.toggleActionVisibility,
child: state.medias.isEmpty
? PlaceHolderScreen(
title: "No media found",
message: "No media found",
icon: SvgPicture.asset(
Assets.images.ilNoMediaFound,
width: 100,
),
title: context.l10n.empty_media_title,
message: context.l10n.empty_media_message,
)
: PageView.builder(
physics: state.isImageZoomed
Expand Down
4 changes: 2 additions & 2 deletions app/lib/ui/flow/media_transfer/media_transfer_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class _MediaTransferScreenState extends ConsumerState<MediaTransferScreen> {
title: context.l10n.empty_upload_title,
message: context.l10n.empty_upload_message,
icon: SvgPicture.asset(
Assets.images.icUpload,
Assets.images.ilUpload,
height: 200,
width: 200,
),
Expand Down Expand Up @@ -147,7 +147,7 @@ class _MediaTransferScreenState extends ConsumerState<MediaTransferScreen> {
title: context.l10n.empty_download_title,
message: context.l10n.empty_download_message,
icon: SvgPicture.asset(
Assets.images.icDownload,
Assets.images.ilDownload,
height: 200,
width: 200,
),
Expand Down
2 changes: 1 addition & 1 deletion app/lib/ui/flow/onboard/onboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class OnBoardScreen extends ConsumerWidget {
}

Widget _appLogo(BuildContext context) => Image.asset(
Assets.images.appLogo.path,
Assets.images.appIcon.path,
width: 250,
);

Expand Down
2 changes: 1 addition & 1 deletion data/.flutter-plugins-dependencies

Large diffs are not rendered by default.

0 comments on commit d12a9d0

Please sign in to comment.