Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 0 additions & 21 deletions .github/workflows/.github-actions.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish to pub.dev

on:
release:
types: [published]

jobs:
publish:
permissions:
id-token: write # Required for OIDC authentication
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: subosito/flutter-action@v2
with:
channel: 'stable'

# Used to establish OIDC trust with pub.dev
- uses: dart-lang/setup-dart@v1

- name: Install Melos
run: dart pub global activate melos

- name: Bootstrap Workspace
run: melos bootstrap

- name: Publish Packages
run: melos publish -y --no-dry-run
38 changes: 38 additions & 0 deletions .github/workflows/survey_kit_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Install Melos
run: dart pub global activate melos

- name: Resolve Root Dependencies
run: dart pub get

- name: Debug Environment
run: |
ls -la
melos --version

- name: Bootstrap Workspace
run: melos bootstrap

- name: Analyze
run: melos exec -- flutter analyze .

- name: Run Tests
run: melos exec --dir-exists="test" -- flutter test
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# 2.0.0

- Infra: Added `melos` for monorepo management.
- **BREAKING**: Moved video player to a separate package (`survey_kit_video`)
- **BREAKING**: Moved audio player to a separate package (`survey_kit_audio`)
- **BREAKING**: Moved lottie support to a separate package (`survey_kit_lottie`)
- **BREAKING**: Removed `localizations` parameter in `SurveyKit`. Using generated localizations now.
- **FEATURE**: Migrated to `.arb` files and `flutter_localizations`.
- See [MIGRATION.md](MIGRATION.md) for details on how to upgrade.

- FIX: Fixed DateTime timezone handling in CustomDateTimeConverter to preserve UTC timestamps during serialization
- FIX: Added missing JSON serialization methods for TimeResult class
- FIX: Updated test infrastructure with deterministic Step IDs to ensure reliable test execution
- CHORE: Updated Android Gradle Plugin to 8.1.4 and Gradle to 8.4 for SDK 35 compatibility
- CHORE: Updated json_annotation dependency to 4.9.0 for better compatibility


# 1.0.3

- CHORE: Removed depracted lint `package_api_docs`
Expand Down
56 changes: 56 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Migration Guide 1.0 -> 2.0

With the release of version 2.0.0, we have modularized `survey_kit` to allow for a more lightweight core package. This guide outlines the changes and how to migrate your existing project.

## Breaking Changes

### Modularization of Audio and Video Steps

The audio and video steps have been moved to their own packages: `survey_kit_audio` and `survey_kit_video`. This reduces the size of the core package and allows you to include only the dependencies you need. Same goes for `survey_kit_lottie`.

#### Action Required:

If you are using `AudioContent` or `VideoContent`, you need to add the respective packages to your `pubspec.yaml`.

```yaml
dependencies:
survey_kit: ^2.0.0
# Add these if you use audio or video steps
survey_kit_audio: ^2.0.0
survey_kit_video: ^2.0.0
survey_kit_lottie: ^2.0.0
```

### Imports

You will need to update your imports to include the new packages where necessary.

**Before:**
```dart
import 'package:survey_kit/survey_kit.dart';
```

**After:**
```dart
import 'package:survey_kit/survey_kit.dart';
// Add if using audio features
import 'package:survey_kit_audio/survey_kit_audio.dart';
// Add if using video features
import 'package:survey_kit_video/survey_kit_video.dart';
// Add if using lottie features
import 'package:survey_kit_lottie/survey_kit_lottie.dart';
```

## Other Changes

- **Dependencies Updated:** We have updated internal dependencies to be compatible with the latest Flutter versions (3.19.0+).
- **Fixes:** Various bug fixes and improvements in the core logic.

## Summary

1. Update `survey_kit` to `^2.0.0`.
2. Add `survey_kit_audio` or `survey_kit_video` if you use those features.
3. Add `survey_kit_lottie` if you use those features.
3. Update imports in your Dart files.

If you encounter any issues during migration, please open an issue on our [GitHub repository](https://github.com/quickbirdstudios/survey_kit/issues).
44 changes: 32 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ This is an early version and work in progress. Do not hesitate to give feedback,
- [Examples](#examples)
- [Flow](#flow)
- [Screenshots](#screenshots)
- [πŸ“š Overview: Creating Research Surveys](#-overview-creating-research-surveys)
- [What SurveyKit does for you](#what-surveykit-does-for-you)
- [What SurveyKit does not (yet) do for you](#what-surveykit-does-not-yet-do-for-you)
- [πŸ“š Overview: Creating Research Surveys](#-overview-creating-research-surveys)
- [What SurveyKit does for you](#what-surveykit-does-for-you)
- [What SurveyKit does not (yet) do for you](#what-surveykit-does-not-yet-do-for-you)
- [πŸƒ Setup](#-setup)
- [1. Add the dependecy](#1-add-the-dependecy)
- [2. Install it](#2-install-it)
- [3. Import it](#3-import-it)
- [1. Add the dependecy](#1-add-the-dependecy)
- [2. Install it](#2-install-it)
- [3. Import it](#3-import-it)
- [4. Setup Localization](#4-setup-localization)
- [πŸ’» Usage](#-usage)
- [Example](#example)
- [Create survey steps](#create-survey-steps)
Expand Down Expand Up @@ -91,6 +92,21 @@ flutter pub get
```dart
import 'package:survey_kit/survey_kit.dart';
```
```

## 4. Setup Localization
```dart
return MaterialApp(
localizationsDelegates: const [
SurveyKitLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: SurveyKitLocalizations.supportedLocales,
...
);
```

# πŸ’» Usage
## Example
Expand Down Expand Up @@ -257,13 +273,17 @@ The styling can be adjusted by the build in Flutter theme.
| subtitle1 | Textstyle used in TextFields|

### Localization
If you want to override the fixed texts or adapt them to different languages like close, next, .... You need to provide SurveyKit a Map of translations

If you want to override the fixed texts or adapt them to different languages like close, next, .... You need to add the `SurveyKitLocalizations` to your `MaterialApp`:
```dart
SurveyKit(
localizations: {
'cancel': 'Cancel',
}
return MaterialApp(
localizationsDelegates: const [
SurveyKitLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: SurveyKitLocalizations.supportedLocales,
...
);
```
Here is a complete list of keys that can be overriden:
Expand Down
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ analyzer:
missing_return: error
# Ignored because of freezed and JsonKey (https://github.com/rrousselGit/freezed/issues/488)
invalid_annotation_target: ignore
invalid_dependency: ignore
body_might_complete_normally_nullable: ignore

exclude:
Expand Down
9 changes: 0 additions & 9 deletions android/.gitignore

This file was deleted.

47 changes: 0 additions & 47 deletions android/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion android/settings.gradle

This file was deleted.

2 changes: 0 additions & 2 deletions android/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

30 changes: 15 additions & 15 deletions example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

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

project_type: app
Expand All @@ -13,26 +13,26 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
- platform: android
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
- platform: ios
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
- platform: linux
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
- platform: macos
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
- platform: web
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
- platform: windows
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8

# User provided section

Expand Down
Loading