From 19021a9a09420365255fbe7313a9eabc73b02af8 Mon Sep 17 00:00:00 2001 From: Felix Date: Wed, 21 Aug 2019 12:35:21 +0100 Subject: [PATCH] maps api implementation started --- .gitignore | 3 ++- android/app/src/main/AndroidManifest.xml | 5 ++++ ios/Runner/Info.plist | 2 ++ lib/pages/home_page.dart | 10 ++++++++ lib/pages/map_page.dart | 32 ++++++++++++++++++++++++ lib/pages/receipt_page_2.dart | 2 -- pubspec.lock | 7 ++++++ pubspec.yaml | 1 + 8 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 lib/pages/map_page.dart diff --git a/.gitignore b/.gitignore index 228c2c7..6f22238 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +# End of https://www.gitignore.io/api/android,flutter,androidstudio +lib/common/felixApiCreds.dart diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 7949887..ccadded 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -30,6 +30,11 @@ + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index fd153b8..b9f4528 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -47,5 +47,7 @@ UIViewControllerBasedStatusBarAppearance + io.flutter.embedded_views_preview + diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 37c1970..2c7d3d4 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -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 { int _selectedIndex = 0; + static const TextStyle optionStyle = TextStyle(fontSize: 30, fontWeight: FontWeight.bold); static List _widgetOptions = [ ReceiptPage2(), StatsPage(), + MapPage(), MorePage() ]; @@ -40,6 +43,8 @@ class _HomePageState extends State { @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 { 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, ), diff --git a/lib/pages/map_page.dart b/lib/pages/map_page.dart new file mode 100644 index 0000000..f15c25d --- /dev/null +++ b/lib/pages/map_page.dart @@ -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 { + @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); + } +} \ No newline at end of file diff --git a/lib/pages/receipt_page_2.dart b/lib/pages/receipt_page_2.dart index 526c33b..81b9ce1 100644 --- a/lib/pages/receipt_page_2.dart +++ b/lib/pages/receipt_page_2.dart @@ -100,8 +100,6 @@ class ReceiptPage2State extends State { 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> _futureCats = getCats(); _categories.add("Fetching categories..."); diff --git a/pubspec.lock b/pubspec.lock index 8db997c..b6850bf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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 diff --git a/pubspec.yaml b/pubspec.yaml index 385c2e0..ecc6222 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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