Skip to content

Commit

Permalink
Cloud upload indicator for the gallery (#5419)
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k authored Jun 20, 2024
1 parent 274d797 commit b322c68
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
Binary file modified packages/smooth_app/assets/animations/off.riv
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'package:smooth_app/pages/image_crop_page.dart';
import 'package:smooth_app/pages/product/common/product_refresher.dart';
import 'package:smooth_app/pages/product/product_image_swipeable_view.dart';
import 'package:smooth_app/query/product_query.dart';
import 'package:smooth_app/resources/app_animations.dart';
import 'package:smooth_app/widgets/slivers.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

Expand Down Expand Up @@ -190,6 +191,8 @@ class _PhotoRow extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ImageField imageField = _getImageField(position);
final TransientFile transientFile = _getTransientFile(imageField);

return Padding(
padding: const EdgeInsets.only(
top: SMALL_SPACE,
Expand All @@ -201,12 +204,40 @@ class _PhotoRow extends StatelessWidget {
),
child: Column(
children: <Widget>[
AspectRatio(
aspectRatio: 1.0,
child: SmoothImage(
rounded: false,
imageProvider: _getTransientFile(imageField).getImageProvider(),
),
Stack(
children: <Widget>[
AspectRatio(
aspectRatio: 1.0,
child: SmoothImage(
rounded: false,
imageProvider: transientFile.getImageProvider(),
),
),
if (transientFile.isImageAvailable() &&
!transientFile.isServerImage())
Positioned.directional(
textDirection: Directionality.of(context),
bottom: VERY_SMALL_SPACE,
end: VERY_SMALL_SPACE,
width: 30.0,
height: 30.0,
child: DecoratedBox(
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.5),
shape: BoxShape.circle,
),
child: const Padding(
padding: EdgeInsetsDirectional.only(
start: SMALL_SPACE,
end: SMALL_SPACE,
top: SMALL_SPACE,
bottom: SMALL_SPACE - 1.0,
),
child: CloudUploadAnimation(),
),
),
),
],
),
Expanded(
child: Center(
Expand Down
15 changes: 15 additions & 0 deletions packages/smooth_app/lib/resources/app_animations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ class BarcodeAnimation extends StatelessWidget {
}
}

class CloudUploadAnimation extends StatelessWidget {
const CloudUploadAnimation({
super.key,
});

@override
Widget build(BuildContext context) {
return RiveAnimation.direct(
AnimationsLoader.of(context),
artboard: 'Cloud upload',
animations: const <String>['Animation'],
);
}
}

class ConsentAnimation extends StatelessWidget {
const ConsentAnimation({
super.key,
Expand Down

0 comments on commit b322c68

Please sign in to comment.