Memories final fixes (#1662)
This commit is contained in:
commit
c982ddd347
5 changed files with 31 additions and 39 deletions
|
@ -1,12 +1,9 @@
|
|||
import 'package:flutter/widgets.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:photos/ui/home/memories/memories_widget.dart';
|
||||
import "package:photos/ui/home/memories/memories_widget.dart";
|
||||
import 'package:photos/ui/home/status_bar_widget.dart';
|
||||
|
||||
class HeaderWidget extends StatelessWidget {
|
||||
static const _memoriesWidget = MemoriesWidget();
|
||||
static const _statusBarWidget = StatusBarWidget();
|
||||
|
||||
const HeaderWidget({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
@ -14,13 +11,12 @@ class HeaderWidget extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Logger("Header").info("Building header widget");
|
||||
const list = [
|
||||
_statusBarWidget,
|
||||
_memoriesWidget,
|
||||
];
|
||||
return const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: list,
|
||||
children: [
|
||||
StatusBarWidget(),
|
||||
MemoriesWidget(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -154,13 +154,13 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
|
|||
automaticallyImplyLeading: false,
|
||||
title: ValueListenableBuilder(
|
||||
valueListenable: inheritedData.indexNotifier,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Icon(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.fromLTRB(4, 8, 8, 8),
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
color: Colors.white, //same for both themes
|
||||
),
|
||||
|
@ -180,7 +180,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
|
|||
)
|
||||
: const SizedBox.shrink(),
|
||||
const SizedBox(
|
||||
height: 18,
|
||||
height: 10,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
|
|
|
@ -6,7 +6,6 @@ import "package:photos/core/event_bus.dart";
|
|||
import "package:photos/events/memories_setting_changed.dart";
|
||||
import 'package:photos/models/memory.dart';
|
||||
import 'package:photos/services/memories_service.dart';
|
||||
import "package:photos/ui/common/loading_widget.dart";
|
||||
import 'package:photos/ui/home/memories/memory_cover_widget.dart';
|
||||
|
||||
class MemoriesWidget extends StatefulWidget {
|
||||
|
@ -58,10 +57,12 @@ class _MemoriesWidgetState extends State<MemoriesWidget> {
|
|||
return FutureBuilder<List<Memory>>(
|
||||
future: MemoriesService.instance.getMemories(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty) {
|
||||
if (snapshot.hasData && snapshot.data!.isEmpty) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
if (snapshot.hasError || !snapshot.hasData) {
|
||||
return SizedBox(
|
||||
height: _maxHeight + 12 + 10,
|
||||
child: const EnteLoadingWidget(),
|
||||
);
|
||||
} else {
|
||||
return Column(
|
||||
|
@ -73,7 +74,10 @@ class _MemoriesWidgetState extends State<MemoriesWidget> {
|
|||
_buildMemories(snapshot.data!),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
);
|
||||
).animate().fadeIn(
|
||||
duration: const Duration(milliseconds: 250),
|
||||
curve: Curves.easeInOutCirc,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
@ -97,13 +101,7 @@ class _MemoriesWidgetState extends State<MemoriesWidget> {
|
|||
offsetOfItem: offsetOfItem,
|
||||
maxHeight: _maxHeight,
|
||||
maxWidth: _maxWidth,
|
||||
)
|
||||
.animate(delay: Duration(milliseconds: 75 * itemIndex))
|
||||
.fadeIn(
|
||||
duration: const Duration(milliseconds: 250),
|
||||
curve: Curves.easeInOutCubic,
|
||||
)
|
||||
.slideX(begin: 0.04, end: 0);
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
|
|
@ -103,16 +103,14 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.isEnabled) {
|
||||
return Stack(
|
||||
children: [
|
||||
RepaintBoundary(child: widget.child),
|
||||
RepaintBoundary(child: buildThumb()),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return widget.child;
|
||||
}
|
||||
return Stack(
|
||||
children: [
|
||||
RepaintBoundary(child: widget.child),
|
||||
widget.isEnabled
|
||||
? RepaintBoundary(child: buildThumb())
|
||||
: const SizedBox.shrink(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildThumb() => Padding(
|
||||
|
|
|
@ -12,7 +12,7 @@ description: ente photos application
|
|||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
|
||||
version: 0.8.42+562
|
||||
version: 0.8.43+563
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
|
Loading…
Add table
Reference in a new issue