Skip to content

Commit

Permalink
Build version 1.1.0 release
Browse files Browse the repository at this point in the history
 - New charting implementation
 - Add license page
 - Add some documentation
 - Some visual fixes and tweaks
  • Loading branch information
royarg02 committed Jul 24, 2020
1 parent b0bf48b commit 50c63f1
Show file tree
Hide file tree
Showing 16 changed files with 808 additions and 303 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.android.tools.build:gradle:4.0.1'
}
}

Expand Down
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Apr 06 13:07:01 IST 2020
#Tue Jul 14 15:44:44 IST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
4 changes: 0 additions & 4 deletions lib/data/all_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,21 @@ final List<Map<String, dynamic>> devDetails = [
{
'Name': 'ANURAG ROY',
'Github': 'RoyARG02',
'Bio': 'Programming language nomad, and a Flutter developer.',
'Twitter': '_royarg'
},
{
'Name': 'AYUSH THAKUR',
'Github': 'ayulockin',
'Bio': 'Deep Learning for Computer Vision | Computer Vision for Robotics',
'Twitter': 'ayushthakur0'
},
{
'Name': 'SNEHANGSHU BHATTACHARYA',
'Github': 'forkbomb-666',
'Bio': 'Linux | Bigdata(Hadoop) | DIY Electronics | Robotics',
'Twitter': 'snehangshu_'
},
{
'Name': 'ARITRA ROY GOSTHIPATY',
'Github': 'ariG23498',
'Bio': '| Flutter | Android | Algorithms | Digital Signal Processing |',
'Twitter': 'ariG23498'
}
];
38 changes: 38 additions & 0 deletions lib/data_providers/analysis_current_value_provider.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'package:flutter/foundation.dart';

import 'package:soil_moisture_app/ui/analysis_graph.dart';
import 'package:soil_moisture_app/utils/date_func.dart';

/// Provides the current value selected in the [AnalysisGraph].
class AnalysisCurrentValueProvider with ChangeNotifier {
DataPoint current;

AnalysisCurrentValueProvider();

/// Initailizes the provider, with a list of data values.
///
/// Calculates the current value taking the last value of the
/// list.
AnalysisCurrentValueProvider.init(List<dynamic> data)
: current = DataPoint(
DateTime(date.year, date.month, date.day, data.length - 1),
data.last,
);

/// Updates the current value.
///
/// Used in conjunction with [DataProvider] as [ProxyProvider].
void update(List<dynamic> data) {
current = DataPoint(
DateTime(date.year, date.month, date.day, data.length - 1),
data.last,
);
notifyListeners();
}

/// Changes the currently selected value.
changeValue(DataPoint current) {
this.current = current;
notifyListeners();
}
}
29 changes: 29 additions & 0 deletions lib/data_providers/analysis_data_provider.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import 'package:flutter/foundation.dart';

/// Contains the current values alongwith its unit to be displayed
/// in [AnalysisGraph].
class AnalysisDataProvider with ChangeNotifier {
List<dynamic> data;
String unit;

AnalysisDataProvider();

/// Initializes the provider given some data and its unit.
void init(List<dynamic> newData, String unit) {
data = newData;
this.unit = unit;
}

/// Same as [AnalysisDataProvider.init] but notifies dependant widgets.
void changeData(List<dynamic> newData, String unit) {
data = newData;
this.unit = unit;
notifyListeners();
}

/// "Updates", which isn't saying much considering it only notifies dependant
/// widgets. Used in conjunction with [SelectedCardState] as a [ProxyProvider].
void update() {
notifyListeners();
}
}
16 changes: 14 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import 'package:flutter/material.dart';
// * External Packages import
import 'package:provider/provider.dart';

// * Data providers import
import 'package:soil_moisture_app/data_providers/analysis_data_provider.dart';

// * Prefs import
import 'package:soil_moisture_app/prefs/user_prefs.dart';

Expand Down Expand Up @@ -60,14 +63,19 @@ class Root extends StatelessWidget {
class Home extends StatefulWidget {
final List<Widget> _tabPages = [
Overview(),
Analysis(),
ChangeNotifierProxyProvider<SelectedCardState, AnalysisDataProvider>(
create: (context) => AnalysisDataProvider(),
update: (context, selCard, dataProvider) => dataProvider..update(),
child: Analysis(),
),
];
@override
@override
_HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
class _HomeState extends State<Home>
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
TabController _controller;
void initState() {
super.initState();
Expand Down Expand Up @@ -97,6 +105,7 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
super.build(context);
print(appWidth(context));
return WillPopScope(
onWillPop: _popScopeInvoke,
Expand Down Expand Up @@ -153,4 +162,7 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
),
);
}

@override
bool get wantKeepAlive => true;
}
Loading

0 comments on commit 50c63f1

Please sign in to comment.