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
|
|
|
|
Widget build(final BuildContext context) {
|
2022-08-24 05:35:49 +00:00
|
|
|
int a = 0;
|
2022-08-03 02:25:33 +00:00
|
|
|
return BrandHeroScreen(
|
|
|
|
hasBackButton: true,
|
2022-08-24 05:35:49 +00:00
|
|
|
heroTitle: 'providers.storage.data_migration_title'.tr(),
|
2022-08-03 02:25:33 +00:00
|
|
|
children: [
|
2022-08-24 05:35:49 +00:00
|
|
|
...widget.diskStatus.diskVolumes
|
|
|
|
.map(
|
|
|
|
(final volume) => Column(
|
|
|
|
children: [
|
|
|
|
ServerStorageListItem(
|
|
|
|
volume: volume,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
.toList(),
|
2022-08-03 02:25:33 +00:00
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|