-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- New charting implementation - Add license page - Add some documentation - Some visual fixes and tweaks
- Loading branch information
Showing
16 changed files
with
808 additions
and
303 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
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 |
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,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(); | ||
} | ||
} |
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/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(); | ||
} | ||
} |
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.