Files
umbrix/lib/features/home/widget/empty_profiles_home_body.dart

56 lines
1.6 KiB
Dart
Raw Normal View History

2024-02-15 15:23:02 +03:30
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
2023-07-06 17:18:41 +03:30
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
2023-12-01 12:56:24 +03:30
import 'package:hiddify/core/localization/translations.dart';
2023-07-06 17:18:41 +03:30
import 'package:hiddify/core/router/router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
class EmptyProfilesHomeBody extends HookConsumerWidget {
const EmptyProfilesHomeBody({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final t = ref.watch(translationsProvider);
return SliverFillRemaining(
hasScrollBody: false,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
2023-09-07 01:56:59 +03:30
Text(t.home.emptyProfilesMsg),
2023-07-06 17:18:41 +03:30
const Gap(16),
OutlinedButton.icon(
onPressed: () => const AddProfileRoute().push(context),
2024-02-15 15:23:02 +03:30
icon: const Icon(FluentIcons.add_24_regular),
2023-09-07 01:56:59 +03:30
label: Text(t.profile.add.buttonText),
2023-09-06 21:03:43 +03:30
),
2023-07-06 17:18:41 +03:30
],
),
);
}
}
class EmptyActiveProfileHomeBody extends HookConsumerWidget {
const EmptyActiveProfileHomeBody({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final t = ref.watch(translationsProvider);
return SliverFillRemaining(
hasScrollBody: false,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
2023-09-07 01:56:59 +03:30
Text(t.home.noActiveProfileMsg),
2023-07-06 17:18:41 +03:30
const Gap(16),
OutlinedButton(
2023-11-26 21:59:57 +03:30
onPressed: () => const ProfilesOverviewRoute().push(context),
2023-09-07 01:56:59 +03:30
child: Text(t.profile.overviewPageTitle),
2023-09-06 21:03:43 +03:30
),
2023-07-06 17:18:41 +03:30
],
),
);
}
}