|
|
@ -47,7 +47,22 @@ class DevicesSettingsView extends StatelessWidget {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
if (controller.thisDevice != null)
|
|
|
|
if (controller.thisDevice != null) ...[
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
|
|
|
horizontal: 16.0,
|
|
|
|
|
|
|
|
vertical: 8.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
L10n.of(context)!.thisDevice,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
color: Theme.of(context).colorScheme.primary,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
UserDeviceListItem(
|
|
|
|
UserDeviceListItem(
|
|
|
|
controller.thisDevice!,
|
|
|
|
controller.thisDevice!,
|
|
|
|
rename: controller.renameDeviceAction,
|
|
|
|
rename: controller.renameDeviceAction,
|
|
|
@ -56,24 +71,44 @@ class DevicesSettingsView extends StatelessWidget {
|
|
|
|
block: controller.blockDeviceAction,
|
|
|
|
block: controller.blockDeviceAction,
|
|
|
|
unblock: controller.unblockDeviceAction,
|
|
|
|
unblock: controller.unblockDeviceAction,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Divider(height: 1),
|
|
|
|
const Divider(
|
|
|
|
|
|
|
|
height: 16.0,
|
|
|
|
|
|
|
|
indent: 16,
|
|
|
|
|
|
|
|
endIndent: 16,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
if (controller.notThisDevice.isNotEmpty)
|
|
|
|
if (controller.notThisDevice.isNotEmpty)
|
|
|
|
ListTile(
|
|
|
|
Padding(
|
|
|
|
title: Text(
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
|
|
|
horizontal: 16.0,
|
|
|
|
|
|
|
|
vertical: 8.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
|
|
|
child: OutlinedButton.icon(
|
|
|
|
|
|
|
|
label: Text(
|
|
|
|
controller.errorDeletingDevices ??
|
|
|
|
controller.errorDeletingDevices ??
|
|
|
|
L10n.of(context)!.removeAllOtherDevices,
|
|
|
|
L10n.of(context)!.removeAllOtherDevices,
|
|
|
|
style: const TextStyle(color: Colors.red),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
trailing: controller.loadingDeletingDevices
|
|
|
|
style: OutlinedButton.styleFrom(
|
|
|
|
|
|
|
|
foregroundColor:
|
|
|
|
|
|
|
|
Theme.of(context).colorScheme.error,
|
|
|
|
|
|
|
|
side: BorderSide(
|
|
|
|
|
|
|
|
color: Theme.of(context).colorScheme.error,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
icon: controller.loadingDeletingDevices
|
|
|
|
? const CircularProgressIndicator.adaptive(
|
|
|
|
? const CircularProgressIndicator.adaptive(
|
|
|
|
strokeWidth: 2,
|
|
|
|
strokeWidth: 2,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: const Icon(Icons.delete_outline),
|
|
|
|
: const Icon(Icons.delete_outline),
|
|
|
|
onTap: controller.loadingDeletingDevices
|
|
|
|
onPressed: controller.loadingDeletingDevices
|
|
|
|
? null
|
|
|
|
? null
|
|
|
|
: () => controller.removeDevicesAction(
|
|
|
|
: () => controller.removeDevicesAction(
|
|
|
|
controller.notThisDevice,
|
|
|
|
controller.notThisDevice,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
Center(
|
|
|
|
Center(
|
|
|
@ -82,7 +117,6 @@ class DevicesSettingsView extends StatelessWidget {
|
|
|
|
child: Text(L10n.of(context)!.noOtherDevicesFound),
|
|
|
|
child: Text(L10n.of(context)!.noOtherDevicesFound),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Divider(height: 1),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|