selfprivacy.org.app/lib/ui/pages/onboarding/views/onboarding_first_view.dart
aliaksei tratseuski dd81053f42 refactor(UI): Rewrite onboarding page
rewrote OnboardingPage:
* decomposed into separate widgets
* now content stays centered on wide screens (set so width won't expand further than 480px)
* pageController is now properly disposed
* added some more code changes to
    * main (error widget builder)
    * brand_header (centerTitle instead of empty actions list)
    * console_page (listener callback fix, used gaps instead of SizedBox'es, added keys to list items)
    * service_page (just cleaner build method)
	* removed some dead code

Co-authored-by: Aliaksei Tratseuski <aliaksei.tratseuski@gmail.com>
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/pulls/444
Co-authored-by: aliaksei tratseuski <misterfourtytwo@noreply.git.selfprivacy.org>
Co-committed-by: aliaksei tratseuski <misterfourtytwo@noreply.git.selfprivacy.org>
2024-02-08 13:59:52 +02:00

51 lines
1.4 KiB
Dart

import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:selfprivacy/ui/pages/onboarding/views/onboarding_view.dart';
class OnboardingFirstView extends StatelessWidget {
const OnboardingFirstView({
required this.onProceed,
super.key,
});
final VoidCallback onProceed;
String assetName({
required final BuildContext context,
required final String path,
required final String fileName,
required final String fileExtension,
}) {
final String suffix =
Theme.of(context).brightness == Brightness.dark ? '-dark' : '-light';
return '$path/$fileName$suffix.$fileExtension';
}
@override
Widget build(final BuildContext context) => OnboardingView(
onProceed: onProceed,
children: [
Text(
'onboarding.page1_title'.tr(),
style: Theme.of(context).textTheme.headlineSmall,
),
const Gap(15),
Text(
'onboarding.page1_text'.tr(),
style: Theme.of(context).textTheme.bodyMedium,
),
const Gap(30),
Image.asset(
assetName(
context: context,
path: 'assets/images/onboarding',
fileName: 'onboarding1',
fileExtension: 'png',
),
fit: BoxFit.fitWidth,
),
],
);
}