-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: impl
WelcomeScreen
according to Figma design
- add some variables to arb files & generated translation files - rename `WelcomePage` to `WelcomeScreen` & update where it is used - impl `WelcomeScreen` widgets - add `primaryLight` color to AppColors - add some welcomeScreen png to project source - add/create `CustomFilledButton`
- Loading branch information
1 parent
e43458b
commit 90f7231
Showing
12 changed files
with
194 additions
and
51 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import 'package:fluent_ui/fluent_ui.dart'; | ||
import 'package:gui/src/core/common/colors/app_colors.dart'; | ||
import 'package:gui/src/features/main/language/core/localization_extension.dart'; | ||
import 'package:pactus_gui_widgetbook/app_styles.dart'; | ||
|
||
class CustomFilledButton extends StatelessWidget { | ||
|
||
const CustomFilledButton({ | ||
super.key, | ||
required this.text, | ||
required this.onPressed, | ||
this.style, | ||
this.icon, | ||
this.autofocus = false, | ||
this.focusNode, | ||
this.padding, | ||
}); | ||
final String text; | ||
final VoidCallback onPressed; | ||
final ButtonStyle? style; | ||
final Widget? icon; | ||
final bool autofocus; | ||
final FocusNode? focusNode; | ||
final EdgeInsetsGeometry? padding; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Button( | ||
onPressed: onPressed, | ||
autofocus: autofocus, | ||
focusNode: focusNode, | ||
style: style ?? ButtonStyle( | ||
padding: WidgetStateProperty.all<EdgeInsetsDirectional?>( | ||
const EdgeInsetsDirectional.symmetric(horizontal: 24, vertical: 4), | ||
), | ||
backgroundColor: WidgetStateProperty.all(const Color(0xFF0066B4)), | ||
shape: WidgetStateProperty.all( | ||
RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(4), | ||
), | ||
), | ||
), | ||
child: Padding( | ||
padding: padding ?? | ||
const EdgeInsets.symmetric(horizontal: 12, vertical: 8), | ||
child: Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
if (icon != null) icon!, | ||
if (icon != null) const SizedBox(width: 8), | ||
Text( | ||
context.tr(text), | ||
style: InterTextStyles.bodyBold.copyWith( | ||
color: AppColors.primaryLight, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
lib/src/features/welcome/presentation/screen/welcome_page.dart
This file was deleted.
Oops, something went wrong.
69 changes: 69 additions & 0 deletions
69
lib/src/features/welcome/presentation/screen/welcome_screen.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import 'package:fluent_ui/fluent_ui.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
import 'package:gap/gap.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:gui/src/core/common/colors/app_colors.dart'; | ||
import 'package:gui/src/core/common/widgets/custom_filled_button.dart'; | ||
import 'package:gui/src/core/router/route_name.dart'; | ||
import 'package:gui/src/core/utils/assets/assets.gen.dart'; | ||
import 'package:gui/src/core/utils/gen/localization/locale_keys.dart'; | ||
import 'package:gui/src/features/main/language/core/localization_extension.dart'; | ||
import 'package:pactus_gui_widgetbook/app_styles.dart'; | ||
///to-do #68: add components for this screen after designing process complete | ||
/// by Pouria | ||
class WelcomeScreen extends StatelessWidget { | ||
const WelcomeScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return NavigationView( | ||
content: SingleChildScrollView( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
const Gap(70), | ||
Image.asset( | ||
Assets.images.welcomePic.path, | ||
width: double.infinity, | ||
height: 459, | ||
), | ||
const Gap(40), | ||
Text( | ||
context.tr(LocaleKeys.welcome_title), | ||
style: InterTextStyles.bodyBold.copyWith( | ||
color: AppColors.primaryDark, | ||
), | ||
), | ||
const Gap(16), | ||
Text( | ||
context.tr(LocaleKeys.welcome_description), | ||
style: InterTextStyles.smallRegular.copyWith( | ||
color: AppColors.primaryDark, | ||
), | ||
softWrap: true,textAlign: TextAlign.center, | ||
), | ||
const Gap(16), | ||
CustomFilledButton( | ||
text: LocaleKeys.start_button_text, | ||
onPressed: () { | ||
context.goNamed(AppRoute.initializeMode.name); | ||
}, | ||
style: ButtonStyle( | ||
padding: WidgetStateProperty.all<EdgeInsetsDirectional?>( | ||
EdgeInsetsDirectional.symmetric(horizontal: 24, vertical: 4), | ||
), | ||
backgroundColor: WidgetStateProperty.all(Color(0xFF0066B4)), | ||
shape: WidgetStateProperty.all( | ||
RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(4), | ||
), | ||
), | ||
), | ||
), | ||
const Gap(50), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |