2022-08-03 02:25:33 +00:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2022-08-24 05:35:49 +00:00
|
|
|
import 'package:selfprivacy/logic/models/disk_size.dart';
|
2022-08-03 02:25:33 +00:00
|
|
|
import 'package:selfprivacy/ui/components/brand_hero_screen/brand_hero_screen.dart';
|
|
|
|
import 'package:selfprivacy/ui/pages/server_storage/disk_status.dart';
|
2022-08-24 05:35:49 +00:00
|
|
|
import 'package:selfprivacy/ui/pages/server_storage/server_storage_list_item.dart';
|
2022-08-03 02:25:33 +00:00
|
|
|
|
2022-08-24 05:35:49 +00:00
|
|
|
class DataMigrationPage extends StatefulWidget {
|
|
|
|
const DataMigrationPage({
|
|
|
|
required this.diskVolumeToResize,
|
|
|
|
required this.diskStatus,
|
|
|
|
required this.resizeTarget,
|
|
|
|
final super.key,
|
|
|
|
});
|
2022-08-03 02:25:33 +00:00
|
|
|
|
2022-08-24 05:35:49 +00:00
|
|
|
final DiskVolume diskVolumeToResize;
|
2022-08-03 02:25:33 +00:00
|
|
|
final DiskStatus diskStatus;
|
2022-08-24 05:35:49 +00:00
|
|
|
final DiskSize resizeTarget;
|
2022-08-03 02:25:33 +00:00
|
|
|
|
|
|
|
@override
|
2022-08-24 05:35:49 +00:00
|
|
|
State<DataMigrationPage> createState() => _DataMigrationPageState();
|
2022-08-03 02:25:33 +00:00
|
|
|
}
|
|
|
|
|
2022-08-24 05:35:49 +00:00
|
|
|
class _DataMigrationPageState extends State<DataMigrationPage> {
|
2022-08-03 02:25:33 +00:00
|
|
|
@override
|
2022-08-29 18:18:07 +00:00
|
|
|
Widget build(final BuildContext context) => BrandHeroScreen(
|
|
|
|
hasBackButton: true,
|
|
|
|
heroTitle: 'providers.storage.data_migration_title'.tr(),
|
|
|
|
children: [
|
|
|
|
...widget.diskStatus.diskVolumes
|
|
|
|
.map(
|
|
|
|
(final volume) => Column(
|
|
|
|
children: [
|
|
|
|
ServerStorageListItem(
|
|
|
|
volume: volume,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
.toList(),
|
|
|
|
],
|
|
|
|
);
|
2022-08-03 02:25:33 +00:00
|
|
|
}
|