sumitsharansatsangi

updated dependencies

... ... @@ -4,7 +4,7 @@
# This file should be version controlled.
version:
revision: 9944297138845a94256f1cf37beb88ff9a8e811a
revision: c07f7888888435fd9df505aa2efc38d3cf65681b
channel: stable
project_type: app
... ... @@ -13,26 +13,26 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- platform: android
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- platform: ios
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- platform: linux
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- platform: macos
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- platform: web
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
- platform: windows
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
create_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
base_revision: c07f7888888435fd9df505aa2efc38d3cf65681b
# User provided section
... ...
... ... @@ -7,7 +7,6 @@
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
... ...
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'en_us.dart';
import 'pt_br.dart';
import 'en_US.dart';
import 'pt_BR.dart';
class TranslationService extends Translations {
static Locale? get locale => Get.deviceLocale;
... ...
... ... @@ -15,6 +15,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetMaterialApp(
theme: ThemeData(useMaterial3: true),
debugShowCheckedModeBanner: false,
enableLog: true,
logWriterCallback: Logger.write,
... ...
... ... @@ -25,9 +25,11 @@ class CasesModel {
factory CasesModel.fromJson(Map<String, dynamic> json) => CasesModel(
message: json["Message"] as String,
global: Global.fromJson(json["Global"] as Map<String, dynamic>),
countries: List<Country>.from((json["Countries"] as Iterable).map(
(x) => Country.fromJson(x as Map<String, dynamic>),
)),
countries: json["Countries"] == null
? []
: List<Country>.from((json["Countries"] as Iterable).map(
(x) => Country.fromJson(x as Map<String, dynamic>),
)),
date: DateTime.parse(json["Date"] as String),
);
... ...
... ... @@ -18,38 +18,36 @@ class CountryView extends GetView<HomeController> {
"https://images.pexels.com/photos/3902882/pexels-photo-3902882.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"))),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 15.0, sigmaY: 15.0),
child: Container(
child: Scaffold(
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
title: Text('corona_by_country'.tr),
backgroundColor: Colors.transparent,
appBar: AppBar(
title: Text('corona_by_country'.tr),
backgroundColor: Colors.transparent,
elevation: 0,
centerTitle: true,
),
body: Center(
child: ListView.builder(
itemCount: controller.state.countries.length,
itemBuilder: (context, index) {
final country = controller.state.countries[index];
return ListTile(
onTap: () async {
//Get.rootDelegate.toNamed('/home/country');
final data = await Get.toNamed(
'/home/country/details?id=$index');
print(data);
},
trailing: CircleAvatar(
backgroundImage: NetworkImage(
"https://flagpedia.net/data/flags/normal/${country.countryCode.toLowerCase()}.png"),
),
title: Text(country.country),
subtitle: Text(
// ignore: lines_longer_than_80_chars
'${'total_infecteds'.tr}${' ${country.totalConfirmed}'}'),
);
}),
),
elevation: 0,
centerTitle: true,
),
body: Center(
child: ListView.builder(
itemCount: controller.state.countries.length,
itemBuilder: (context, index) {
final country = controller.state.countries[index];
return ListTile(
onTap: () async {
//Get.rootDelegate.toNamed('/home/country');
final data =
await Get.toNamed('/home/country/details?id=$index');
print(data);
},
trailing: CircleAvatar(
backgroundImage: NetworkImage(
"https://flagpedia.net/data/flags/normal/${country.countryCode.toLowerCase()}.png"),
),
title: Text(country.country),
subtitle: Text(
// ignore: lines_longer_than_80_chars
'${'total_infecteds'.tr}${' ${country.totalConfirmed}'}'),
);
}),
),
),
),
... ...
... ... @@ -22,70 +22,68 @@ class DetailsView extends GetView<HomeController> {
),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 15.0, sigmaY: 15.0),
child: Container(
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
title: Text('details'.tr),
backgroundColor: Colors.black12,
elevation: 0,
centerTitle: true,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'${country.country}',
style: TextStyle(fontSize: 45, fontWeight: FontWeight.bold),
),
SizedBox(
height: 35,
),
Text(
'total_confirmed'.tr,
style: TextStyle(
fontSize: 25,
),
),
Text(
'${country.totalConfirmed}',
style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold),
),
SizedBox(
height: 10,
),
Text(
'total_deaths'.tr,
style: TextStyle(
fontSize: 25,
),
),
Text(
'${country.totalDeaths}',
style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold),
),
SizedBox(
height: 10,
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
title: Text('details'.tr),
backgroundColor: Colors.black12,
elevation: 0,
centerTitle: true,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'${country.country}',
style: TextStyle(fontSize: 45, fontWeight: FontWeight.bold),
),
SizedBox(
height: 35,
),
Text(
'total_confirmed'.tr,
style: TextStyle(
fontSize: 25,
),
Text(
'total_recovered'.tr,
style: TextStyle(
fontSize: 25,
),
),
Text(
'${country.totalConfirmed}',
style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold),
),
SizedBox(
height: 10,
),
Text(
'total_deaths'.tr,
style: TextStyle(
fontSize: 25,
),
Text(
'${country.totalRecovered}',
style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold),
),
Text(
'${country.totalDeaths}',
style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold),
),
SizedBox(
height: 10,
),
Text(
'total_recovered'.tr,
style: TextStyle(
fontSize: 25,
),
TextButton(
onPressed: () {
Get.back(result: 'djsoidjsoidj');
},
child: Text('back'))
],
)),
),
),
Text(
'${country.totalRecovered}',
style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold),
),
TextButton(
onPressed: () {
Get.back(result: 'djsoidjsoidj');
},
child: Text('back'))
],
)),
),
),
);
... ...
... ... @@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.19.1 <3.0.0"
dependency_overrides:
get:
... ...
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:get_demo/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
... ...
... ... @@ -15,7 +15,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
lints: ^1.0.1
lints: ^2.0.1
# For information on the generic Dart part of this file, see the
... ...