Skip to content

Commit dc473c4

Browse files
author
KenanYusubov
committed
todo app is added
1 parent fdaea4d commit dc473c4

File tree

84 files changed

+2382
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2382
-25
lines changed

Flutter-BMI-Calculator/lang/az.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@
2929
"developer_info": "Proqramçı: Kənan Yusubov.",
3030
"overweight_or_obese_message": "Kilolu olan hər kəs əlavə kilo almamağa çalışmalıdır. Bundan əlavə, digər risk faktorları (məsələn, yüksək LDL xolesterol, aşağı HDL xolesterol və ya yüksək təzyiq) ilə kilolu olsanız, arıqlamağa çalışmalısınız. Hətta kiçik bir kilo itkisi (mövcud çəkinizin yalnız 10% -i) xəstəlik riskini azaltmağa kömək edə bilər. Arıqlamaq üçün uyğun yolları müəyyən etmək üçün həkiminizlə danışın.",
3131
"underweight_message": "Arıqlamağın mümkün səbəblərini bilmək və kilo almaq lazım olduqda, həkiminizlə danışın.",
32-
"normal_message": "Çəkiniz normaldır."
32+
"normal_message": "Çəkiniz normaldır.",
33+
"azerbaijani": "Azərbaycan dili",
34+
"english": "İngilis dili"
3335
}

Flutter-BMI-Calculator/lang/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@
2929
"developer_info": "Developer: Kanan Yusubov.",
3030
"overweight_or_obese_message": "Anyone who is overweight should try to avoid gaining additional weight. Additionally, if you are overweight with other risk factors (such as high LDL cholesterol, low HDL cholesterol, or high blood pressure), you should try to lose weight. Even a small weight loss (just 10% of your current weight) may help lower the risk of disease. Talk with your healthcare provider to determine appropriate ways to lose weight.",
3131
"underweight_message": "Talk with your healthcare provider to determine possible causes of underweight and if you need to gain weight.",
32-
"normal_message": "Your weight is normal."
32+
"normal_message": "Your weight is normal.",
33+
"azerbaijani": "Azerbaijani",
34+
"english": "English"
3335
}

Flutter-BMI-Calculator/lib/constants/localization_keys.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ class LocalizationKeys {
3434
"overweight_or_obese_message";
3535
static const String underweight_message = "underweight_message";
3636
static const String normal_message = "normal_message";
37+
static const String azerbaijani = "azerbaijani";
38+
static const String english = "english";
3739
}

