Skip to content

Commit

Permalink
improvement in loader for default country stat
Browse files Browse the repository at this point in the history
  • Loading branch information
arafaysaleem committed Jul 3, 2020
1 parent 749d52f commit ced1a94
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/widgets/skeletons/country_stat_skeleton.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import 'package:flutter/material.dart';

class CountryStatLoader extends StatefulWidget {
final Color color;
final bool isDefault;

const CountryStatLoader({Key key, this.color}) : super(key: key);
const CountryStatLoader({Key key, this.color, this.isDefault}) : super(key: key);


@override
Expand Down Expand Up @@ -413,7 +414,7 @@ class _CountryStatLoaderState extends State<CountryStatLoader> with TickerProvid
Expanded(child: SizedBox(height: 20)),

//Set as default button
Container(
if(!widget.isDefault) Container(
width: double.infinity,
height: 50,
decoration: BoxDecoration(
Expand Down
1 change: 0 additions & 1 deletion lib/widgets/stats_widgets/country_card_details.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:convert';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flushbar/flushbar_helper.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../values/default_country_data.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/widgets/stats_widgets/country_stat_widget.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:covidtracker/values/default_country_data.dart';

import '../../widgets/stats_widgets/country_card_details.dart';
import '../../network_requests/api_client.dart';
Expand Down Expand Up @@ -336,6 +337,7 @@ class _CountryStatWidgetState extends State<CountryStatWidget>
} else {
return CountryStatLoader(
color: widget.color,
isDefault: defaultCountry.countryName==widget.countryName,
);
}
},
Expand Down

0 comments on commit ced1a94

Please sign in to comment.