Skip to content

Commit

Permalink
fix(app: fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Numoy committed Dec 18, 2024
1 parent 1536da0 commit d711dfd
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ abstract class ImageAnswerFormat extends AnswerFormat {
throw AnswerFormatNotDefinedException();
}
}
@override
Map<String, dynamic> toJson();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:survey_kit/src/answer_format/answer_format.dart';
import 'package:survey_kit/survey_kit.dart';

part 'image_answer_format.g.dart';
Expand All @@ -23,5 +22,6 @@ class ImageAnswerFormat implements AnswerFormat {
factory ImageAnswerFormat.fromJson(Map<String, dynamic> json) =>
_$ImageAnswerFormatFromJson(json);

@override
Map<String, dynamic> toJson() => _$ImageAnswerFormatToJson(this);
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:survey_kit/src/result/question_result.dart';
import 'package:survey_kit/src/steps/identifier/identifier.dart';
import 'package:survey_kit/survey_kit.dart';

part 'image_question_result.g.dart';

@JsonSerializable(explicitToJson: true)
class ImageQuestionResult extends QuestionResult<String?> {
ImageQuestionResult({
required Identifier id,
required DateTime startDate,
required DateTime endDate,
required String valueIdentifier,
required String? result,
}) : super(
id: id,
startDate: startDate,
endDate: endDate,
valueIdentifier: valueIdentifier,
result: result,
);
required Identifier super.id,
required super.startDate,
required super.endDate,
required String super.valueIdentifier,
required super.result,
});

factory ImageQuestionResult.fromJson(Map<String, dynamic> json) =>
_$ImageQuestionResultFromJson(json);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:survey_kit/src/answer_format/image_answer_format.dart';
import 'package:survey_kit/src/result/question/image_question_result.dart';
import 'package:survey_kit/src/steps/predefined_steps/question_step.dart';
import 'package:survey_kit/src/views/widget/step_view.dart';
import 'package:survey_kit/survey_kit.dart';

class ImageAnswerView extends StatefulWidget {
final QuestionStep questionStep;
final ImageQuestionResult? result;

const ImageAnswerView({
Key? key,
super.key,
required this.questionStep,
required this.result,
}) : super(key: key);
});

@override
State<ImageAnswerView> createState() => _ImageAnswerViewState();
Expand All @@ -23,7 +20,7 @@ class _ImageAnswerViewState extends State<ImageAnswerView> {
late final ImageAnswerFormat _imageAnswerFormat;
late final DateTime _startDate;

bool _isValid = false;
final bool _isValid = false;
String filePath = '';

@override
Expand Down Expand Up @@ -59,7 +56,7 @@ class _ImageAnswerViewState extends State<ImageAnswerView> {
: widget.questionStep.content,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 32.0),
child: Container(
child: SizedBox(
width: MediaQuery.of(context).size.width,
child: Column(
children: [
Expand Down
2 changes: 1 addition & 1 deletion packages/survey_kit_image_answer/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ packages:
source: hosted
version: "1.1.1"
flutter:
dependency: transitive
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
Expand Down
2 changes: 2 additions & 0 deletions packages/survey_kit_image_answer/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ environment:

dependencies:
camera: ^0.11.0+1
flutter:
sdk: flutter
image_picker: ^1.0.4
json_annotation: ^4.0.1
survey_kit: ^0.2.1
Expand Down

0 comments on commit d711dfd

Please sign in to comment.