Flutter-BMI-Calculator/lib/main.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import 'package:google_fonts/google_fonts.dart';
1515
void main() async {
1616
WidgetsFlutterBinding.ensureInitialized();
1717

18-
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
19-
2018
await SystemChrome.setPreferredOrientations([
2119
DeviceOrientation.portraitUp,
2220
DeviceOrientation.portraitDown,
@@ -97,8 +95,6 @@ class _MyAppState extends State<MyApp> {
9795
fontWeight: FontWeight.bold,
9896
),
9997
),
100-
unselectedWidgetColor:
101-
AppColors.unselectedDarkGenderBackground,
10298
focusColor: AppColors.selectedGenderBackground,
10399
hintColor: Colors.white,
104100
dividerColor: Colors.grey,
@@ -151,7 +147,6 @@ class _MyAppState extends State<MyApp> {
151147
fontWeight: FontWeight.bold,
152148
),
153149
),
154-
unselectedWidgetColor: AppColors.unselectedGenderBackground,
155150
focusColor: AppColors.selectedGenderBackground,
156151
hintColor: AppColors.primaryAndDarkColor,
157152
sliderTheme: SliderThemeData(

Flutter-BMI-Calculator/lib/ui/pages/settings_page.dart

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:bmi_calculator/blocs/lang_bloc/language_bloc.dart';
22
import 'package:bmi_calculator/blocs/theme_bloc/theme_bloc.dart';
33
import 'package:bmi_calculator/constants/localization_keys.dart';
44
import 'package:bmi_calculator/localizations/app_localizations.dart';
5+
import 'package:bmi_calculator/ui/widgets/language_dialog.dart';
56
import 'package:flutter/material.dart';
67
import 'package:get_it/get_it.dart';
78

@@ -30,22 +31,16 @@ class _SettingsPageState extends State<SettingsPage> {
3031
),
3132
body: ListView(
3233
children: <Widget>[
33-
StreamBuilder<bool>(
34-
stream: _languageBloc.languageEnabled,
35-
builder: (context, langSnapshot) {
36-
return SwitchListTile(
37-
activeColor: Colors.pinkAccent,
38-
value: langSnapshot.hasData ? langSnapshot.data : false,
39-
title: Text(
40-
AppLocalizations.of(context)
41-
.translate(LocalizationKeys.languageSelection),
42-
style: Theme.of(context).textTheme.subtitle,
43-
),
44-
onChanged: (value) {
45-
_languageBloc.changeLanguage(value);
46-
},
47-
);
48-
},
34+
ListTile(
35+
title: Text(
36+
AppLocalizations.of(context)
37+
.translate(LocalizationKeys.languageSelection),
38+
style: Theme.of(context).textTheme.subtitle,
39+
),
40+
onTap: () => showDialog(
41+
context: context,
42+
builder: (context) => LanguageDialog(),
43+
),
4944
),
5045
Divider(
5146
height: 0,
@@ -77,7 +72,7 @@ class _SettingsPageState extends State<SettingsPage> {
7772
showAboutDialog(
7873
context: context,
7974
applicationName: 'BMI Calculator',
80-
applicationVersion: 'v2.0.0',
75+
applicationVersion: 'v2.0.4',
8176
applicationIcon: Image.asset('assets/bmi.png'),
8277
children: [
8378
Text(
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import 'package:bmi_calculator/blocs/lang_bloc/language_bloc.dart';
2+
import 'package:bmi_calculator/constants/localization_keys.dart';
3+
import 'package:bmi_calculator/localizations/app_localizations.dart';
4+
import 'package:flutter/material.dart';
5+
import 'package:get_it/get_it.dart';
6+
7+
class LanguageDialog extends StatefulWidget {
8+
@override
9+
_LanguageDialogState createState() => _LanguageDialogState();
10+
}
11+
12+
class _LanguageDialogState extends State<LanguageDialog> {
13+
int group = 1;
14+
LanguageBloc _languageBloc;
15+
16+
@override
17+
void initState() {
18+
_languageBloc = GetIt.instance.get<LanguageBloc>();
19+
super.initState();
20+
}
21+
22+
@override
23+
Widget build(BuildContext context) {
24+
return AlertDialog(
25+
title: Text(
26+
AppLocalizations.of(context)
27+
.translate(LocalizationKeys.languageSelection),
28+
style: Theme.of(context).textTheme.subtitle,
29+
),
30+
content: StreamBuilder<bool>(
31+
stream: _languageBloc.languageEnabled,
32+
builder: (context, languageSnapshot) {
33+
group =
34+
languageSnapshot.hasData ? (languageSnapshot.data ? 0 : 1) : -1;
35+
36+
return Column(
37+
mainAxisSize: MainAxisSize.min,
38+
children: <Widget>[
39+
RadioListTile(
40+
value: 0,
41+
groupValue: group,
42+
title: Text(
43+
AppLocalizations.of(context)
44+
.translate(LocalizationKeys.azerbaijani),
45+
style: Theme.of(context).textTheme.subtitle,
46+
),
47+
onChanged: (value) => _languageBloc.changeLanguage(true),
48+
activeColor: Theme.of(context).accentColor,
49+
),
50+
RadioListTile(
51+
title: Text(
52+
AppLocalizations.of(context)
53+
.translate(LocalizationKeys.english),
54+
style: Theme.of(context).textTheme.subtitle,
55+
),
56+
onChanged: (value) => _languageBloc.changeLanguage(false),
57+
groupValue: group,
58+
value: 1,
59+
activeColor: Theme.of(context).accentColor,
60+
),
61+
],
62+
);
63+
},
64+
),
65+
);
66+
}
67+
}

Flutter-BMI-Calculator/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: bmi_calculator
22
description: Simple BMI calculator for adults.
3-
version: 2.0.1+5
3+
version: 2.0.4+7
44

55
environment:
66
sdk: ">=2.1.0 <3.0.0"

todo_app/.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
.dart_tool/
26+
.flutter-plugins
27+
.flutter-plugins-dependencies
28+
.packages
29+
.pub-cache/
30+
.pub/
31+
/build/
32+
33+
# Web related
34+
lib/generated_plugin_registrant.dart
35+
36+
# Symbolication related
37+
app.*.symbols
38+
39+
# Obfuscation related
40+
app.*.map.json
41+
42+
# Exceptions to above rules.
43+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

todo_app/.metadata

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: f7a6a7906be96d2288f5d63a5a54c515a6e987fe
8+
channel: stable
9+
10+
project_type: app

todo_app/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# todo_app
2+
3+
A new Flutter project.
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Flutter application.
8+
9+
A few resources to get you started if this is your first Flutter project:
10+
11+
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13+
14+
For help getting started with Flutter, view our
15+
[online documentation](https://flutter.dev/docs), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.

0 commit comments

Comments
 (0)