Skip to content

Commit

Permalink
Merge pull request #107 from abhishekpatelmc/QAtest
Browse files Browse the repository at this point in the history
Production Code
  • Loading branch information
abhishekpatelmc authored Aug 2, 2022
2 parents 8fa2532 + 8b18e1c commit eb55397
Show file tree
Hide file tree
Showing 35 changed files with 981 additions and 561 deletions.
4 changes: 4 additions & 0 deletions .dart_tool/package_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,11 @@
"languageVersion": "2.16"
}
],
<<<<<<< HEAD
"generated": "2022-08-01T19:12:04.158221Z",
=======
"generated": "2022-08-02T05:35:58.699774Z",
>>>>>>> 1df55eea6232a33b407d3248c5545b792f751049
"generator": "pub",
"generatorVersion": "2.17.6"
}
313 changes: 312 additions & 1 deletion .flutter-plugins-dependencies

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .packages
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2022-08-01 15:12:04.094216.
# Generated by pub on 2022-08-02 01:35:58.682820.
async:file:///C:/Users/Abhishek/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/async-2.8.2/lib/
boolean_selector:file:///C:/Users/Abhishek/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/
carousel_slider:file:///C:/Users/Abhishek/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/carousel_slider-4.1.1/lib/
Expand Down
Binary file modified android/.gradle/7.4/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified android/.gradle/7.4/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified android/.gradle/7.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified android/.gradle/7.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified android/.gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file modified android/.gradle/file-system.probe
Binary file not shown.
1 change: 0 additions & 1 deletion android/local.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
sdk.dir=C:\\Users\\Abhishek\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\src\\flutter
=======
flutter.versionName=1.0.0
flutter.versionCode=1
flutter.buildMode=debug
Binary file removed assets/images/Carbon reduce.gif
Binary file not shown.
Binary file removed assets/images/Healty eat.gif
Binary file not shown.
Binary file removed assets/images/Picture10.png
Binary file not shown.
Binary file removed assets/images/Picture11.png
Binary file not shown.
Binary file removed assets/images/Picture13.png
Binary file not shown.
Binary file removed assets/images/Picture9.png
Binary file not shown.
Binary file added assets/images/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/person.png
Binary file not shown.
156 changes: 107 additions & 49 deletions lib/screens/home/EcoCount/EcoCount.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// ignore_for_file: file_names
// ignore_for_file: file_names, avoid_print, prefer_interpolation_to_compose_strings, avoid_function_literals_in_foreach_calls
import 'dart:convert';

import 'package:percent_indicator/percent_indicator.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

