Compare commits
10 Commits
master
...
add_compla
Author | SHA1 | Date |
---|---|---|
def | c0889c056e | |
dettlaff | 6e4098a196 | |
def | 4bc5dc0266 | |
dettlaff | 821d8c49a4 | |
def | 222032a728 | |
dettlaff | 71a03fee8a | |
def | 951a5c6aab | |
def | 6a6dbbf682 | |
def | 8153a0b9fc | |
dettlaff | 158356ba18 |
|
@ -584,6 +584,7 @@
|
|||
"title": "Jobs list",
|
||||
"start": "Start",
|
||||
"empty": "No jobs",
|
||||
"completed": "Jobs completed",
|
||||
"create_user": "Create user",
|
||||
"delete_user": "Delete user",
|
||||
"service_turn_off": "Turn off",
|
||||
|
@ -633,4 +634,4 @@
|
|||
"reset_onboarding_description": "Reset onboarding switch to show onboarding screen again",
|
||||
"cubit_statuses": "Cubit loading statuses"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -92,7 +92,7 @@ class JobsCubit extends Cubit<JobsState> {
|
|||
await api.apply();
|
||||
await servicesCubit.load();
|
||||
|
||||
emit(JobsStateEmpty());
|
||||
emit(JobsCompleted());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ class JobsStateLoading extends JobsState {}
|
|||
|
||||
class JobsStateEmpty extends JobsState {}
|
||||
|
||||
class JobsCompleted extends JobsState {}
|
||||
|
||||
class JobsStateWithJobs extends JobsState {
|
||||
JobsStateWithJobs(this.clientJobList);
|
||||
final List<ClientJob> clientJobList;
|
||||
|
|
|
@ -32,16 +32,38 @@ class JobsContent extends StatelessWidget {
|
|||
late List<Widget> widgets;
|
||||
final ServerInstallationState installationState =
|
||||
context.read<ServerInstallationCubit>().state;
|
||||
if (state is JobsStateEmpty) {
|
||||
widgets = [
|
||||
const SizedBox(height: 80),
|
||||
Center(
|
||||
child: Text(
|
||||
'jobs.empty'.tr(),
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
if (state is JobsStateEmpty || state is JobsCompleted) {
|
||||
if (state is JobsStateEmpty) {
|
||||
widgets = [
|
||||
const SizedBox(height: 80),
|
||||
Center(
|
||||
child: Text(
|
||||
'jobs.empty'.tr(),
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
),
|
||||
];
|
||||
];
|
||||
} else {
|
||||
widgets = [
|
||||
const SizedBox(height: 80),
|
||||
Center(
|
||||
child: Icon(
|
||||
Icons.check,
|
||||
size: 60.0,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
Center(
|
||||
child: Text(
|
||||
'jobs.completed'.tr(),
|
||||
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
if (installationState is ServerInstallationFinished) {
|
||||
widgets = [
|
||||
|
|
Loading…
Reference in New Issue