π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][locker] Migrate page buttons
aman-pilot9a377f2fd642
diff --git a/mobile/apps/locker/lib/ui/pages/base_info_page.dart b/mobile/apps/locker/lib/ui/pages/base_info_page.dartindex 9b2c81701c..b7a3f10f8d 100644--- a/mobile/apps/locker/lib/ui/pages/base_info_page.dart+++ b/mobile/apps/locker/lib/ui/pages/base_info_page.dart@@ -1,5 +1,6 @@import 'dart:io';+import 'package:ente_components/ente_components.dart';import 'package:ente_events/event_bus.dart';import 'package:ente_ui/components/alert_bottom_sheet.dart';import "package:ente_ui/components/title_bar_title_widget.dart";@@ -20,7 +21,6 @@ import 'package:locker/services/files/sync/models/file.dart';import 'package:locker/services/info_file_service.dart';import 'package:locker/services/trash/models/trash_file.dart';import 'package:locker/ui/components/collection_selection_widget.dart';-import "package:locker/ui/components/gradient_button.dart";import 'package:locker/ui/pages/home_page.dart';import 'package:logging/logging.dart';@@ -43,7 +43,6 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>extends State<W> {final _logger = Logger('BaseInfoPageState');final _formKey = GlobalKey<FormState>();- bool _isLoading = false;late InfoPageMode _currentMode;@protected@@ -100,7 +99,6 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>@protectedbool get isSaveEnabled =>- !_isLoading &&_hasLoadedCollectionSelection &&(widget.existingFile == null || _selectedCollectionIds.isNotEmpty);@@ -242,10 +240,6 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>return;}- setState(() {- _isLoading = true;- });-try {// Create InfoItem using the subclass implementationfinal infoData = createInfoData();@@ -263,19 +257,13 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>await _createNewFile(infoItem);}- if (mounted) {+ if (mounted && widget.existingFile != null) {+ // Switch to view mode with updated datasetState(() {- _isLoading = false;+ _currentMode = InfoPageMode.view;});- if (widget.existingFile != null) {- // Switch to view mode with updated data- setState(() {- _currentMode = InfoPageMode.view;- });-- showToast(context, context.l10n.recordSavedSuccessfully);- }+ showToast(context, context.l10n.recordSavedSuccessfully);}} on StorageLimitExceededError {if (mounted) {@@ -296,12 +284,6 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>if (mounted) {await showGenericErrorBottomSheet(context: context, error: e);}- } finally {- if (mounted) {- setState(() {- _isLoading = false;- });- }}}@@ -499,8 +481,8 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>assetPath: "assets/warning-grey.png",isDismissible: true,buttons: [- GradientButton(- text: context.l10n.contactSupport,+ ButtonComponent(+ label: context.l10n.contactSupport,onTap: () async {await sendEmail(context, to: "[email protected]", body: message);},@@ -690,14 +672,9 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>if (isEditMode) ...[const SizedBox(height: 8),SafeArea(- child: SizedBox(- width: double.infinity,- child: GradientButton(- onTap: isSaveEnabled ? _saveRecord : null,- text: _isLoading- ? context.l10n.pleaseWait- : submitButtonText,- ),+ child: ButtonComponent(+ label: submitButtonText,+ onTap: isSaveEnabled ? _saveRecord : null,),),const SizedBox(height: 8),diff --git a/mobile/apps/locker/lib/ui/pages/onboarding_page.dart b/mobile/apps/locker/lib/ui/pages/onboarding_page.dartindex 9f5f354802..51184e1814 100644--- a/mobile/apps/locker/lib/ui/pages/onboarding_page.dart+++ b/mobile/apps/locker/lib/ui/pages/onboarding_page.dart@@ -14,7 +14,6 @@ import 'package:flutter/rendering.dart';import "package:flutter_svg/flutter_svg.dart";import 'package:locker/l10n/l10n.dart';import 'package:locker/services/configuration.dart';-import "package:locker/ui/components/gradient_button.dart";import 'package:locker/ui/pages/home_page.dart';class OnboardingPage extends StatefulWidget {@@ -137,8 +136,8 @@ class _OnboardingPageState extends State<OnboardingPage> {isDismissible: false,showCloseButton: false,buttons: [- GradientButton(- text: l10n.yes,+ ButtonComponent(+ label: l10n.yes,onTap: () async {Navigator.of(context).pop();await Navigator.of(context).push(