Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
22_23-J 50
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23-J 50
22_23-J 50
Commits
56a374f9
Commit
56a374f9
authored
Jan 29, 2023
by
Yasiru-Deshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add map UI to the app
parent
e14a85aa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
93 deletions
+81
-93
Frontend/look_ai/android/app/build.gradle
Frontend/look_ai/android/app/build.gradle
+1
-1
Frontend/look_ai/ios/Runner/AppDelegate.swift
Frontend/look_ai/ios/Runner/AppDelegate.swift
+3
-1
Frontend/look_ai/lib/main.dart
Frontend/look_ai/lib/main.dart
+40
-91
Frontend/look_ai/pubspec.lock
Frontend/look_ai/pubspec.lock
+36
-0
Frontend/look_ai/pubspec.yaml
Frontend/look_ai/pubspec.yaml
+1
-0
No files found.
Frontend/look_ai/android/app/build.gradle
View file @
56a374f9
...
...
@@ -8,7 +8,7 @@ if (localPropertiesFile.exists()) {
def
flutterRoot
=
localProperties
.
getProperty
(
'flutter.sdk'
)
if
(
flutterRoot
==
null
)
{
throw
new
Gradle
Exception
(
"Flutter SDK not found. Define location with flutter.sdk in the local.properties file."
)
throw
new
FileNotFound
Exception
(
"Flutter SDK not found. Define location with flutter.sdk in the local.properties file."
)
}
def
flutterVersionCode
=
localProperties
.
getProperty
(
'flutter.versionCode'
)
...
...
Frontend/look_ai/ios/Runner/AppDelegate.swift
View file @
56a374f9
import
UIKit
import
Flutter
import
GoogleMaps
@UIApplicationMain
@objc
class
AppDelegate
:
FlutterAppDelegate
{
...
...
@@ -7,7 +8,8 @@ import Flutter
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?
)
->
Bool
{
GMSServices
.
provideAPIKey
(
"AIzaSyDVIdYvuHrcQKg5Nm4NqEkhEJgvT93epXQ"
)
GeneratedPluginRegistrant
.
register
(
with
:
self
)
return
super
.
application
(
application
,
didFinishLaunchingWithOptions
:
launchOptions
)
}
}
}
\ No newline at end of file
Frontend/look_ai/lib/main.dart
View file @
56a374f9
import
'dart:async'
;
import
'package:flutter/material.dart'
;
import
'package:google_maps_flutter/google_maps_flutter.dart'
;
void
main
(
)
{
runApp
(
MyApp
());
}
void
main
(
)
=>
runApp
(
MyApp
());
class
MyApp
extends
StatelessWidget
{
// This widget is the root of your application.
class
MyApp
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
){
return
MaterialApp
(
title:
'Flutter Demo'
,
theme:
ThemeData
(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch:
Colors
.
blue
,
),
home:
MyHomePage
(
title:
'Flutter Demo Home Page'
),
title:
'Flutter Google Maps Demo'
,
home:
MapSample
(),
);
}
}
class
MyHomePage
extends
StatefulWidget
{
MyHomePage
({
Key
?
key
,
required
this
.
title
})
:
super
(
key:
key
);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final
String
title
;
class
MapSample
extends
StatefulWidget
{
const
MapSample
({
Key
?
key
})
:
super
(
key:
key
);
@override
_MyHomePageState
createState
()
=>
_MyHomePag
eState
();
State
<
MapSample
>
createState
()
=>
MapSampl
eState
();
}
class
_MyHomePageState
extends
State
<
MyHomePage
>
{
int
_counter
=
0
;
class
MapSampleState
extends
State
<
MapSample
>
{
final
Completer
<
GoogleMapController
>
_controller
=
Completer
<
GoogleMapController
>();
void
_incrementCounter
()
{
setState
(()
{
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter
++;
});
}
static
const
CameraPosition
_kGooglePlex
=
CameraPosition
(
target:
LatLng
(
37.42796133580664
,
-
122.085749655962
),
zoom:
14.4746
,
);
static
const
CameraPosition
_kLake
=
CameraPosition
(
bearing:
192.8334901395799
,
target:
LatLng
(
37.43296265331129
,
-
122.08832357078792
),
tilt:
59.440717697143555
,
zoom:
19.151926040649414
);
@override
Widget
build
(
BuildContext
context
)
{
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return
Scaffold
(
appBar:
AppBar
(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title:
Text
(
widget
.
title
),
body:
GoogleMap
(
mapType:
MapType
.
hybrid
,
initialCameraPosition:
_kGooglePlex
,
onMapCreated:
(
GoogleMapController
controller
)
{
_controller
.
complete
(
controller
);
},
),
body:
Center
(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child:
Column
(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
'You have pushed the button this many times:'
,
),
Text
(
'
$_counter
'
,
style:
Theme
.
of
(
context
).
textTheme
.
headline4
,
),
],
),
floatingActionButton:
FloatingActionButton
.
extended
(
onPressed:
_goToTheLake
,
label:
const
Text
(
'To the lake!'
),
icon:
const
Icon
(
Icons
.
directions_boat
),
),
floatingActionButton:
FloatingActionButton
(
onPressed:
_incrementCounter
,
tooltip:
'Increment'
,
child:
Icon
(
Icons
.
add
),
),
// This trailing comma makes auto-formatting nicer for build methods.
);
}
}
Future
<
void
>
_goToTheLake
()
async
{
final
GoogleMapController
controller
=
await
_controller
.
future
;
controller
.
animateCamera
(
CameraUpdate
.
newCameraPosition
(
_kLake
));
}
}
\ No newline at end of file
Frontend/look_ai/pubspec.lock
View file @
56a374f9
...
...
@@ -62,11 +62,32 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.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.5"
matcher:
dependency: transitive
description:
...
...
@@ -88,6 +109,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
sky_engine:
dependency: transitive
description: flutter
...
...
@@ -114,6 +142,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
stream_transform:
dependency: transitive
description:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
string_scanner:
dependency: transitive
description:
...
...
@@ -151,3 +186,4 @@ packages:
version: "2.1.0"
sdks:
dart: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"
Frontend/look_ai/pubspec.yaml
View file @
56a374f9
...
...
@@ -28,6 +28,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons
:
^1.0.2
google_maps_flutter
:
^2.0.9
dev_dependencies
:
flutter_test
:
...
...
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