Skip to content

Commit fe4577e

Browse files
author
mercy
committed
Merge branch 'master' into main
2 parents a0c31dd + 939c5b3 commit fe4577e

33 files changed

+993
-126
lines changed

.vscode/launch.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "pwa-chrome",
9+
"request": "launch",
10+
"name": "Launch Chrome against localhost",
11+
"url": "http://localhost:8080",
12+
"webRoot": "${workspaceFolder}"
13+
}
14+
]
15+
}

README.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
# error installing vlc
2-
https://askubuntu.com/questions/1029117/unable-to-install-package-snap-package-has-install-snap-change-in-pro
1+
# Learn Flutter
2+
This project is created with an aim of learning flutter widgets and dart.
33

4-
# router generator
5-
https://www.youtube.com/watch?v=FV5k56IJWsk
6-
# learn-flutter-development
7-
Fundermantal Flutter practices
4+
It has a dashboard which contains the sub-projects have been working on.
5+
6+
1. A piano
7+
The main Aim of this project was to create a piano widget and add a package(audioPlayer). To play the audio, you need to tap any of the buttons.
8+
TODO: improve the UI of the piano
9+
!['Piano screenshot'](https://github.com/Learn-Flutter-Development/learn-flutter-development/blob/master/assets/images/piano.png)
10+
11+
2. Bible Trivia
12+
This is a question and answer project on common bible questions, a user selects if the answer provided is either true or false by tapping on a button. if the answer is true, a check icon is added, if the answer is false, the close icon is aded.
13+
TODO: display the 5th score, 2.Display answers in choices form.
14+
!['Trivia screenshot'](https://github.com/Learn-Flutter-Development/learn-flutter-development/blob/master/assets/images/trivia.png) !['Trivia screenshot'](https://github.com/Learn-Flutter-Development/learn-flutter-development/blob/develop/assets/images/score.png)
815

9-
# Git fundermentals
10-
https://www.freecodecamp.org/news/pushing-to-github-made-simple-enough-for-poets/

analysis_options.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

assets/images/gitupload.png

16.1 KB
Loading

assets/images/piano.png

15.6 KB
Loading

assets/images/score.png

36.4 KB
Loading

assets/images/trivia.png

37.8 KB
Loading

assets/slider.png

2.48 KB
Loading

assets/sliderimage.png

12.1 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import 'dart:math';
2+
3+
import 'package:app_name/application/theme/constants.dart';
4+
5+
class BMICalculator {
6+
BMICalculator({this.height, this.weight});
7+
final int height;
8+
final int weight;
9+
10+
double _bmi;
11+
12+
String calculateBMI() {
13+
_bmi = weightk / pow(heightk / 100, 2);
14+
return _bmi.toStringAsFixed(1);
15+
}
16+
17+
String getResult() {
18+
if (_bmi >= 25) {
19+
return 'overweight';
20+
} else if (_bmi > 18.5) {
21+
return 'Norma; ';
22+
} else {
23+
return 'Underweight';
24+
}
25+
}
26+
27+
String getInterpratation() {
28+
if (_bmi >= 25) {
29+
return 'Try to excercise';
30+
} else if (_bmi > 18.5) {
31+
return 'Good, continue living healthy ';
32+
} else {
33+
return 'Eat my fren';
34+
}
35+
}
36+
}

lib/application/theme/colors.dart

+28
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
11
import 'package:flutter/material.dart';
22

33
const Color white = Color(0xFFFFFFFF);
4+
const Color white1 = Color(0xE8FFFFFF);
5+
const Color white2 = Color(0xD3FFFFFF);
46
const Color green = Colors.green;
57
const Color red = Colors.red;
8+
const Color black = Color(0xFF000000);
9+
//Calculator colors
10+
const Color primary = Color(0xFF0A0E21);
11+
//inactive
12+
const Color inactive = Color(0xFF111328);
13+
const Color active = Color(0xFF1D1E33);
14+
15+
const Color pink = Color(0xFFEB1555);
16+
//blue
17+
Color blue1 = const Color.fromARGB(0xFF, 0x26, 0x4E, 0x86);
18+
Color blue2 = const Color.fromARGB(0xFF, 0xAF, 0xFF, 0xFF);
19+
Color blue3 = const Color.fromARGB(0xFF, 0x74, 0xDB, 0xEF);
20+
Color blue4 = const Color.fromARGB(0xFF, 0x5E, 0x88, 0xFC);
621
const Color statusBackgroundColor = Color(0xFF10B8B8);
22+
Color navyBlue = const Color.fromARGB(0xFF, 0x00, 0x00, 0x35);
23+
24+
// green
25+
Color jadeGreen = const Color.fromARGB(0xFF, 0x00, 0xA8, 0x6B);
26+
Color neonGreen = const Color.fromARGB(0xFF, 0x39, 0xFF, 0x14);
27+
Color forestGreen = const Color.fromARGB(0xFF, 0x22, 0x8B, 0x22);
28+
Color kellyGreen = const Color.fromARGB(0xFF, 0x4C, 0xBB, 0x17);
29+
Color darkGreen = const Color.fromARGB(0xFF, 0x00, 0x64, 0x00);
30+
Color springGreen = const Color.fromARGB(0xFF, 0x00, 0xFF, 0x7F);
31+
const Color hourbourGreen = Color.fromARGB(0xFF, 0x00, 0xFF, 0x00);
32+
Color britishRacingGreen = const Color.fromARGB(0xFF, 0x00, 0x42, 0x25);
33+
34+
//grey
735
const Color grey = Color.fromRGBO(220, 220, 220, 1.0);

lib/application/theme/constants.dart

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
int heightk = 180;
2+
int weightk = 740;
3+
int agek = 24;

lib/application/theme/strings.dart

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const height = 'HEIGHT';
2+
3+
const cm = 'cm';
4+
5+
const age = 'AGE';
6+
7+
const weight = 'WEIGHT';
8+
9+
const result = 'RESULT';
10+
11+
const calculate = 'RE-CALCULATE';
12+
13+
const male = 'Male';
14+
15+
const female = 'Female';
16+
17+
const bmiCalculatorTitle = 'BMI CALCULATOR';
18+
19+
const bmiResult = 'BMI RESULT';
20+
21+
const resultTitle = 'YOUR RESULT';

lib/application/theme/style.dart

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:app_name/application/theme/colors.dart';
2+
import 'package:flutter/material.dart';
3+
4+
const NumberTextStyle = TextStyle(fontSize: 50, fontWeight: FontWeight.w600);
5+
6+
const normalTextStyle = TextStyle(
7+
fontSize: 30.0,
8+
);
9+
10+
const subTitleTextStyle = TextStyle(fontSize: 25.0, color: white2);
11+
12+
const titleTextStyle =
13+
TextStyle(fontSize: 40.0, color: white, fontWeight: FontWeight.bold);
14+
15+
const resultTextStyle = TextStyle(
16+
fontSize: 40.0, color: hourbourGreen, fontWeight: FontWeight.bold);
17+
18+
const bmiResultTextStyle =
19+
TextStyle(fontSize: 90.0, color: white, fontWeight: FontWeight.bold);

lib/domain/gender.dart

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enum Gender { Male, Female }

lib/main.dart

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import 'dart:ui';
2+
3+
import 'package:app_name/application/theme/colors.dart';
14
import 'package:app_name/presentation/router/router_generator.dart';
25
import 'package:flutter/material.dart';
36

@@ -11,6 +14,9 @@ class MyApp extends StatelessWidget {
1114
Widget build(BuildContext context) {
1215
return MaterialApp(
1316
debugShowCheckedModeBanner: false,
17+
theme: ThemeData(
18+
brightness: Brightness.light,
19+
textTheme: TextTheme(bodyText2: TextStyle(color: white))),
1420
// home: Dashboard(),
1521
onGenerateRoute: RouterNavigator.generateRoute,
1622
);

lib/presentation/model/quetion.dart

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import 'package:app_name/presentation/widget/widgets.dart';
2+
import 'package:flutter/material.dart';
3+
4+
class Question {
5+
String question;
6+
bool answer;
7+
String choice;
8+
String questionNo;
9+
10+
Question(this.questionNo, this.question, this.answer, this.choice);
11+
}
12+
13+
class TriviaQuestion {
14+
int _triviaQuestionNo = 0;
15+
16+
List<Question> _bibleTrivia = [
17+
Question('Question 1.', 'In what city was Jesus born? ', true, 'Bethlehem'),
18+
Question('Question 2.', 'How many books are in the New Testament? ', false,
19+
'36'),
20+
Question(
21+
'Question 3.',
22+
'What type of insect did John the Baptist eat in the desert? ',
23+
true,
24+
'Locusts'),
25+
Question(
26+
'Question 4.',
27+
'Who were the first apostles called to follow Jesus?',
28+
false,
29+
'Peter and simon'),
30+
Question(
31+
'Question 5.',
32+
'How many people did Jesus feed with five loaves of bread and two fish?',
33+
true,
34+
'about 5000 men',
35+
)
36+
];
37+
38+
void nextQuestion() {
39+
if (_triviaQuestionNo < _bibleTrivia.length - 1) {
40+
_triviaQuestionNo++;
41+
}
42+
}
43+
44+
String getQuestionNo() {
45+
return _bibleTrivia[_triviaQuestionNo].questionNo;
46+
}
47+
48+
String getQuestionText() {
49+
return _bibleTrivia[_triviaQuestionNo].question;
50+
}
51+
52+
bool getQuestionAnswer() {
53+
return _bibleTrivia[_triviaQuestionNo].answer;
54+
}
55+
56+
String getQuestionChoice() {
57+
return _bibleTrivia[_triviaQuestionNo].choice;
58+
}
59+
60+
bool completeQuize() {
61+
if (_triviaQuestionNo >= _bibleTrivia.length - 1) {
62+
return true;
63+
} else {
64+
return false;
65+
}
66+
}
67+
68+
void reset() {
69+
_triviaQuestionNo = 0;
70+
}
71+
72+
int triviaScore() {
73+
return scoreKeeper.where((c) => c.icon == Icons.check).toList().length;
74+
}
75+
}

0 commit comments

Comments
 (0)