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

This feature will add agreement view for the survey #140

Merged
merged 53 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 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
e17f861
Merge pull request #5 from djangoflow/feature/survey_app_enhance
adar2378 Sep 1, 2022
f45b8d1
added fluter_markdown and url_launcher packge
adar2378 Sep 2, 2022
4a9a747
url_launcher
adar2378 Sep 2, 2022
ac3016b
added Agreement feature/view
adar2378 Sep 2, 2022
08e9e72
SingleCheckbox -> Agreement
adar2378 Sep 2, 2022
bb00f2a
Fixed tapping text to set the agreement to true
adar2378 Sep 2, 2022
42f8c65
added result parsing for AgreementQuestionResult
adar2378 Sep 2, 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
686b8b3
Merge branch 'main' of https://github.com/QuickBirdEng/survey_kit int…
adar2378 Dec 26, 2023
e3940f4
Merge branch 'feature/survey_app_enhance' into feature/agreement
adar2378 Dec 26, 2023
1f6d7a9
refactor: add flutter generated files
adar2378 Dec 26, 2023
776d56c
refactor: update example_json with proper ids
adar2378 Dec 26, 2023
8e54ea0
refactor: update styles for agreement answer view
adar2378 Dec 26, 2023
8b8d8b7
refactor: update pubspec.lock
adar2378 Dec 26, 2023
de5dc3e
fix: remove duplicate ids for steps
adar2378 Dec 26, 2023
0dee10c
refactor: add toggling radio button state for agreement
adar2378 Dec 26, 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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin;
import io.flutter.plugins.imagepicker.ImagePickerPlugin;
import dev.flutter.plugins.integration_test.IntegrationTestPlugin;
import io.flutter.plugins.urllauncher.UrlLauncherPlugin;
import io.flutter.plugins.videoplayer.VideoPlayerPlugin;

/**
Expand All @@ -19,6 +20,7 @@ public static void registerWith(PluginRegistry registry) {
FlutterAndroidLifecyclePlugin.registerWith(registry.registrarFor("io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin"));
ImagePickerPlugin.registerWith(registry.registrarFor("io.flutter.plugins.imagepicker.ImagePickerPlugin"));
IntegrationTestPlugin.registerWith(registry.registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin"));
UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin"));
VideoPlayerPlugin.registerWith(registry.registrarFor("io.flutter.plugins.videoplayer.VideoPlayerPlugin"));
}

Expand Down
4 changes: 2 additions & 2 deletions android/local.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sdk.dir=/Users/marvin/Library/Android/sdk
flutter.sdk=/Users/marvin/flutter
sdk.dir=/Users/saifulislam/Library/Android/sdk
flutter.sdk=/Users/saifulislam/Development/flutter_sdk/flutter
28 changes: 20 additions & 8 deletions example/assets/example_json.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"id": "1"
},
"destinationStepIdentifier": {
"id": "3"
"id": "14"
}
},
{
Expand Down Expand Up @@ -61,6 +61,21 @@
"text": "Get ready for a bunch of super random questions!",
"buttonText": "Let's go!"
},
{
"stepIdentifier": {
"id": "14"
},
"type": "question",
"isOptional": true,
"title": "Before we begin",
"text": "In order to provide our services, this app will collect and use your sensitive health data based on your consent.",
"answerFormat": {
"type": "agreement",
"defaultValue": "NEGATIVE",
"markdownDescription": "Please read our [Privacy Notice](https://www.healthylongevity.cafe/privacy) carefully to ensure that you understand it fully.",
"markdownAgreementText": "By clicking this option you consent to the collection and processing of your personal data according to our [Privacy Notice](https://www.healthylongevity.cafe/privacy)"
}
},
{
"stepIdentifier": {
"id": "2"
Expand Down Expand Up @@ -199,8 +214,7 @@
"answerFormat": {
"type": "multiple",
"otherField": true,
"textChoices": [
{
"textChoices": [{
"text": "Penicillin",
"value": "Penicillin"
},
Expand Down Expand Up @@ -228,8 +242,7 @@
"answerFormat": {
"type": "multiple_auto_complete",
"otherField": true,
"textChoices": [
{
"textChoices": [{
"text": "Penicillin",
"value": "Penicillin"
},
Expand All @@ -238,8 +251,7 @@
"value": "Latex"
}
],
"suggestions": [
{
"suggestions": [{
"text": "Pet",
"value": "Pet"
},
Expand Down Expand Up @@ -303,4 +315,4 @@
}
}
]
}
}
8 changes: 7 additions & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ PODS:
- Flutter
- integration_test (0.0.1):
- Flutter
- url_launcher_ios (0.0.1):
- Flutter
- video_player_avfoundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -15,6 +17,7 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)

EXTERNAL SOURCES:
Expand All @@ -26,6 +29,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_picker_ios/ios"
integration_test:
:path: ".symlinks/plugins/integration_test/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/darwin"

Expand All @@ -34,8 +39,9 @@ SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
integration_test: 13825b8a9334a850581300559b8839134b124670
url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b
video_player_avfoundation: e9e6f9cae7d7a6d9b43519b0aab382bca60fcfd1

PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189

COCOAPODS: 1.14.3
COCOAPODS: 1.13.0
16 changes: 12 additions & 4 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ class _MyAppState extends State<MyApp> {
fontSize: 18.0,
color: Colors.black,
),
bodySmall: TextStyle(
fontSize: 14.0,
color: Colors.black,
),
titleMedium: TextStyle(
fontSize: 18.0,
color: Colors.black,
Expand Down Expand Up @@ -284,10 +288,14 @@ class _MyAppState extends State<MyApp> {
}

Future<Task> getJsonTask() async {
final String taskJson =
await rootBundle.loadString('assets/example_json.json');
final Map<String, dynamic> taskMap = json.decode(taskJson);
try {
final String taskJson =
await rootBundle.loadString('assets/example_json.json');
final Map<String, dynamic> taskMap = json.decode(taskJson);

return Task.fromJson(taskMap);
return Task.fromJson(taskMap);
} catch (e) {
rethrow;
}
}
}
4 changes: 4 additions & 0 deletions example/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
#include "generated_plugin_registrant.h"

#include <file_selector_linux/file_selector_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
}
1 change: 1 addition & 0 deletions example/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
url_launcher_linux
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
2 changes: 2 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import FlutterMacOS
import Foundation

import file_selector_macos
import url_launcher_macos
import video_player_avfoundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
}
90 changes: 89 additions & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.4.9"
args:
dependency: transitive
description:
name: args
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
url: "https://pub.dev"
source: hosted
version: "2.4.2"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -211,6 +219,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_markdown:
dependency: transitive
description:
name: flutter_markdown
sha256: "35108526a233cc0755664d445f8a6b4b61e6f8fe993b3658b80b4a26827fc196"
url: "https://pub.dev"
source: hosted
version: "0.6.18+2"
flutter_platform_widgets:
dependency: transitive
description:
Expand Down Expand Up @@ -383,6 +399,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.7.0"
markdown:
dependency: transitive
description:
name: markdown
sha256: acf35edccc0463a9d7384e437c015a3535772e09714cf60e07eeef3a15870dcd
url: "https://pub.dev"
source: hosted
version: "7.1.1"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -538,7 +562,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.2"
version: "0.2.0"
sync_http:
dependency: transitive
description:
Expand Down Expand Up @@ -571,6 +595,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.2"
url_launcher:
dependency: transitive
description:
name: url_launcher
sha256: e9aa5ea75c84cf46b3db4eea212523591211c3cf2e13099ee4ec147f54201c86
url: "https://pub.dev"
source: hosted
version: "6.2.2"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def"
url: "https://pub.dev"
source: hosted
version: "6.2.0"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3
url: "https://pub.dev"
source: hosted
version: "6.2.1"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811
url: "https://pub.dev"
source: hosted
version: "3.1.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
url: "https://pub.dev"
source: hosted
version: "3.1.0"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "7286aec002c8feecc338cc33269e96b73955ab227456e9fb2a91f7fab8a358e9"
url: "https://pub.dev"
source: hosted
version: "2.2.2"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7
url: "https://pub.dev"
source: hosted
version: "3.1.1"
uuid:
dependency: transitive
description:
Expand Down
3 changes: 3 additions & 0 deletions example/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
#include "generated_plugin_registrant.h"

#include <file_selector_windows/file_selector_windows.h>
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
1 change: 1 addition & 0 deletions example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
file_selector_windows
url_launcher_windows
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
7 changes: 7 additions & 0 deletions ios/Runner/GeneratedPluginRegistrant.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
@import integration_test;
#endif

#if __has_include(<url_launcher_ios/URLLauncherPlugin.h>)
#import <url_launcher_ios/URLLauncherPlugin.h>
#else
@import url_launcher_ios;
#endif

#if __has_include(<video_player_avfoundation/FVPVideoPlayerPlugin.h>)
#import <video_player_avfoundation/FVPVideoPlayerPlugin.h>
#else
Expand All @@ -36,6 +42,7 @@ + (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[CameraPlugin registerWithRegistrar:[registry registrarForPlugin:@"CameraPlugin"]];
[FLTImagePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTImagePickerPlugin"]];
[IntegrationTestPlugin registerWithRegistrar:[registry registrarForPlugin:@"IntegrationTestPlugin"]];
[URLLauncherPlugin registerWithRegistrar:[registry registrarForPlugin:@"URLLauncherPlugin"]];
[FVPVideoPlayerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FVPVideoPlayerPlugin"]];
}

Expand Down
24 changes: 24 additions & 0 deletions lib/src/answer_format/agreement_answer_format.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:survey_kit/src/answer_format/answer_format.dart';
import 'package:survey_kit/src/answer_format/boolean_answer_format.dart';

part 'agreement_answer_format.g.dart';

@JsonSerializable()
class AgreementAnswerFormat implements AnswerFormat {
final BooleanResult result;
final BooleanResult? defaultValue;
final String? markdownDescription;
final String? markdownAgreementText;

const AgreementAnswerFormat({
this.result = BooleanResult.NEGATIVE,
this.defaultValue,
this.markdownDescription,
this.markdownAgreementText,
}) : super();

factory AgreementAnswerFormat.fromJson(Map<String, dynamic> json) =>
_$AgreementAnswerFormatFromJson(json);
Map<String, dynamic> toJson() => _$AgreementAnswerFormatToJson(this);
}
Loading
Loading