Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/on boarding #1473

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bd21f62
refactor: select the language and use next
YassinNouh21 Dec 9, 2024
f49ca75
refactor: select the mode either it is portrait or landscape
YassinNouh21 Dec 9, 2024
130653e
refactor: adjust the order of pages of onboarding in kiosk mode
YassinNouh21 Dec 9, 2024
8818898
fix: language screen in settings is not poping up
YassinNouh21 Dec 9, 2024
a8e4ad0
fix: the pop the screen of the orientation at the setting screen
YassinNouh21 Dec 9, 2024
77f1be8
refactor: remove the skip button in the kiosk mode
YassinNouh21 Dec 9, 2024
0d77532
refactor: OnBoardingScreenType widget to match the style of the Orien…
YassinNouh21 Dec 9, 2024
059b527
refactor: the onboarding of the announcement
YassinNouh21 Dec 9, 2024
81beeb4
refactor: change the label of the button from `next` into `finish`
YassinNouh21 Dec 9, 2024
9744a77
refactor: add `enableNextButton` for the screen type
YassinNouh21 Dec 9, 2024
87d5664
feat(onboarding): improve keyboard navigation for language selection
YassinNouh21 Dec 10, 2024
866c804
refactor: add `Finish` string into the localization
YassinNouh21 Dec 10, 2024
f631812
fix: language selection for nodes
YassinNouh21 Dec 10, 2024
e0af39a
refactor: Adjust font styling across onboarding and icon button widgets
YassinNouh21 Dec 10, 2024
0de7ded
refactor: OrientationWidget to add appropriate text styles for bette…
YassinNouh21 Dec 10, 2024
5b63deb
refactor: improve onboarding UI layout and typography bottom navigation
YassinNouh21 Dec 10, 2024
251ca11
fix: localization alignment
YassinNouh21 Dec 10, 2024
8e6a5e4
refactor: remove the onboarding screen unused comments. refactor the …
YassinNouh21 Dec 10, 2024
01e4d48
refactor: update the announcement mode widget to match the layout an…
YassinNouh21 Dec 10, 2024
02ac007
fix: sizing the font in arabic in announcement doe and screen type
YassinNouh21 Dec 10, 2024
40d9d52
Merge branch 'release-1.18.0' into refactor/on-boarding
YassinNouh21 Dec 10, 2024
7a7823f
feat: add modify the selection of the mosque with focus node
YassinNouh21 Dec 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -409,5 +409,6 @@
"example": "2.0"
}
}
}
},
"finish": "Finish"
}
103 changes: 62 additions & 41 deletions lib/src/pages/LanguageScreen.dart
Original file line number Diff line number Diff line change
@@ -1,74 +1,95 @@
import 'package:flutter/material.dart';
import 'package:mawaqit/const/resource.dart';
import 'package:mawaqit/src/widgets/ScreenWithAnimation.dart';

import '../helpers/AppRouter.dart';
import 'onBoarding/widgets/onboarding_language_selector.dart';
import 'onBoarding/widgets/language_selector_widget.dart';

class LanguageScreen extends StatelessWidget {
// Private constructor with all attributes
const LanguageScreen._({
Key? key,
required this.isOnboarding,
this.onSelect,
this.languages,
this.title = "",
this.description = "",
this.isIconActivated = true,
this.isSelected,
}) : super(key: key);

final void Function(String)? onSelect;
final List<String>? languages; // List of language codes
final List<String>? languages;
final bool? isIconActivated;
final String? title;
final String? description;
String selectedLanguage = "";

final bool isOnboarding;
final bool Function(String)? isSelected;

LanguageScreen({
// Factory for normal mode
factory LanguageScreen({
Key? key,
this.onSelect,
this.languages, // List of languages
this.title = "",
this.description = "", // Description of the screen
this.isIconActivated = true,
this.isSelected,
}) : super(key: key);
void Function(String)? onSelect,
List<String>? languages,
String title = "",
String description = "",
bool isIconActivated = true,
bool Function(String)? isSelected,
}) {
return LanguageScreen._(
key: key,
isOnboarding: false,
onSelect: onSelect,
languages: languages,
title: title,
description: description,
isIconActivated: isIconActivated,
isSelected: isSelected,
);
}

// Factory for onboarding mode
factory LanguageScreen.onboarding({
Key? key,
void Function(String)? onSelect,
List<String>? languages,
String title = "",
String description = "",
bool isIconActivated = true,
bool Function(String)? isSelected,
}) {
return LanguageScreen._(
key: key,
isOnboarding: true,
onSelect: onSelect,
languages: languages,
title: title,
description: description,
isIconActivated: isIconActivated,
isSelected: isSelected,
);
}

@override
Widget build(BuildContext context) {
return ScreenWithAnimationWidget(
animation: R.ASSETS_ANIMATIONS_LOTTIE_LANGUAGE_JSON,
// child: OnBoardingLanguageSelector(onSelect: AppRouter.pop)
child: title!.isNotEmpty
? LanguageSelector(
onSelect: (selectedLang) {
onSelect?.call(selectedLang); // Call the passed onSelect with the selected language
onSelect?.call(selectedLang);
},
isSelected: isSelected!,
languages: languages!,
title: title!,
description: description!,
isIconActivated: isIconActivated!,
)
: OnBoardingLanguageSelector(onSelect: AppRouter.pop),
: isOnboarding
? OnBoardingLanguageSelector.onboarding()
: OnBoardingLanguageSelector.normal(
onNext: AppRouter.pop,
),
);
}
// AppBar _renderAppBar(context) {
// final settingsManager = Provider.of<SettingsManager>(context);
// final settings = settingsManager.settings;
//
// return AppBar(
// title: Text(
// S.of(context).languages,
// style: TextStyle(color: Colors.white, fontSize: 22.0, fontWeight: FontWeight.bold),
// ),
// flexibleSpace: Container(
// decoration: BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.centerLeft,
// end: Alignment.centerRight,
// colors: <Color>[
// Theme.of(context).brightness == Brightness.light
// ? HexColor(settings.firstColor)
// : Theme.of(context).primaryColor,
// Theme.of(context).brightness == Brightness.light
// ? HexColor(settings.secondColor)
// : Theme.of(context).primaryColor,
// ],
// ),
// ),
// ));
// }
}
2 changes: 1 addition & 1 deletion lib/src/pages/SettingScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class _SettingScreenState extends ConsumerState<SettingScreen> {
onTap: () => AppRouter.push(ScreenWithAnimationWidget(
animation: 'welcome',
child: OnBoardingOrientationWidget(
onSelect: () => Navigator.pop(context),
onNext: AppRouter.pop,
),
)),
),
Expand Down
Loading