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

Make cancel button configurable in the AppBar #139

Merged
merged 38 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
cc4ac09
Merge pull request #1 from QuickBirdEng/main
adar2378 Aug 18, 2022
7b7a200
added missing MultipleChoiceQuestionResult toJson
adar2378 Aug 18, 2022
67e0278
Updated PlatformAppbar with default AppBar widget
adar2378 Aug 24, 2022
239ef5c
Updated IconButton -> BackButton
adar2378 Aug 24, 2022
80dfc30
Added other field in Multiple choice answers
adar2378 Aug 29, 2022
8f074cc
added Multiple choice autocomplete
adar2378 Aug 29, 2022
97fd6d7
Customized the builder
adar2378 Aug 29, 2022
7c5c2e1
added comment
adar2378 Aug 29, 2022
2d50cf5
DRY refactor
adar2378 Aug 29, 2022
f73f23d
Updated other field label behavior
adar2378 Aug 29, 2022
f49e742
Added clear button and added tick mark check on dropdown
adar2378 Aug 29, 2022
83d0ba6
Merge pull request #2 from djangoflow/feature/enhanced_steps
adar2378 Aug 29, 2022
264a6b5
Updated example
adar2378 Aug 29, 2022
ade4b04
Merge branch 'feature/enhanced_steps'
adar2378 Aug 29, 2022
6662567
Removed comment
adar2378 Aug 29, 2022
3d93db9
json file updated
adar2378 Aug 31, 2022
e4ccbda
added default value for text question
adar2378 Aug 31, 2022
71c55e2
Boolean Answer defaultValue
adar2378 Aug 31, 2022
f0b3310
put back actual example_json.json
adar2378 Aug 31, 2022
4d0d488
Merge pull request #3 from djangoflow/default_values
adar2378 Aug 31, 2022
2e89cde
Fixed consistent focus in non textfield views
adar2378 Sep 1, 2022
a429251
Merge pull request #4 from djangoflow/fix/keyboard_showing
adar2378 Sep 1, 2022
b9b9ab9
added showCancelButton flag
adar2378 Sep 1, 2022
da36730
Merge remote-tracking branch 'upstream/main' into feature/enhanced_steps
adar2378 Nov 9, 2022
84bd71f
Merge branch 'feature/enhanced_steps' of https://github.com/djangoflo…
adar2378 Nov 9, 2022
aeb108b
Merge branch 'default_values' of https://github.com/djangoflow/survey…
adar2378 Nov 9, 2022
2e37be1
Merge remote-tracking branch 'upstream/main' into default_values
adar2378 Oct 16, 2023
d9e67c3
update build_runner dependency
adar2378 Oct 16, 2023
ff7a573
update flutter changes for android directory
adar2378 Oct 16, 2023
fae9ebe
update flutter changes for ios directory
adar2378 Oct 16, 2023
5d97aba
update example pubspec.lock
adar2378 Oct 16, 2023
27974be
add missing JsonSerializable annotation for ImageQuestionResult
adar2378 Oct 16, 2023
222952e
re-run build_runner latest verson
adar2378 Oct 16, 2023
a5b8608
remove duplicate imports
adar2378 Oct 16, 2023
9a7aeb0
Merge branch 'default_values' into fix/keyboard_showing
adar2378 Nov 29, 2023
61fea8e
Merge branch 'main' of https://github.com/QuickBirdEng/survey_kit int…
adar2378 Nov 29, 2023
f6ba5e7
Merge branch 'main' of https://github.com/QuickBirdEng/survey_kit int…
adar2378 Dec 4, 2023
88f99a3
Merge branch 'fix/keyboard_showing' of https://github.com/djangoflow/…
adar2378 Dec 4, 2023
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
2 changes: 2 additions & 0 deletions lib/src/configuration/app_bar_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ class AppBarConfiguration {
final bool? canBack;
final bool? showProgress;
final Widget? trailing;
final bool? showCancelButton;

const AppBarConfiguration({
required this.canBack,
required this.showProgress,
this.showCancelButton = true,
this.leading,
this.trailing,
});
Expand Down
21 changes: 11 additions & 10 deletions lib/src/views/widget/survey_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,19 @@ class SurveyAppBar extends StatelessWidget {
: Container(),
title: _showProgress ? SurveyProgress() : SizedBox.shrink(),
actions: [
TextButton(
child: appBarConfiguration.trailing ??
Text(
context.read<Map<String, String>?>()?['cancel'] ?? 'Cancel',
style: TextStyle(
color: Theme.of(context).primaryColor,
if (appBarConfiguration.showCancelButton ?? true)
TextButton(
child: appBarConfiguration.trailing ??
Text(
context.read<Map<String, String>?>()?['cancel'] ?? 'Cancel',
style: TextStyle(
color: Theme.of(context).primaryColor,
),
),
),
onPressed: () => surveyController.closeSurvey(
context: context,
onPressed: () => surveyController.closeSurvey(
context: context,
),
),
),
],
);
}
Expand Down
Loading