Skip to content

Commit

Permalink
Merge pull request #74 from ia-toki/fix-linter
Browse files Browse the repository at this point in the history
update linter error
  • Loading branch information
gmochid authored Nov 10, 2023
2 parents 9cb5a63 + 80754a4 commit f303124
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 22 deletions.
2 changes: 2 additions & 0 deletions app/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ linter:
prefer_relative_imports: true
prefer_if_elements_to_conditional_expressions: false
cascade_invocations: false
require_trailing_commas: false
depend_on_referenced_packages: false
# DO avoid print calls in production code.
#
# https://dart-lang.github.io/linter/lints/avoid_print.html
Expand Down
3 changes: 2 additions & 1 deletion app/lib/features/main/presentation/pages/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class _MainPageState extends State<MainPage> {
children: <TextSpan>[
TextSpan(
text: toBeginningOfSentenceCase(
'${useData?['name']}!'),
'${useData?['name']}!',
),
style: FontTheme.blackTitleBold(),
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class SplashScreen extends StatelessWidget {
},
child: Scaffold(
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Padding(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_pages.dart';

class QuizExercisePage extends StatefulWidget {
final String? quizParticipantId;
QuizExercisePage({super.key, this.quizParticipantId});
const QuizExercisePage({super.key, this.quizParticipantId});

@override
State<QuizExercisePage> createState() => _QuizExercisePageState();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: depend_on_referenced_packages

import 'dart:async';

import 'package:bloc/bloc.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// ignore_for_file: lines_longer_than_80_chars

part of '_pages.dart';

class QuizResultPage extends StatefulWidget {
final String? quizParticipantId;

QuizResultPage({super.key, this.quizParticipantId});
const QuizResultPage({super.key, this.quizParticipantId});

@override
State<QuizResultPage> createState() => _QuizResultPageState();
Expand All @@ -24,7 +26,6 @@ class _QuizResultPageState extends State<QuizResultPage> {
Padding(
padding: const EdgeInsets.all(32),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
Assets.bebrasPandaiText,
Expand All @@ -48,15 +49,15 @@ class _QuizResultPageState extends State<QuizResultPage> {
height: 20,
),
Container(
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
border: Border.all(), color: Colors.grey),
child: Column(
children: [
Text('Total Nilai: ${state.attempt.score}'),
Text(
'benar: ${state.attempt.totalCorrect}, salah: ${state.attempt.totalIncorrect}'),
Text('MANTAP!!!')
const Text('MANTAP!!!')
],
),
),
Expand All @@ -69,7 +70,7 @@ class _QuizResultPageState extends State<QuizResultPage> {
);
}
if (state is QuizResultNotAvailable) {
return Text('Result not available');
return const Text('Result not available');
}
if (state is QuizResultFailed) {
return Text(state.error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class QuizStartCubit extends Cubit<QuizStartState> {
}
}

void setAgreement(bool value) {
void setAgreement({required bool value}) {
agreement = value;
emit(QuizStartSuccess(
participation: participation, quiz: quiz, agreement: agreement));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class QuizStartSuccess extends QuizStartState {
{required this.participation,
required this.quiz,
required this.agreement});
@override
List<Object> get props => [participation, quiz, agreement];
}

Expand All @@ -23,6 +22,5 @@ class QuizStartFailed extends QuizStartState {

QuizStartFailed(this.error);

@override
List<Object> get props => [error];
}
22 changes: 11 additions & 11 deletions app/lib/features/quiz_start/presentation/pages/quiz_start_page.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// ignore_for_file: lines_longer_than_80_chars

part of '_pages.dart';

class QuizStartPage extends StatefulWidget {
final String? quizParticipantId;

QuizStartPage({super.key, this.quizParticipantId});
const QuizStartPage({super.key, this.quizParticipantId});

@override
State<QuizStartPage> createState() => _QuizStartPageState();
Expand Down Expand Up @@ -40,7 +42,7 @@ class _QuizStartPageState extends State<QuizStartPage> {
if (state is QuizStartFailed) {
return Text(state.error);
}
return Text('OK');
return const Text('OK');
},
),
],
Expand All @@ -58,11 +60,9 @@ class _QuizStartPageState extends State<QuizStartPage> {
Row(
children: [
Expanded(
flex: 1,
child: Container(
padding: const EdgeInsets.all(16),
decoration:
BoxDecoration(border: Border.all(color: Colors.black)),
decoration: BoxDecoration(border: Border.all()),
child: Column(
children: [
Text(state.quiz.title),
Expand All @@ -75,10 +75,10 @@ class _QuizStartPageState extends State<QuizStartPage> {
const SizedBox(
height: 10,
),
Text('Peraturan'),
Text('Pra Tantangan'),
Text('1. 12312312312'),
Text('2. qwerqwrqrwf'),
const Text('Peraturan'),
const Text('Pra Tantangan'),
const Text('1. 12312312312'),
const Text('2. qwerqwrqrwf'),
],
),
),
Expand All @@ -94,10 +94,10 @@ class _QuizStartPageState extends State<QuizStartPage> {
value: state.agreement,
onChanged: (value) {
if (value != null) {
context.read<QuizStartCubit>().setAgreement(value);
context.read<QuizStartCubit>().setAgreement(value: value);
}
}),
Flexible(
const Flexible(
child: Text(
'Saya telah membaca peraturan & akan mengerjakan dengan jujur'))
],
Expand Down

0 comments on commit f303124

Please sign in to comment.