-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
392 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'widgets/question_indicator/question_indicator_widget.dart'; | ||
import 'widgets/quiz/quiz_widget.dart'; | ||
|
||
class ChallengePage extends StatefulWidget { | ||
ChallengePage({Key? key}) : super(key: key); | ||
|
||
@override | ||
_ChallengePageState createState() => _ChallengePageState(); | ||
} | ||
|
||
class _ChallengePageState extends State<ChallengePage> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: PreferredSize( | ||
preferredSize: Size.fromHeight(60), | ||
child: SafeArea( | ||
top: true, | ||
child: QuestionIndicatorWidget(), | ||
), | ||
), | ||
body: QuizWidget( | ||
title: 'What does the Flutter do in your wholeness?', | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:devquiz/core/core.dart'; | ||
|
||
class AnswerWidget extends StatelessWidget { | ||
final String title; | ||
final bool isRight; | ||
final bool isSelected; | ||
|
||
const AnswerWidget({ | ||
Key? key, | ||
required this.title, | ||
this.isRight = false, | ||
this.isSelected = false, | ||
}) : super(key: key); | ||
|
||
Color get _selectedColorRight => | ||
isRight ? AppColors.darkGreen : AppColors.darkRed; | ||
|
||
Color get _selectedBorderRight => | ||
isRight ? AppColors.lightGreen : AppColors.lightRed; | ||
|
||
Color get _selectedColorCardRight => | ||
isRight ? AppColors.lightGreen : AppColors.lightRed; | ||
|
||
Color get _selectedBorderCardRight => | ||
isRight ? AppColors.green : AppColors.red; | ||
|
||
TextStyle get _selectedTextStyleRight => | ||
isRight ? AppTextStyles.bodyDarkGreen : AppTextStyles.bodyDarkRed; | ||
|
||
IconData get _selectedIconRight => isRight ? Icons.check : Icons.close; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4), | ||
child: Container( | ||
padding: EdgeInsets.all(16), | ||
decoration: BoxDecoration( | ||
color: isSelected ? _selectedColorCardRight : AppColors.white, | ||
borderRadius: BorderRadius.circular(10), | ||
border: Border.fromBorderSide(BorderSide( | ||
color: isSelected ? _selectedBorderCardRight : AppColors.border), | ||
), | ||
), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Expanded( | ||
child: Text( | ||
title, style: isSelected | ||
? _selectedTextStyleRight : AppTextStyles.body, | ||
), | ||
), | ||
SizedBox(width: 16), | ||
Container( | ||
width: 24, | ||
height: 24, | ||
decoration: BoxDecoration( | ||
color: isSelected ? _selectedColorRight : AppColors.white, | ||
borderRadius: BorderRadius.circular(500), | ||
border: Border.fromBorderSide( | ||
BorderSide( | ||
color: isSelected ? _selectedBorderRight : AppColors.border, | ||
), | ||
), | ||
), | ||
child: isSelected | ||
? Icon(_selectedIconRight, color: AppColors.white, size: 16) | ||
: null, | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
lib/challenge/widgets/question_indicator/question_indicator_widget.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:devquiz/core/core.dart'; | ||
import 'package:devquiz/shared/widgets/progress_indicator/progress_indicator_widget.dart'; | ||
|
||
class QuestionIndicatorWidget extends StatelessWidget { | ||
const QuestionIndicatorWidget({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), | ||
child: Column( | ||
children: [ | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Text('Question 04', style: AppTextStyles.body), | ||
Text('of 10', style: AppTextStyles.body), | ||
], | ||
), | ||
SizedBox(height: 16), | ||
ProgressIndicatorWidget(value: 0.4), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:devquiz/challenge/widgets/answer/answer_widget.dart'; | ||
import 'package:devquiz/core/core.dart'; | ||
|
||
class QuizWidget extends StatelessWidget { | ||
final String title; | ||
const QuizWidget({Key? key, required this.title}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
child: Column( | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 20), | ||
child: Text(title, style: AppTextStyles.heading), | ||
), | ||
SizedBox(height: 24), | ||
AnswerWidget( | ||
isRight: true, | ||
isSelected: true, | ||
title: 'Enables the creation of applications natively compiled', | ||
), | ||
AnswerWidget( | ||
isRight: false, | ||
isSelected: true, | ||
title: 'Enables the creation of applications natively compiled', | ||
), | ||
AnswerWidget( | ||
title: 'Enables the creation of applications natively compiled', | ||
), | ||
AnswerWidget( | ||
title: 'Enables the creation of applications natively compiled', | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import 'package:devquiz/home/home_page.dart'; | ||
// import 'package:devquiz/splash/splash_page.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:devquiz/challenge/challenge_page.dart'; | ||
// import 'package:devquiz/splash/splash_page.dart'; | ||
//import 'package:devquiz/home/home_page.dart'; | ||
|
||
class AppWidget extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
title: 'DevQuiz', | ||
debugShowCheckedModeBanner: false, | ||
home: HomePage(), | ||
home: ChallengePage(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.