Skip to content

Commit

Permalink
Migrate deprecations for Flutter v1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
royarg02 committed May 30, 2020
1 parent c3d9d5a commit 45a7f75
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions lib/pages/Analysis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class _AnalysisState extends State<Analysis> {
.toStringAsFixed(1),
style: Theme.of(context)
.textTheme
.display2
.headline3
.copyWith(
color: (Provider.of<ThemeState>(
context)
Expand All @@ -173,7 +173,7 @@ class _AnalysisState extends State<Analysis> {
'${_chartObj.getUnit}',
style: Theme.of(context)
.textTheme
.body1
.bodyText2
.copyWith(
fontSize:
appWidth(context) * 0.06,
Expand All @@ -185,7 +185,7 @@ class _AnalysisState extends State<Analysis> {
'On $fetchDateEEEMMMd',
style: Theme.of(context)
.textTheme
.body2
.bodyText1
.copyWith(
fontSize: appWidth(context) * 0.025,
),
Expand Down Expand Up @@ -235,7 +235,7 @@ class _AnalysisState extends State<Analysis> {
option,
style: Theme.of(context)
.textTheme
.body2
.bodyText1
.copyWith(
fontSize: appWidth(context) * 0.035),
textAlign: TextAlign.center,
Expand Down Expand Up @@ -298,7 +298,7 @@ class _AnalysisState extends State<Analysis> {
onPressed: () => _pickDate(context),
child: Text(
'$fetchDateEEEMMMd',
style: Theme.of(context).textTheme.body2.copyWith(
style: Theme.of(context).textTheme.bodyText1.copyWith(
fontSize: appWidth(context) * 0.05,
),
),
Expand Down
16 changes: 8 additions & 8 deletions lib/pages/Credits.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class _CreditsState extends State<Credits> {
children: [
TextSpan(
text: devDetails[index]['Name'],
style: Theme.of(context).textTheme.subhead),
style: Theme.of(context).textTheme.subtitle1),
TextSpan(
text: ' ${devDetails[index]['Github']}',
style: Theme.of(context).textTheme.body2.copyWith(
style: Theme.of(context).textTheme.bodyText1.copyWith(
color: (Provider.of<ThemeState>(context).isDarkTheme)
? subtleWhiteTextColor
: subtleBlackTextColor,
Expand Down Expand Up @@ -113,7 +113,7 @@ class _CreditsState extends State<Credits> {
leading: BackButton(),
title: Text(
'About',
style: Theme.of(context).textTheme.title.copyWith(
style: Theme.of(context).textTheme.headline6.copyWith(
fontSize: appWidth(context) * 0.055,
),
),
Expand All @@ -137,7 +137,7 @@ class _CreditsState extends State<Credits> {
textAlign: TextAlign.center,
strutStyle: StrutStyle(fontSize: 14.0),
text: TextSpan(
style: Theme.of(context).textTheme.body2.copyWith(
style: Theme.of(context).textTheme.bodyText1.copyWith(
color: (Provider.of<ThemeState>(context).isDarkTheme)
? subtleWhiteTextColor
: subtleBlackTextColor,
Expand All @@ -154,7 +154,7 @@ class _CreditsState extends State<Credits> {
padding: EdgeInsets.symmetric(vertical: appWidth(context) * 0.03),
child: Text(
'MEMBERS AND CONTRIBUTORS',
style: Theme.of(context).textTheme.headline.copyWith(
style: Theme.of(context).textTheme.headline5.copyWith(
fontSize: appWidth(context) * 0.05,
),
),
Expand All @@ -169,7 +169,7 @@ class _CreditsState extends State<Credits> {
padding: EdgeInsets.symmetric(vertical: appWidth(context) * 0.03),
child: Text(
'VIEW SOURCES',
style: Theme.of(context).textTheme.headline.copyWith(
style: Theme.of(context).textTheme.headline5.copyWith(
fontSize: appWidth(context) * 0.05,
),
),
Expand All @@ -179,7 +179,7 @@ class _CreditsState extends State<Credits> {
leading: Icon(FontAwesomeIcons.codeBranch),
title: Text(
'Fork the project on GitHub',
style: Theme.of(context).textTheme.subhead,
style: Theme.of(context).textTheme.subtitle1,
),
subtitle: Text(
'Show your appreciation by 🌟ing the repository!',
Expand All @@ -195,7 +195,7 @@ class _CreditsState extends State<Credits> {
leading: Icon(FontAwesomeIcons.server),
title: Text(
'View API implementation',
style: Theme.of(context).textTheme.subhead,
style: Theme.of(context).textTheme.subtitle1,
),
subtitle: Text(
'The other side of this project.',
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/Overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ class MoistureRadialIndicator extends StatelessWidget {
children: <Widget>[
Text(
'${nowPlantList[_selCard].getLabel}',
style: Theme.of(context).textTheme.body2.copyWith(
style: Theme.of(context).textTheme.bodyText1.copyWith(
fontSize: appWidth(context) * 0.03,
),
textAlign: TextAlign.center,
),
Text(
'${(nowPlantList[_selCard].getLastValue * 100).toStringAsFixed(0)}${nowPlantList[_selCard].getUnit}',
style: Theme.of(context).textTheme.display4.copyWith(
style: Theme.of(context).textTheme.headline1.copyWith(
fontSize: appWidth(context) * 0.2,
),
),
Expand Down Expand Up @@ -264,7 +264,7 @@ class AvatarData extends StatelessWidget {
'${(this._value > 1000) ? (this._value ~/ 1000).toString() + 'K' : this._value} ${this._unit}',
style: Theme.of(context)
.textTheme
.body2
.bodyText1
.copyWith(fontSize: appWidth(context) * 0.03),
)
],
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/ThresholdPump.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class _ThresholdPumpState extends State<ThresholdPump> {
leading: BackButton(),
title: Text(
'Pump threshold Control',
style: Theme.of(context).textTheme.title,
style: Theme.of(context).textTheme.headline6,
),
centerTitle: true,
),
Expand Down Expand Up @@ -87,7 +87,7 @@ class _PageState extends State<Page> {
leading: BackButton(),
title: Text(
'Pump threshold Control',
style: Theme.of(context).textTheme.title.copyWith(
style: Theme.of(context).textTheme.headline6.copyWith(
fontSize: appWidth(context) * 0.055,
),
),
Expand Down Expand Up @@ -212,7 +212,7 @@ class Skeleton extends StatelessWidget {
leading: BackButton(),
title: Text(
'Pump threshold Control',
style: Theme.of(context).textTheme.title.copyWith(
style: Theme.of(context).textTheme.headline6.copyWith(
fontSize: appWidth(context) * 0.055,
),
),
Expand Down
20 changes: 10 additions & 10 deletions lib/ui/build_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ SystemUiOverlayStyle appSystemUiTheme(bool isDarkTheme) {

// * Text theme to be used throughout the app
TextTheme appTextTheme = TextTheme(
display4: TextStyle(fontFamily: 'Ocrb'),
display3: TextStyle(fontFamily: 'Ocrb'),
display2: TextStyle(fontFamily: 'Ocrb'),
display1: TextStyle(fontFamily: 'Ocrb'),
body1: TextStyle(fontFamily: 'Ocrb'),
body2: TextStyle(fontFamily: 'Ocrb'),
headline: TextStyle(fontFamily: 'Ocrb'),
subtitle: TextStyle(fontFamily: 'Ocrb'),
headline1: TextStyle(fontFamily: 'Ocrb'),
headline2: TextStyle(fontFamily: 'Ocrb'),
headline3: TextStyle(fontFamily: 'Ocrb'),
headline4: TextStyle(fontFamily: 'Ocrb'),
bodyText2: TextStyle(fontFamily: 'Ocrb'),
bodyText1: TextStyle(fontFamily: 'Ocrb'),
headline5: TextStyle(fontFamily: 'Ocrb'),
subtitle2: TextStyle(fontFamily: 'Ocrb'),
button: TextStyle(fontFamily: 'Ocrb'),
caption: TextStyle(fontFamily: 'Ocrb'),
subhead: TextStyle(fontFamily: 'Ocrb'),
subtitle1: TextStyle(fontFamily: 'Ocrb'),
overline: TextStyle(fontFamily: 'Ocrb'),
title: TextStyle(fontFamily: 'Ocrb'),
headline6: TextStyle(fontFamily: 'Ocrb'),
);

// * Light Theme
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/plant_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class PlantCard extends StatelessWidget {
children: <Widget>[
Text(
'${this.plant.getLabel}',
style: Theme.of(context).textTheme.body2.copyWith(
style: Theme.of(context).textTheme.bodyText1.copyWith(
fontSize: appWidth(context) * 0.045,
),
textAlign: TextAlign.center,
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/threshold_slider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class _ThresholdSliderState extends State<ThresholdSlider> {
flex: 5,
child: Text(
this.widget.label,
style: Theme.of(context).textTheme.body2.copyWith(
style: Theme.of(context).textTheme.bodyText1.copyWith(
fontSize: appWidth(context) * 0.045,
),
textAlign: TextAlign.center,
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/display_error.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class NoNowData extends StatelessWidget {
? 'No Data for $fetchNowDate'
: 'Couldn\'t connect to Internet.\nRefresh to try again.',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.display1.copyWith(
style: Theme.of(context).textTheme.headline4.copyWith(
fontSize: appWidth(context) * 0.04,
),
),
Expand All @@ -52,7 +52,7 @@ class NoData extends StatelessWidget {
child: Text(
'No Data Found.\nRefresh to try again or choose another date.',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.display1.copyWith(
style: Theme.of(context).textTheme.headline4.copyWith(
fontSize: appWidth(context) * 0.04,
),
),
Expand Down

0 comments on commit 45a7f75

Please sign in to comment.