mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-02-02 14:16:58 +00:00
feat(ui): Use adaptive widgets where possible
This commit is contained in:
parent
1cb5df19f3
commit
e9538a4a84
|
@ -67,7 +67,7 @@ class BackupDetailsPage extends StatelessWidget {
|
|||
const Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: CircularProgressIndicator(),
|
||||
child: CircularProgressIndicator.adaptive(),
|
||||
),
|
||||
),
|
||||
if (!preventActions)
|
||||
|
|
|
@ -53,7 +53,7 @@ class _ChangeAutobackupsPeriodModalState
|
|||
),
|
||||
const SizedBox(height: 16),
|
||||
// Select all services tile
|
||||
RadioListTile<Duration?>(
|
||||
RadioListTile<Duration?>.adaptive(
|
||||
onChanged: (final Duration? value) {
|
||||
setState(() {
|
||||
selectedPeriod = value;
|
||||
|
@ -69,7 +69,7 @@ class _ChangeAutobackupsPeriodModalState
|
|||
height: 1.0,
|
||||
),
|
||||
...autobackupPeriods.map(
|
||||
(final Duration period) => RadioListTile<Duration?>(
|
||||
(final Duration period) => RadioListTile<Duration?>.adaptive(
|
||||
onChanged: (final Duration? value) {
|
||||
setState(() {
|
||||
selectedPeriod = value;
|
||||
|
|
|
@ -232,7 +232,7 @@ class QuotaSelectionTile extends StatelessWidget {
|
|||
children: [
|
||||
// Discrete slider to select the new value
|
||||
if (value >= -1 && value <= max)
|
||||
Slider(
|
||||
Slider.adaptive(
|
||||
value: value == -1 ? max + 1 : value.toDouble(),
|
||||
min: min.toDouble(),
|
||||
max: (max + 1).toDouble(),
|
||||
|
|
|
@ -71,7 +71,7 @@ class _CreateBackupsModalState extends State<CreateBackupsModal> {
|
|||
),
|
||||
const SizedBox(height: 16),
|
||||
// Select all services tile
|
||||
CheckboxListTile(
|
||||
CheckboxListTile.adaptive(
|
||||
onChanged: (final bool? value) {
|
||||
setState(() {
|
||||
if (value ?? true) {
|
||||
|
@ -103,7 +103,7 @@ class _CreateBackupsModalState extends State<CreateBackupsModal> {
|
|||
...widget.services.map(
|
||||
(final Service service) {
|
||||
final bool busy = busyServices.contains(service.id);
|
||||
return CheckboxListTile(
|
||||
return CheckboxListTile.adaptive(
|
||||
onChanged: !busy
|
||||
? (final bool? value) {
|
||||
setState(() {
|
||||
|
|
|
@ -36,7 +36,7 @@ class _DevicesScreenState extends State<DevicesScreen> {
|
|||
if (devicesStatus is DevicesInitial) ...[
|
||||
const Center(
|
||||
heightFactor: 8,
|
||||
child: CircularProgressIndicator(),
|
||||
child: CircularProgressIndicator.adaptive(),
|
||||
),
|
||||
],
|
||||
if (devicesStatus is! DevicesInitial) ...[
|
||||
|
@ -94,7 +94,7 @@ class _DevicesInfo extends StatelessWidget {
|
|||
if (devicesStatus is DevicesDeleting) ...[
|
||||
const Center(
|
||||
heightFactor: 4,
|
||||
child: CircularProgressIndicator(),
|
||||
child: CircularProgressIndicator.adaptive(),
|
||||
),
|
||||
],
|
||||
if (devicesStatus is! DevicesDeleting)
|
||||
|
|
|
@ -27,7 +27,9 @@ class NewDeviceScreen extends StatelessWidget {
|
|||
newDeviceKey: snapshot.data.toString(),
|
||||
);
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return const Center(
|
||||
child: CircularProgressIndicator.adaptive(),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
|
|
@ -31,7 +31,7 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
|
|||
bodyPadding: const EdgeInsets.symmetric(vertical: 16),
|
||||
heroTitle: 'application_settings.title'.tr(),
|
||||
children: [
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
title: Text('application_settings.system_dark_theme_title'.tr()),
|
||||
subtitle:
|
||||
Text('application_settings.system_dark_theme_description'.tr()),
|
||||
|
@ -40,7 +40,7 @@ class _AppSettingsPageState extends State<AppSettingsPage> {
|
|||
.read<AppSettingsCubit>()
|
||||
.updateAutoDarkMode(isAutoDarkModeOn: !isSystemDarkModeOn),
|
||||
),
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
title: Text('application_settings.dark_theme_title'.tr()),
|
||||
subtitle: Text('application_settings.dark_theme_description'.tr()),
|
||||
value: Theme.of(context).brightness == Brightness.dark,
|
||||
|
|
|
@ -28,7 +28,7 @@ class _DeveloperSettingsPageState extends State<DeveloperSettingsPage> {
|
|||
heroSubtitle: 'developer_settings.subtitle'.tr(),
|
||||
children: [
|
||||
SectionTitle(title: 'developer_settings.server_setup'.tr()),
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
title: Text('developer_settings.use_staging_acme'.tr()),
|
||||
subtitle:
|
||||
Text('developer_settings.use_staging_acme_description'.tr()),
|
||||
|
@ -37,7 +37,7 @@ class _DeveloperSettingsPageState extends State<DeveloperSettingsPage> {
|
|||
() => TlsOptions.stagingAcme = value,
|
||||
),
|
||||
),
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
title: Text('developer_settings.ignore_tls'.tr()),
|
||||
subtitle: Text('developer_settings.ignore_tls_description'.tr()),
|
||||
value: !TlsOptions.verifyCertificate,
|
||||
|
@ -45,7 +45,7 @@ class _DeveloperSettingsPageState extends State<DeveloperSettingsPage> {
|
|||
() => TlsOptions.verifyCertificate = !value,
|
||||
),
|
||||
),
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
title: Text('developer_settings.allow_ssh_key_at_setup'.tr()),
|
||||
subtitle: Text(
|
||||
'developer_settings.allow_ssh_key_at_setup_description'.tr(),
|
||||
|
|
|
@ -96,7 +96,7 @@ class _ConsolePageState extends State<ConsolePage> {
|
|||
children: [
|
||||
Text('console_page.waiting'.tr()),
|
||||
const Gap(16),
|
||||
const CircularProgressIndicator(),
|
||||
const CircularProgressIndicator.adaptive(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
|||
case RecoveryKeyRefreshing():
|
||||
subtitle = 'recovery_key.key_synchronizing'.tr();
|
||||
widgets = [
|
||||
const Center(child: CircularProgressIndicator()),
|
||||
const Center(child: CircularProgressIndicator.adaptive()),
|
||||
];
|
||||
break;
|
||||
case RecoveryKeyLoaded():
|
||||
|
@ -306,7 +306,7 @@ class _RecoveryKeyConfigurationState extends State<RecoveryKeyConfiguration> {
|
|||
|
||||
return Column(
|
||||
children: [
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
value: _isAmountToggled,
|
||||
title: Text('recovery_key.key_amount_toggle'.tr()),
|
||||
activeColor: Theme.of(context).colorScheme.primary,
|
||||
|
@ -346,7 +346,7 @@ class _RecoveryKeyConfigurationState extends State<RecoveryKeyConfiguration> {
|
|||
),
|
||||
secondChild: Container(),
|
||||
),
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
value: _isExpirationToggled,
|
||||
title: Text('recovery_key.key_duedate_toggle'.tr()),
|
||||
activeColor: Theme.of(context).colorScheme.primary,
|
||||
|
|
|
@ -156,7 +156,7 @@ class _GraphLoadingCardContent extends StatelessWidget {
|
|||
@override
|
||||
Widget build(final BuildContext context) => const SizedBox(
|
||||
height: 200,
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
child: Center(child: CircularProgressIndicator.adaptive()),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class _ServerSettingsState extends State<_ServerSettings> {
|
|||
|
||||
return Column(
|
||||
children: [
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
value: allowAutoUpgrade ?? false,
|
||||
onChanged: (final switched) {
|
||||
context.read<JobsCubit>().addJob(
|
||||
|
@ -67,7 +67,7 @@ class _ServerSettingsState extends State<_ServerSettings> {
|
|||
),
|
||||
activeColor: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
value: rebootAfterUpgrade ?? false,
|
||||
onChanged: (final switched) {
|
||||
context.read<JobsCubit>().addJob(
|
||||
|
@ -113,7 +113,7 @@ class _ServerSettingsState extends State<_ServerSettings> {
|
|||
);
|
||||
},
|
||||
),
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
value: enableSsh ?? true,
|
||||
onChanged: (final switched) {
|
||||
context.read<JobsCubit>().addJob(
|
||||
|
@ -145,7 +145,7 @@ class _ServerSettingsState extends State<_ServerSettings> {
|
|||
),
|
||||
activeColor: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
SwitchListTile(
|
||||
SwitchListTile.adaptive(
|
||||
value: allowPasswordAuthentication ?? false,
|
||||
onChanged: (final switched) {
|
||||
context.read<JobsCubit>().addJob(
|
||||
|
|
|
@ -147,7 +147,7 @@ class _ServicesMigrationPageState extends State<ServicesMigrationPage> {
|
|||
padding: const EdgeInsets.all(16.0),
|
||||
children: <Widget>[
|
||||
if (widget.services.isEmpty)
|
||||
const Center(child: CircularProgressIndicator()),
|
||||
const Center(child: CircularProgressIndicator.adaptive()),
|
||||
...widget.services.map(
|
||||
(final service) => Column(
|
||||
children: [
|
||||
|
|
|
@ -71,7 +71,7 @@ class _ExtendingVolumePageState extends State<ExtendingVolumePage> {
|
|||
children: const [
|
||||
SizedBox(height: 16),
|
||||
Center(
|
||||
child: CircularProgressIndicator(),
|
||||
child: CircularProgressIndicator.adaptive(),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
|
|
@ -33,7 +33,7 @@ class _ServicePageState extends State<ServicePage> {
|
|||
hasBackButton: true,
|
||||
children: [
|
||||
Center(
|
||||
child: CircularProgressIndicator(),
|
||||
child: CircularProgressIndicator.adaptive(),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
|
|
@ -141,7 +141,7 @@ class SelectLocationPage extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return const Center(child: CircularProgressIndicator.adaptive());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
@ -479,7 +479,7 @@ class SelectTypePage extends StatelessWidget {
|
|||
InfoBox(text: 'initializing.choose_server_type_notice'.tr()),
|
||||
);
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return const Center(child: CircularProgressIndicator.adaptive());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
@ -76,7 +76,7 @@ class _RecoveryConfirmServerState extends State<RecoveryConfirmServer> {
|
|||
);
|
||||
} else {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
child: CircularProgressIndicator.adaptive(),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@ class UsersPage extends StatelessWidget {
|
|||
if (users.isEmpty) {
|
||||
if (state is UsersRefreshing) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
child: CircularProgressIndicator.adaptive(),
|
||||
);
|
||||
}
|
||||
return RefreshIndicator(
|
||||
|
|
Loading…
Reference in a new issue