class EcoCount extends StatefulWidget {
const EcoCount({Key? key}) : super(key: key);
Expand All @@ -10,6 +13,36 @@ class EcoCount extends StatefulWidget {
}

class _EcoCountState extends State<EcoCount> {
double value = 0;
int level = 0;
dynamic points = 0;
dynamic cd = 320;
dynamic cf = 0;
dynamic tasks = "";
var taskList = [];

Future<void> getTaskList() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
tasks = prefs.getString("tasks");
setState(() {
taskList = json.decode(tasks);
value = taskList.length * 25;
level = taskList.length * 25;
taskList.forEach((element) {
points += element['points'];
});
cf = points * 0.276;
cd += cf;
});
print("retrive " + cd);
}

@override
void initState() {
super.initState();
getTaskList();
}

@override
Widget build(BuildContext context) {
return Scaffold(
Expand All @@ -34,32 +67,49 @@ class _EcoCountState extends State<EcoCount> {
// drawer: NavigationDrawer(),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 25, 10, 10),
padding: const EdgeInsets.fromLTRB(20, 25, 20, 10),
child: Center(
child: Column(
children: [
CircularPercentIndicator(
radius: 70.0,
lineWidth: 14.0,
percent: 0.8,
percent: (value % 100) / 100,
backgroundColor: Colors.white10,
circularStrokeCap: CircularStrokeCap.round,
animationDuration: 1200,
animation: true,
center: const CircleAvatar(
radius: 50,
backgroundImage: NetworkImage(
'https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80',
),
),
progressColor: Colors.green[300],
progressColor: const Color.fromARGB(255, 67, 168, 60),
),
const SizedBox(
height: 10.0,
),
Text(
"Level 1",
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w500,
color: Colors.grey[600],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Level ",
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w500,
color: Colors.grey[600],
),
),
Text(
(level / 100 + 1).floor().toString(),
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w500,
color: Colors.green[600],
),
),
],
),
const SizedBox(
height: 40.0,
Expand All @@ -82,105 +132,113 @@ class _EcoCountState extends State<EcoCount> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"1000",
(points > 0) ? cd.toString() : 0.toString(),
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w500,
color: Colors.grey[600],
color: Colors.green[600],
),
),
Divider(
height: 10,
color: Colors.grey[900],
endIndent: 10,
),

Text(
"carbon footprint",
"Carbon Cost",
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w500,
color: Colors.grey[600],
),
),
const SizedBox(
height: 10,
height: 15,
),
Text(
"1000",
(points > 0)
? cf.toStringAsFixed(2)
: 0.toString(),
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w500,
color: Colors.grey[600],
color: Colors.green[600],
),
),
Divider(
color: Colors.grey[900],
endIndent: 40,
),
Text(
"carbon Dioxide",
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w500,
color: Colors.grey[600],
),
),
const SizedBox(
height: 10,
),
Text(
"1000",
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w500,
color: Colors.grey[600],
),
),
Divider(
color: Colors.grey[900],
endIndent: 40,
),
Text(
"carbon Dioxide",
"Carbon Footprint",
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w500,
color: Colors.grey[600],
),
),
const SizedBox(
height: 10,
height: 15,
),
Text(
"100,000",
points.toString(),
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w500,
color: Colors.grey[600],
color: Colors.green[600],
),
),
Divider(
height: 10,
color: Colors.grey[900],
endIndent: 10,
endIndent: 60,
),
Text(
"carbon Dioxide",
"Points",
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w500,
color: Colors.grey[600],
),
),

// const SizedBox(
// height: 15,
// ),
// Text(
// "100,000",
// style: TextStyle(
// fontSize: 30.0,
// fontWeight: FontWeight.w500,
// color: Colors.grey[600],
// ),
// ),
// Divider(
// height: 10,
// color: Colors.grey[900],
// endIndent: 10,
// ),
// Text(
// "Carbon Dioxide",
// style: TextStyle(
// fontSize: 20.0,
// fontWeight: FontWeight.w500,
// color: Colors.grey[600],
// ),
// ),
],
),
),
],
),
Image.network(
// scale: 1,
// alignment: Alignment.topRight,
'https://images.unsplash.com/photo-1533038590840-1cde6e668a91?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=387&q=80',
fit: BoxFit.fitHeight,
height: 300.0,
'https://cdn-icons-png.flaticon.com/512/902/902543.png?w=740&t=st=1659399128~exp=1659399728~hmac=a7683694f6f1628083a7d79b437757d4203fb6d84b161a8d4af689f6138c1d07',
alignment: Alignment.center,
fit: BoxFit.fitWidth,
height: 240.0,
width: 150.0,
),
],
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/home/OnboardingScreen/onboarding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,5 @@ class _OnboardingPageState extends State<OnboardingPage> {
),
);
}
}
}

2 changes: 0 additions & 2 deletions lib/screens/home/SplashScreen/splashScreen.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// ignore_for_file: file_names

import 'dart:async';
import 'package:ecosia/screens/home/OnboardingScreen/onboarding.dart';
import 'package:ecosia/screens/home/TutorialPages/Tutorial.dart';
import 'package:flutter/material.dart';

class SplashScreenOne extends StatefulWidget {
Expand Down
Loading

0 comments on commit eb55397

Please sign in to comment.