Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Apus Drones
apus-drones-frontend
Commits
3c738d6a
Commit
3c738d6a
authored
3 years ago
by
bvinicius
Browse files
Options
Download
Email Patches
Plain Diff
Inicializa o componente do GoogleMaps
parent
7dd561b5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
android/app/build.gradle
+1
-1
android/app/build.gradle
android/app/src/main/AndroidManifest.xml
+2
-0
android/app/src/main/AndroidManifest.xml
lib/models/OrderModel.dart
+1
-1
lib/models/OrderModel.dart
lib/screens/OrderDetailScreen.dart
+56
-7
lib/screens/OrderDetailScreen.dart
lib/widgets/MapView.dart
+28
-0
lib/widgets/MapView.dart
pubspec.lock
+28
-0
pubspec.lock
pubspec.yaml
+4
-2
pubspec.yaml
with
120 additions
and
11 deletions
+120
-11
android/app/build.gradle
View file @
3c738d6a
...
...
@@ -35,7 +35,7 @@ android {
defaultConfig
{
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId
"com.example.apus_drones_mobile"
minSdkVersion
16
minSdkVersion
20
targetSdkVersion
30
versionCode
flutterVersionCode
.
toInteger
()
versionName
flutterVersionName
...
...
This diff is collapsed.
Click to expand it.
android/app/src/main/AndroidManifest.xml
View file @
3c738d6a
...
...
@@ -37,5 +37,7 @@
<meta-data
android:name=
"flutterEmbedding"
android:value=
"2"
/>
<meta-data
android:name=
"com.google.android.geo.API_KEY"
android:value=
"YOUR KEY HERE"
/>
</application>
</manifest>
This diff is collapsed.
Click to expand it.
lib/models/OrderModel.dart
View file @
3c738d6a
...
...
@@ -10,7 +10,7 @@ class OrderModel {
final
int
id
;
final
PartnerModel
partner
;
final
CustomerModel
customer
;
final
String
status
;
String
status
;
final
DateTime
createdAt
;
final
double
deliveryPrice
;
final
List
<
OrderItemModel
>
items
;
...
...
This diff is collapsed.
Click to expand it.
lib/screens/OrderDetailScreen.dart
View file @
3c738d6a
import
'package:apus_drones_mobile/constants/OrderStatus.dart'
;
import
'package:apus_drones_mobile/constants/UserType.dart'
;
import
'package:apus_drones_mobile/constants/Constants.dart'
;
import
'package:apus_drones_mobile/models/OrderItemModel.dart'
;
...
...
@@ -5,7 +6,7 @@ import 'package:apus_drones_mobile/models/OrderModel.dart';
import
'package:apus_drones_mobile/screens/Appbar.dart'
;
import
'package:apus_drones_mobile/widgets/BotNavBar.dart'
;
import
'package:apus_drones_mobile/widgets/Fee.dart'
;
import
'package:apus_drones_mobile/widgets/
Header
.dart'
;
import
'package:apus_drones_mobile/widgets/
MapView
.dart'
;
import
'package:apus_drones_mobile/widgets/Price.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
...
...
@@ -28,15 +29,17 @@ class OrderDetailScreen extends StatelessWidget {
child:
SingleChildScrollView
(
child:
Center
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
20.0
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
20.0
,
horizontal:
10.0
),
child:
Column
(
children:
[
Chip
(
label:
Text
(
this
.
model
.
status
),
backgroundColor:
Colors
.
green
.
shade100
,
shape:
RoundedRectangleBorder
(
side:
BorderSide
(
color:
Colors
.
green
),
borderRadius:
BorderRadius
.
circular
(
16
))),
label:
Text
(
this
.
model
.
status
),
backgroundColor:
Colors
.
green
.
shade100
,
shape:
RoundedRectangleBorder
(
side:
BorderSide
(
color:
Colors
.
green
),
borderRadius:
BorderRadius
.
circular
(
16
)),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
30
),
margin:
EdgeInsets
.
symmetric
(
vertical:
35
),
...
...
@@ -65,6 +68,7 @@ class OrderDetailScreen extends StatelessWidget {
style:
TextStyle
(
fontSize:
20
))),
),
),
getOrderMap
(),
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8.0
),
child:
Column
(
...
...
@@ -101,6 +105,51 @@ class OrderDetailScreen extends StatelessWidget {
return
this
.
model
.
items
.
fold
(
0
,
(
acc
,
item
)
=>
item
.
price
+
acc
);
}
Widget
getOrderMap
()
{
final
statusesWithMap
=
[
OrderStatus
.
IN_FLIGHT
.
toString
(),
OrderStatus
.
DELIVERED
.
toString
(),
model
.
status
];
Widget
content
=
statusesWithMap
.
contains
(
this
.
model
.
status
)
?
this
.
mapWidget
()
:
this
.
beforeMapTextWidget
();
return
Container
(
child:
content
,
margin:
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
32
),
);
}
Widget
mapWidget
()
{
return
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10
)),
child:
MapView
(),
);
}
Widget
beforeMapTextWidget
()
{
return
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10
),
color:
Color
(
0xffF1F1F1
)),
child:
Padding
(
padding:
EdgeInsets
.
all
(
16
),
child:
Center
(
child:
Text
(
"assim que seu pedido for coletado por um de nossos drones você poderá acompanhar a entrega em tempo real aqui"
,
style:
TextStyle
(
fontStyle:
FontStyle
.
italic
,
color:
Color
.
fromRGBO
(
61
,
61
,
61
,
0.75
),
fontSize:
18
,
letterSpacing:
1.25
,
),
textAlign:
TextAlign
.
center
,
),
),
));
}
ListTile
_renderProduct
(
OrderItemModel
item
)
{
return
ListTile
(
title:
Text
(
item
.
product
.
name
,
style:
TextStyle
(
fontSize:
20
)),
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/MapView.dart
0 → 100644
View file @
3c738d6a
import
'package:flutter/cupertino.dart'
;
import
'package:google_maps_flutter/google_maps_flutter.dart'
;
class
MapView
extends
StatefulWidget
{
final
double
width
;
final
double
height
;
const
MapView
({
this
.
width
=
double
.
infinity
,
this
.
height
=
250
});
@override
_MapViewState
createState
()
=>
_MapViewState
();
}
class
_MapViewState
extends
State
<
MapView
>
{
static
final
CameraPosition
_kGooglePlex
=
CameraPosition
(
target:
LatLng
(
37.42796133580664
,
-
122.085749655962
),
zoom:
14.4746
,
);
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
this
.
widget
.
width
,
height:
this
.
widget
.
height
,
child:
GoogleMap
(
initialCameraPosition:
_kGooglePlex
),
);
}
}
This diff is collapsed.
Click to expand it.
pubspec.lock
View file @
3c738d6a
...
...
@@ -268,6 +268,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
google_maps:
dependency: "direct main"
description:
name: google_maps
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.0"
google_maps_flutter:
dependency: "direct main"
description:
name: google_maps_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.9"
google_maps_flutter_platform_interface:
dependency: transitive
description:
name: google_maps_flutter_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
graphs:
dependency: transitive
description:
...
...
@@ -317,6 +338,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
js_wrapping:
dependency: transitive
description:
name: js_wrapping
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.3"
json_annotation:
dependency: "direct main"
description:
...
...
This diff is collapsed.
Click to expand it.
pubspec.yaml
View file @
3c738d6a
...
...
@@ -39,6 +39,8 @@ dependencies:
carousel_slider
:
^4.0.0
shared_preferences
:
"
^2.0.7"
jwt_decoder
:
^2.0.1
google_maps
:
"
5.3.0"
google_maps_flutter
:
^2.0.9
dev_dependencies
:
build_runner
:
^2.1.2
...
...
@@ -54,8 +56,8 @@ flutter:
# the material Icons class.
uses-material-design
:
true
assets
:
-
lib/assets/icons/drone_icon.png
-
lib/assets/img/logo.png
-
lib/assets/icons/drone_icon.png
-
lib/assets/img/logo.png
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help