Skip to content

Commit

Permalink
feat(app): seperate audio content
Browse files Browse the repository at this point in the history
  • Loading branch information
Numoy committed Apr 5, 2024
1 parent d17c517 commit e04924c
Show file tree
Hide file tree
Showing 25 changed files with 308 additions and 98 deletions.
4 changes: 3 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import 'dart:developer';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart' hide Step;
import 'package:flutter/services.dart';
import 'package:survey_kit/survey_kit.dart';
import 'package:survey_kit/survey_kit.dart' hide VideoContent, AudioContent;
import 'package:survey_kit_audio/audio_content.dart';
import 'package:survey_kit_video/survey_kit_video.dart';
import 'package:surveykit_example/app_bar_example.dart';

void main() {
Expand Down
7 changes: 7 additions & 0 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0-dev.5"
survey_kit_audio:
dependency: "direct main"
description:
path: "../packages/survey_kit_audio"
relative: true
source: path
version: "0.0.1"
survey_kit_video:
dependency: "direct main"
description:
Expand Down
3 changes: 3 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ dependencies:
sdk: flutter

survey_kit: ^1.0.0-dev.5
survey_kit_audio:
path: ../packages/survey_kit_audio
survey_kit_video:
path: ../packages/survey_kit_video




dev_dependencies:
flutter_test:
sdk: flutter
Expand Down
3 changes: 0 additions & 3 deletions packages/survey_kit/lib/src/model/content/content.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:survey_kit/src/model/content/audio_content.dart';
import 'package:survey_kit/src/model/content/lottie_content.dart';
import 'package:survey_kit/src/model/content/markdown_content.dart';
import 'package:survey_kit/src/model/content/text_content.dart';
Expand All @@ -22,8 +21,6 @@ abstract class Content {
assert(type != null, 'type is required');

switch (type) {
case 'audio':
return AudioContent.fromJson(json);
case 'text':
return TextContent.fromJson(json);
case 'markdown':
Expand Down
84 changes: 0 additions & 84 deletions packages/survey_kit/lib/src/widget/web_video_player.dart

This file was deleted.

1 change: 0 additions & 1 deletion packages/survey_kit/lib/survey_kit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export 'src/model/answer/text_answer_format.dart';
export 'src/model/answer/text_choice.dart';
export 'src/model/answer/time_answer_format.dart';
//Content
export 'src/model/content/audio_content.dart';
export 'src/model/content/content.dart';
export 'src/model/content/image_content.dart';
export 'src/model/content/lottie_content.dart';
Expand Down
34 changes: 34 additions & 0 deletions packages/survey_kit_audio/.flutter-plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is a generated file; do not edit or check into version control.
audio_session=/Users/marvin/.pub-cache/hosted/pub.dev/audio_session-0.1.19/
file_selector_linux=/Users/marvin/.pub-cache/hosted/pub.dev/file_selector_linux-0.9.2+1/
file_selector_macos=/Users/marvin/.pub-cache/hosted/pub.dev/file_selector_macos-0.9.3+3/
file_selector_windows=/Users/marvin/.pub-cache/hosted/pub.dev/file_selector_windows-0.9.3+1/
flutter_plugin_android_lifecycle=/Users/marvin/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.17/
image_picker=/Users/marvin/.pub-cache/hosted/pub.dev/image_picker-1.0.7/
image_picker_android=/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_android-0.8.9+5/
image_picker_for_web=/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_for_web-3.0.3/
image_picker_ios=/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.9+2/
image_picker_linux=/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1/
image_picker_macos=/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+1/
image_picker_windows=/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1/
just_audio=/Users/marvin/.pub-cache/hosted/pub.dev/just_audio-0.9.37/
just_audio_web=/Users/marvin/.pub-cache/hosted/pub.dev/just_audio_web-0.4.9/
package_info_plus=/Users/marvin/.pub-cache/hosted/pub.dev/package_info_plus-6.0.0/
path_provider=/Users/marvin/.pub-cache/hosted/pub.dev/path_provider-2.1.2/
path_provider_android=/Users/marvin/.pub-cache/hosted/pub.dev/path_provider_android-2.2.2/
path_provider_foundation=/Users/marvin/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/
path_provider_linux=/Users/marvin/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/marvin/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/
survey_kit=/Users/marvin/.pub-cache/hosted/pub.dev/survey_kit-1.0.0-dev.5/
url_launcher=/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher-6.2.5/
url_launcher_android=/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.0/
url_launcher_ios=/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/
url_launcher_linux=/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/
url_launcher_macos=/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/
url_launcher_web=/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.0/
url_launcher_windows=/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/
video_player=/Users/marvin/.pub-cache/hosted/pub.dev/video_player-2.8.4/
video_player_android=/Users/marvin/.pub-cache/hosted/pub.dev/video_player_android-2.4.12/
video_player_avfoundation=/Users/marvin/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.5.6/
video_player_web=/Users/marvin/.pub-cache/hosted/pub.dev/video_player_web-2.3.0/
wakelock_plus=/Users/marvin/.pub-cache/hosted/pub.dev/wakelock_plus-1.2.2/
1 change: 1 addition & 0 deletions packages/survey_kit_audio/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"audio_session","path":"/Users/marvin/.pub-cache/hosted/pub.dev/audio_session-0.1.19/","native_build":true,"dependencies":[]},{"name":"image_picker_ios","path":"/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.9+2/","native_build":true,"dependencies":[]},{"name":"just_audio","path":"/Users/marvin/.pub-cache/hosted/pub.dev/just_audio-0.9.37/","native_build":true,"dependencies":["audio_session"]},{"name":"package_info_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/package_info_plus-6.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/marvin/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"survey_kit","path":"/Users/marvin/.pub-cache/hosted/pub.dev/survey_kit-1.0.0-dev.5/","native_build":true,"dependencies":["just_audio"]},{"name":"url_launcher_ios","path":"/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]},{"name":"video_player_avfoundation","path":"/Users/marvin/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.5.6/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"wakelock_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/wakelock_plus-1.2.2/","native_build":true,"dependencies":["package_info_plus"]}],"android":[{"name":"audio_session","path":"/Users/marvin/.pub-cache/hosted/pub.dev/audio_session-0.1.19/","native_build":true,"dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/marvin/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.17/","native_build":true,"dependencies":[]},{"name":"image_picker_android","path":"/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_android-0.8.9+5/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"just_audio","path":"/Users/marvin/.pub-cache/hosted/pub.dev/just_audio-0.9.37/","native_build":true,"dependencies":["audio_session"]},{"name":"package_info_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/package_info_plus-6.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/marvin/.pub-cache/hosted/pub.dev/path_provider_android-2.2.2/","native_build":true,"dependencies":[]},{"name":"survey_kit","path":"/Users/marvin/.pub-cache/hosted/pub.dev/survey_kit-1.0.0-dev.5/","native_build":true,"dependencies":["just_audio"]},{"name":"url_launcher_android","path":"/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.0/","native_build":true,"dependencies":[]},{"name":"video_player_android","path":"/Users/marvin/.pub-cache/hosted/pub.dev/video_player_android-2.4.12/","native_build":true,"dependencies":[]},{"name":"wakelock_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/wakelock_plus-1.2.2/","native_build":true,"dependencies":["package_info_plus"]}],"macos":[{"name":"audio_session","path":"/Users/marvin/.pub-cache/hosted/pub.dev/audio_session-0.1.19/","native_build":true,"dependencies":[]},{"name":"file_selector_macos","path":"/Users/marvin/.pub-cache/hosted/pub.dev/file_selector_macos-0.9.3+3/","native_build":true,"dependencies":[]},{"name":"image_picker_macos","path":"/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+1/","native_build":false,"dependencies":["file_selector_macos"]},{"name":"just_audio","path":"/Users/marvin/.pub-cache/hosted/pub.dev/just_audio-0.9.37/","native_build":true,"dependencies":["audio_session"]},{"name":"package_info_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/package_info_plus-6.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/marvin/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]},{"name":"video_player_avfoundation","path":"/Users/marvin/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.5.6/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"wakelock_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/wakelock_plus-1.2.2/","native_build":true,"dependencies":["package_info_plus"]}],"linux":[{"name":"file_selector_linux","path":"/Users/marvin/.pub-cache/hosted/pub.dev/file_selector_linux-0.9.2+1/","native_build":true,"dependencies":[]},{"name":"image_picker_linux","path":"/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1/","native_build":false,"dependencies":["file_selector_linux"]},{"name":"package_info_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/package_info_plus-6.0.0/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/marvin/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"url_launcher_linux","path":"/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]},{"name":"wakelock_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/wakelock_plus-1.2.2/","native_build":false,"dependencies":["package_info_plus"]}],"windows":[{"name":"file_selector_windows","path":"/Users/marvin/.pub-cache/hosted/pub.dev/file_selector_windows-0.9.3+1/","native_build":true,"dependencies":[]},{"name":"image_picker_windows","path":"/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1/","native_build":false,"dependencies":["file_selector_windows"]},{"name":"package_info_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/package_info_plus-6.0.0/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/marvin/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"url_launcher_windows","path":"/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]},{"name":"wakelock_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/wakelock_plus-1.2.2/","native_build":false,"dependencies":["package_info_plus"]}],"web":[{"name":"audio_session","path":"/Users/marvin/.pub-cache/hosted/pub.dev/audio_session-0.1.19/","dependencies":[]},{"name":"image_picker_for_web","path":"/Users/marvin/.pub-cache/hosted/pub.dev/image_picker_for_web-3.0.3/","dependencies":[]},{"name":"just_audio_web","path":"/Users/marvin/.pub-cache/hosted/pub.dev/just_audio_web-0.4.9/","dependencies":[]},{"name":"package_info_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/package_info_plus-6.0.0/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/marvin/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.0/","dependencies":[]},{"name":"video_player_web","path":"/Users/marvin/.pub-cache/hosted/pub.dev/video_player_web-2.3.0/","dependencies":[]},{"name":"wakelock_plus","path":"/Users/marvin/.pub-cache/hosted/pub.dev/wakelock_plus-1.2.2/","dependencies":["package_info_plus"]}]},"dependencyGraph":[{"name":"audio_session","dependencies":[]},{"name":"file_selector_linux","dependencies":[]},{"name":"file_selector_macos","dependencies":[]},{"name":"file_selector_windows","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"image_picker","dependencies":["image_picker_android","image_picker_for_web","image_picker_ios","image_picker_linux","image_picker_macos","image_picker_windows"]},{"name":"image_picker_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"image_picker_ios","dependencies":[]},{"name":"image_picker_linux","dependencies":["file_selector_linux"]},{"name":"image_picker_macos","dependencies":["file_selector_macos"]},{"name":"image_picker_windows","dependencies":["file_selector_windows"]},{"name":"just_audio","dependencies":["just_audio_web","audio_session","path_provider"]},{"name":"just_audio_web","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"survey_kit","dependencies":["image_picker","just_audio","url_launcher","video_player"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"video_player","dependencies":["video_player_android","video_player_avfoundation","video_player_web"]},{"name":"video_player_android","dependencies":[]},{"name":"video_player_avfoundation","dependencies":[]},{"name":"video_player_web","dependencies":[]},{"name":"wakelock_plus","dependencies":["package_info_plus"]}],"date_created":"2024-04-05 08:52:55.943496","version":"3.19.0"}
29 changes: 29 additions & 0 deletions packages/survey_kit_audio/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
build/
10 changes: 10 additions & 0 deletions packages/survey_kit_audio/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "bae5e49bc2a867403c43b2aae2de8f8c33b037e4"
channel: "stable"

project_type: package
3 changes: 3 additions & 0 deletions packages/survey_kit_audio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* TODO: Describe initial release.
1 change: 1 addition & 0 deletions packages/survey_kit_audio/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO: Add your license here.
39 changes: 39 additions & 0 deletions packages/survey_kit_audio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->

TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.

## Features

TODO: List what your package can do. Maybe include images, gifs, or videos.

## Getting started

TODO: List prerequisites and provide or point to information on how to
start using the package.

## Usage

TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.

```dart
const like = 'sample';
```

## Additional information

TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.
4 changes: 4 additions & 0 deletions packages/survey_kit_audio/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:survey_kit/src/model/content/content.dart';
import 'package:survey_kit/src/view/widget/content/audio_widget.dart';
import 'package:survey_kit/survey_kit.dart';
import 'package:survey_kit_audio/audio_widget.dart';

part 'audio_content.g.dart';

Expand Down
Loading

0 comments on commit e04924c

Please sign in to comment.