Merge pull request #612 from ente-io/storage-card-fixes
Storage card + backup screen fixes
This commit is contained in:
commit
6da466d17c
Binary file not shown.
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 201 KiB |
Binary file not shown.
Before Width: | Height: | Size: 420 KiB After Width: | Height: | Size: 421 KiB |
Binary file not shown.
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 54 KiB |
|
@ -31,6 +31,7 @@ class BackupSettingsScreen extends StatelessWidget {
|
|||
isSecondary: true,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
|
@ -11,16 +11,16 @@ import 'package:photos/ui/settings/storage_error_widget.dart';
|
|||
import 'package:photos/ui/settings/storage_progress_widget.dart';
|
||||
import 'package:photos/utils/data_util.dart';
|
||||
|
||||
class DetailsSectionWidget extends StatefulWidget {
|
||||
const DetailsSectionWidget({Key? key}) : super(key: key);
|
||||
class StorageCardWidget extends StatefulWidget {
|
||||
const StorageCardWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<DetailsSectionWidget> createState() => _DetailsSectionWidgetState();
|
||||
State<StorageCardWidget> createState() => _StorageCardWidgetState();
|
||||
}
|
||||
|
||||
class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
|
||||
class _StorageCardWidgetState extends State<StorageCardWidget> {
|
||||
late Image _background;
|
||||
final _logger = Logger((_DetailsSectionWidgetState).toString());
|
||||
final _logger = Logger((_StorageCardWidgetState).toString());
|
||||
final ValueNotifier<bool> _isStorageCardPressed = ValueNotifier(false);
|
||||
|
||||
@override
|
||||
|
@ -46,10 +46,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
|
|||
|
||||
if (inheritedUserDetails == null) {
|
||||
_logger.severe(
|
||||
(InheritedUserDetails).toString() +
|
||||
' not found before ' +
|
||||
(_DetailsSectionWidgetState).toString() +
|
||||
' on tree',
|
||||
(InheritedUserDetails).toString() + 'is null',
|
||||
);
|
||||
throw Error();
|
||||
} else {
|
||||
|
@ -64,12 +61,9 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
|
|||
),
|
||||
);
|
||||
},
|
||||
onTapDown: (details) {
|
||||
_isStorageCardPressed.value = true;
|
||||
},
|
||||
onTapUp: (details) {
|
||||
_isStorageCardPressed.value = false;
|
||||
},
|
||||
onTapDown: (details) => _isStorageCardPressed.value = true,
|
||||
onTapCancel: () => _isStorageCardPressed.value = false,
|
||||
onTapUp: (details) => _isStorageCardPressed.value = false,
|
||||
child: containerForUserDetails(inheritedUserDetails),
|
||||
);
|
||||
}
|
||||
|
@ -79,7 +73,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
|
|||
InheritedUserDetails inheritedUserDetails,
|
||||
) {
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 365),
|
||||
constraints: const BoxConstraints(maxWidth: 350),
|
||||
child: AspectRatio(
|
||||
aspectRatio: 2 / 1,
|
||||
child: Stack(
|
|
@ -14,10 +14,10 @@ import 'package:photos/ui/settings/app_version_widget.dart';
|
|||
import 'package:photos/ui/settings/backup_section_widget.dart';
|
||||
import 'package:photos/ui/settings/danger_section_widget.dart';
|
||||
import 'package:photos/ui/settings/debug_section_widget.dart';
|
||||
import 'package:photos/ui/settings/details_section_widget.dart';
|
||||
import 'package:photos/ui/settings/security_section_widget.dart';
|
||||
import 'package:photos/ui/settings/settings_title_bar_widget.dart';
|
||||
import 'package:photos/ui/settings/social_section_widget.dart';
|
||||
import 'package:photos/ui/settings/storage_card_widget.dart';
|
||||
import 'package:photos/ui/settings/support_section_widget.dart';
|
||||
import 'package:photos/ui/settings/theme_switch_widget.dart';
|
||||
|
||||
|
@ -42,6 +42,7 @@ class SettingsPage extends StatelessWidget {
|
|||
final List<Widget> contents = [];
|
||||
contents.add(
|
||||
Container(
|
||||
constraints: const BoxConstraints(maxWidth: 350),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
|
@ -65,7 +66,7 @@ class SettingsPage extends StatelessWidget {
|
|||
contents.add(const SizedBox(height: 8));
|
||||
if (hasLoggedIn) {
|
||||
contents.addAll([
|
||||
const DetailsSectionWidget(),
|
||||
const StorageCardWidget(),
|
||||
const SizedBox(height: 12),
|
||||
const BackupSectionWidget(),
|
||||
sectionSpacing,
|
||||
|
|
Loading…
Reference in a new issue