Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
sumitsharansatsangi
2023-02-25 18:24:07 +0530
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
649341afe4694ecf876b495d581dd13552364d6b
649341af
1 parent
0b9ec13f
updated dependencies
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
142 additions
and
115 deletions
example/.metadata
example/analysis_options.yaml
example/lib/lang/translation_service.dart
example/lib/main.dart
example/lib/pages/home/domain/entity/cases_model.dart
example/lib/pages/home/presentation/views/country_view.dart
example/lib/pages/home/presentation/views/details_view.dart
example/pubspec.yaml
example/test/widget_test.dart
pubspec.yaml
example/.metadata
View file @
649341a
...
...
@@ -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
...
...
example/analysis_options.yaml
View file @
649341a
...
...
@@ -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
...
...
example/lib/lang/translation_service.dart
View file @
649341a
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
;
...
...
example/lib/main.dart
View file @
649341a
...
...
@@ -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
,
...
...
example/lib/pages/home/domain/entity/cases_model.dart
View file @
649341a
...
...
@@ -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
),
);
...
...
example/lib/pages/home/presentation/views/country_view.dart
View file @
649341a
...
...
@@ -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}
'
}
'),
);
}),
),
),
),
...
...
example/lib/pages/home/presentation/views/details_view.dart
View file @
649341a
...
...
@@ -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'
))
],
)),
),
),
);
...
...
example/pubspec.yaml
View file @
649341a
...
...
@@ -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.1
2.0
<3.0.0"
sdk
:
"
>=2.1
9.1
<3.0.0"
dependency_overrides
:
get
:
...
...
example/test/widget_test.dart
0 → 100644
View file @
649341a
// 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
);
});
}
...
...
pubspec.yaml
View file @
649341a
...
...
@@ -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
...
...
Please
register
or
login
to post a comment