maps api implementation started
This commit is contained in:
parent
cf6753363c
commit
19021a9a09
8 changed files with 59 additions and 3 deletions
|
@ -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...");
|
||||
|
|
Reference in a new issue