maps api implementation started
This commit is contained in:
parent
cf6753363c
commit
19021a9a09
8 changed files with 59 additions and 3 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -234,4 +234,5 @@ fabric.properties
|
|||
!**/ios/**/default.perspectivev3
|
||||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
||||
|
||||
# End of https://www.gitignore.io/api/android,flutter,androidstudio
|
||||
# End of https://www.gitignore.io/api/android,flutter,androidstudio
|
||||
lib/common/felixApiCreds.dart
|
||||
|
|
|
@ -30,6 +30,11 @@
|
|||
<meta-data
|
||||
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
|
||||
android:value="true" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.android.geo.API_KEY"
|
||||
android:value="API KEY HERE" />
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
|
|
|
@ -47,5 +47,7 @@
|
|||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>io.flutter.embedded_views_preview</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:local_spend/pages/receipt_page_2.dart';
|
||||
import 'package:local_spend/pages/more_page.dart';
|
||||
import 'package:local_spend/pages/stats_page.dart';
|
||||
import 'package:local_spend/pages/map_page.dart';
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
static String _title = 'Text here';
|
||||
|
@ -24,11 +25,13 @@ class HomePageWidget extends StatefulWidget {
|
|||
|
||||
class _HomePageState extends State<HomePageWidget> {
|
||||
int _selectedIndex = 0;
|
||||
|
||||
static const TextStyle optionStyle =
|
||||
TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
|
||||
static List<Widget> _widgetOptions = <Widget>[
|
||||
ReceiptPage2(),
|
||||
StatsPage(),
|
||||
MapPage(),
|
||||
MorePage()
|
||||
];
|
||||
|
||||
|
@ -40,6 +43,8 @@ class _HomePageState extends State<HomePageWidget> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var _itemText = TextStyle(color: Colors.grey[400]);
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: _widgetOptions.elementAt(_selectedIndex),
|
||||
|
@ -54,12 +59,17 @@ class _HomePageState extends State<HomePageWidget> {
|
|||
icon: Icon(Icons.show_chart),
|
||||
title: Text('Statistics'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.map),
|
||||
title: Text('Locations'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.more_horiz),
|
||||
title: Text('More'),
|
||||
),
|
||||
],
|
||||
currentIndex: _selectedIndex,
|
||||
unselectedItemColor: Colors.grey[400],
|
||||
selectedItemColor: Colors.blue[400],
|
||||
onTap: _onItemTapped,
|
||||
),
|
||||
|
|
32
lib/pages/map_page.dart
Normal file
32
lib/pages/map_page.dart
Normal file
|
@ -0,0 +1,32 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_maps/flutter_maps.dart';
|
||||
import 'package:local_spend/common/felixApiCreds.dart';
|
||||
|
||||
class MapPage extends StatefulWidget {
|
||||
MapPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MapPageState createState() {
|
||||
return _MapPageState();
|
||||
}
|
||||
}
|
||||
|
||||
class _MapPageState extends State<MapPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var fac = new FelixApiCreds();
|
||||
|
||||
// TODO: implement build
|
||||
return Text(fac.mapsApiKey);
|
||||
}
|
||||
}
|
|
@ -100,8 +100,6 @@ class ReceiptPage2State extends State<ReceiptPage2> {
|
|||
|
||||
var _widgetHeight = MediaQuery.of(context).size.height * 0.06 < 40.0 ? 40.0 : MediaQuery.of(context).size.height * 0.06;
|
||||
|
||||
debugPrint(_widgetHeight.toString());
|
||||
|
||||
if (_categories.length == 0) {
|
||||
Future<List<String>> _futureCats = getCats();
|
||||
_categories.add("Fetching categories...");
|
||||
|
|
|
@ -193,6 +193,13 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_maps:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_maps
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
|
|
|
@ -26,6 +26,7 @@ dependencies:
|
|||
flutter_fadein: ^1.1.1
|
||||
charts_flutter: ^0.6.0
|
||||
simple_animations: ^1.3.3
|
||||
flutter_maps: ^0.1.0
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^0.1.2
|
||||
|
|
Reference in a new issue