diff --git a/lib/ui/components/buttons/brand_button.dart b/lib/ui/components/buttons/brand_button.dart index bb2e722a..230d95ee 100644 --- a/lib/ui/components/buttons/brand_button.dart +++ b/lib/ui/components/buttons/brand_button.dart @@ -1,28 +1,6 @@ import 'package:flutter/material.dart'; class BrandButton { - static ConstrainedBox rised({ - required final VoidCallback? onPressed, - final Key? key, - final String? text, - final Widget? child, - }) { - assert((text ?? child) != null, 'either title or child must not be empty'); - assert(text != null || child != null, 'title or child must be provided'); - - return ConstrainedBox( - constraints: const BoxConstraints( - minHeight: 48, - minWidth: double.infinity, - ), - child: FilledButton( - key: key, - onPressed: onPressed, - child: child ?? Text(text ?? ''), - ), - ); - } - static ConstrainedBox filled({ required final VoidCallback? onPressed, final Key? key, diff --git a/lib/ui/components/jobs_content/jobs_content.dart b/lib/ui/components/jobs_content/jobs_content.dart index 181de159..5c4d5ce0 100644 --- a/lib/ui/components/jobs_content/jobs_content.dart +++ b/lib/ui/components/jobs_content/jobs_content.dart @@ -77,7 +77,7 @@ class JobsContent extends StatelessWidget { widgets = [ ...widgets, const Gap(80), - BrandButton.rised( + BrandButton.filled( onPressed: () => context.read().upgradeServer(), text: 'jobs.upgrade_server'.tr(), ), @@ -368,7 +368,7 @@ class JobsContent extends StatelessWidget { }, ), const Gap(16), - BrandButton.rised( + BrandButton.filled( onPressed: () => context.read().acknowledgeFinished(), text: 'basis.done'.tr(), ), @@ -432,7 +432,7 @@ class JobsContent extends StatelessWidget { ), ), const Gap(16), - BrandButton.rised( + BrandButton.filled( onPressed: hasBlockingJobs ? null : () => context.read().applyAll(), diff --git a/lib/ui/pages/backups/backup_details.dart b/lib/ui/pages/backups/backup_details.dart index 8e945dd7..80fcdb88 100644 --- a/lib/ui/pages/backups/backup_details.dart +++ b/lib/ui/pages/backups/backup_details.dart @@ -80,7 +80,7 @@ class BackupDetailsPage extends StatelessWidget { ), ), if (!preventActions) - BrandButton.rised( + BrandButton.filled( onPressed: preventActions ? null : () { diff --git a/lib/ui/pages/setup/initializing/dns_provider_picker.dart b/lib/ui/pages/setup/initializing/dns_provider_picker.dart index 93cae1d7..b6df0795 100644 --- a/lib/ui/pages/setup/initializing/dns_provider_picker.dart +++ b/lib/ui/pages/setup/initializing/dns_provider_picker.dart @@ -116,7 +116,7 @@ class ProviderInputDataPage extends StatelessWidget { ), ), const SizedBox(height: 32), - BrandButton.rised( + BrandButton.filled( text: 'basis.connect'.tr(), onPressed: () => providerCubit.trySubmit(), ), @@ -197,7 +197,7 @@ class ProviderSelectionPage extends StatelessWidget { style: Theme.of(context).textTheme.bodySmall, ), const SizedBox(height: 16), - BrandButton.rised( + BrandButton.filled( text: 'basis.select'.tr(), onPressed: () { serverInstallationCubit @@ -252,7 +252,7 @@ class ProviderSelectionPage extends StatelessWidget { style: Theme.of(context).textTheme.bodySmall, ), const SizedBox(height: 16), - BrandButton.rised( + BrandButton.filled( text: 'basis.select'.tr(), onPressed: () { serverInstallationCubit @@ -308,7 +308,7 @@ class ProviderSelectionPage extends StatelessWidget { style: Theme.of(context).textTheme.bodySmall, ), const SizedBox(height: 16), - BrandButton.rised( + BrandButton.filled( text: 'basis.select'.tr(), onPressed: () { serverInstallationCubit diff --git a/lib/ui/pages/setup/initializing/initializing.dart b/lib/ui/pages/setup/initializing/initializing.dart index c841a3e5..563a9a1b 100644 --- a/lib/ui/pages/setup/initializing/initializing.dart +++ b/lib/ui/pages/setup/initializing/initializing.dart @@ -304,7 +304,7 @@ class InitializingPage extends StatelessWidget { ), ), const SizedBox(height: 32), - BrandButton.rised( + BrandButton.filled( onPressed: formCubitState.isSubmitting ? null : () => context.read().trySubmit(), @@ -624,7 +624,7 @@ class AddSshKey extends StatelessWidget { ), ), const SizedBox(height: 30), - BrandButton.rised( + BrandButton.filled( onPressed: formCubitState.isSubmitting ? null : () => context diff --git a/lib/ui/pages/setup/initializing/server_type_picker.dart b/lib/ui/pages/setup/initializing/server_type_picker.dart index 53a25619..f92a9a8e 100644 --- a/lib/ui/pages/setup/initializing/server_type_picker.dart +++ b/lib/ui/pages/setup/initializing/server_type_picker.dart @@ -211,7 +211,7 @@ class SelectTypePage extends StatelessWidget { ), ), const SizedBox(height: 16), - BrandButton.rised( + BrandButton.filled( onPressed: () { backToLocationPickingCallback(); }, diff --git a/lib/ui/pages/setup/recovering/recovery_confirm_backblaze.dart b/lib/ui/pages/setup/recovering/recovery_confirm_backblaze.dart index 4b27e3ad..51cc1d48 100644 --- a/lib/ui/pages/setup/recovering/recovery_confirm_backblaze.dart +++ b/lib/ui/pages/setup/recovering/recovery_confirm_backblaze.dart @@ -53,7 +53,7 @@ class RecoveryConfirmBackblaze extends StatelessWidget { ), ), const SizedBox(height: 16), - BrandButton.rised( + BrandButton.filled( onPressed: formCubitState.isSubmitting ? null : () => context.read().trySubmit(), diff --git a/lib/ui/pages/setup/recovering/recovery_confirm_dns.dart b/lib/ui/pages/setup/recovering/recovery_confirm_dns.dart index f692c904..393dc820 100644 --- a/lib/ui/pages/setup/recovering/recovery_confirm_dns.dart +++ b/lib/ui/pages/setup/recovering/recovery_confirm_dns.dart @@ -51,7 +51,7 @@ class RecoveryConfirmDns extends StatelessWidget { ), ), const SizedBox(height: 16), - BrandButton.rised( + BrandButton.filled( onPressed: formCubitState.isSubmitting ? null : () => context.read().trySubmit(), diff --git a/lib/ui/pages/users/new_user.dart b/lib/ui/pages/users/new_user.dart index 3327da33..6b6c65fa 100644 --- a/lib/ui/pages/users/new_user.dart +++ b/lib/ui/pages/users/new_user.dart @@ -106,7 +106,7 @@ class NewUserPage extends StatelessWidget { ), ), const SizedBox(height: 30), - BrandButton.rised( + BrandButton.filled( onPressed: formCubitState.isSubmitting ? null : () => context.read().trySubmit(), diff --git a/lib/ui/pages/users/reset_password.dart b/lib/ui/pages/users/reset_password.dart index 1579591c..145c0baa 100644 --- a/lib/ui/pages/users/reset_password.dart +++ b/lib/ui/pages/users/reset_password.dart @@ -63,7 +63,7 @@ class ResetPassword extends StatelessWidget { ), ), const SizedBox(height: 30), - BrandButton.rised( + BrandButton.filled( onPressed: formCubitState.isSubmitting ? null : () => context.read().trySubmit(), diff --git a/lib/ui/pages/users/user_details.dart b/lib/ui/pages/users/user_details.dart index b53246bc..148c5dd5 100644 --- a/lib/ui/pages/users/user_details.dart +++ b/lib/ui/pages/users/user_details.dart @@ -328,7 +328,7 @@ class NewSshKey extends StatelessWidget { ), ), const SizedBox(height: 30), - BrandButton.rised( + BrandButton.filled( onPressed: formCubitState.isSubmitting ? null : () => context.read().trySubmit(),