Skip to content

Commit

Permalink
expose backgroundColor parma for SurveyPage
Browse files Browse the repository at this point in the history
  • Loading branch information
eldrig0 committed Jan 7, 2025
1 parent 7cf8f94 commit ea08c43
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

# 1.0.0-dev.9
- CHORE: Expose backgroundColor param for SurveyPage
# 1.0.0-dev.8
- INFO: Support AGP 8.x, bump compileSdk to 34
# 1.0.0-dev.7
Expand Down Expand Up @@ -98,4 +101,4 @@ HOW TO MIGRATE:

Initial Version of the library.

- Includes the ability to create a surveys with prebuild and customs step.
- Includes the ability to create a surveys with prebuild and customs step.
7 changes: 7 additions & 0 deletions lib/src/survey_kit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class SurveyKit extends StatefulWidget {
/// Decoration which is applied to the survey container
final BoxDecoration? decoration;

final Color? backgroundColor;

const SurveyKit({
super.key,
required this.task,
Expand All @@ -60,6 +62,7 @@ class SurveyKit extends StatefulWidget {
this.localizations,
this.stepShell,
this.decoration,
this.backgroundColor,
});

@override
Expand Down Expand Up @@ -109,6 +112,7 @@ class _SurveyKitState extends State<SurveyKit> {
stepShell: widget.stepShell,
navigatorKey: _navigatorKey,
child: SurveyPage(
backgroundColor: widget.backgroundColor,
length: widget.task.steps.length,
onResult: widget.onResult,
appBar: widget.appBar,
Expand All @@ -126,6 +130,7 @@ class SurveyPage extends StatefulWidget {
final PreferredSizeWidget? appBar;
final GlobalKey<NavigatorState> navigatorKey;
final Decoration? decoration;
final Color? backgroundColor;

const SurveyPage({
super.key,
Expand All @@ -134,6 +139,7 @@ class SurveyPage extends StatefulWidget {
required this.navigatorKey,
this.appBar,
this.decoration,
this.backgroundColor,
});

@override
Expand All @@ -155,6 +161,7 @@ class _SurveyPageState extends State<SurveyPage>
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: widget.backgroundColor,
appBar: widget.appBar ?? const SurveyAppBar(),
body: Container(
decoration: widget.decoration,
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: survey_kit
description: Create beautiful surveys with Flutter (inspired by iOS ResearchKit Surveys)
version: 1.0.0-dev.8
version: 1.0.0-dev.9
homepage: https://quickbirdstudios.com
repository: https://github.com/quickbirdstudios/survey_kit
issue_tracker: https://github.com/quickbirdstudios/survey_kit/issues
Expand Down Expand Up @@ -41,4 +41,4 @@ dev_dependencies:
build_runner: ^2.3.3
flutter_test:
sdk: flutter
json_serializable: ^6.1.3
json_serializable: ^6.1.3

0 comments on commit ea08c43

Please sign in to comment.