Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
PLGuerraDesigns committed Jan 20, 2024
2 parents 192470e + 9b93ae8 commit 74924ba
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
2 changes: 2 additions & 0 deletions lib/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ class HomeScreen extends StatelessWidget {
child: FloatingThumbnail(
title: Strings.professional,
image: Strings.professionalExperiencePhotoPath,
shimmer: true,
onTap: () {
context
.go('${Strings.homeRoute}/${Strings.professionalSubRoute}');
Expand All @@ -219,6 +220,7 @@ class HomeScreen extends StatelessWidget {
child: FloatingThumbnail(
title: Strings.personal,
image: Strings.personalExperiencePhotoPath,
shimmer: true,
onTap: () {
context.go('${Strings.homeRoute}/${Strings.personalSubRoute}');
},
Expand Down
28 changes: 24 additions & 4 deletions lib/widgets/floating_thumbnail.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';

import '../common/color_schemes.dart';
import 'frosted_container.dart';
Expand All @@ -16,6 +17,7 @@ class FloatingThumbnail extends StatefulWidget {
this.logoPath,
this.subtitle,
this.frosted = false,
this.shimmer = false,
});

/// The logo to display in the thumbnail.
Expand All @@ -36,6 +38,9 @@ class FloatingThumbnail extends StatefulWidget {
/// Whether the thumbnail should be on a frosted glass background.
final bool frosted;

/// Whether the thumbnail should shimmer.
final bool shimmer;

@override
State<FloatingThumbnail> createState() => _FloatingThumbnailState();
}
Expand Down Expand Up @@ -69,9 +74,25 @@ class _FloatingThumbnailState extends State<FloatingThumbnail> {
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: Image.asset(
widget.image,
fit: BoxFit.contain,
child: Stack(
fit: StackFit.expand,
alignment: Alignment.center,
children: <Widget>[
Image.asset(
widget.image,
fit: BoxFit.contain,
),
if (widget.shimmer)
Shimmer.fromColors(
period: const Duration(milliseconds: 5000),
baseColor: Colors.transparent,
highlightColor: Colors.white24,
child: Image.asset(
widget.image,
fit: BoxFit.contain,
),
),
],
),
),
const SizedBox(height: 16),
Expand Down Expand Up @@ -99,7 +120,6 @@ class _FloatingThumbnailState extends State<FloatingThumbnail> {
onTap: widget.onTap,
child: widget.frosted
? FrostedContainer(
borderRadiusAmount: 16.0,
child: _body(),
)
: _body(),
Expand Down
3 changes: 0 additions & 3 deletions lib/widgets/media_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class MediaBrowser extends StatelessWidget {
'https://i3.ytimg.com/vi/${youtubeVideoIds[index]}/sddefault.jpg',
fit: BoxFit.cover,
cacheHeight: 250,
cacheWidth: 250,
),
),
const ColoredBox(
Expand Down Expand Up @@ -202,13 +201,11 @@ class MediaBrowser extends StatelessWidget {
? Image.asset(
imagePaths[index],
cacheHeight: 250,
cacheWidth: 250,
fit: BoxFit.cover,
)
: Image.network(
webImagePaths[index - imagePaths.length],
cacheHeight: 250,
cacheWidth: 250,
loadingBuilder: (BuildContext context, Widget child,
ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) {
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.0.5"
shimmer:
dependency: "direct main"
description:
name: shimmer
sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
sky_engine:
dependency: transitive
description: flutter
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: plg_portfolio
description: Pablo L. Guerra's web-app portfolio powered by Flutter.
publish_to: "none"
version: 2.0.11+31
version: 2.0.12+32

environment:
sdk: ">=3.1.1 <4.0.0"
Expand All @@ -20,6 +20,7 @@ dependencies:
go_router: ^11.1.2
url_strategy: ^0.2.0
unorm_dart: ^0.2.0
shimmer: ^3.0.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 74924ba

Please sign in to comment.