Skip to content
This repository was archived by the owner on Dec 17, 2023. It is now read-only.

Commit 3ecd8e1

Browse files
committed
Trip planner favorites
1 parent c11401c commit 3ecd8e1

9 files changed

+406
-198
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Trip planner
4040
- gmaps copyright ✔
4141
- loading when fetching ✔
4242
- offline alert ✔
43-
- favourites
43+
- favourites
4444
- multiple APIs
4545

4646
Final tuches
@@ -55,3 +55,5 @@ Final tuches
5555
- agree with licence ✔
5656
- cloud save favourites like duckduckgo
5757
- rework AllStops favorites ✔
58+
- usage stats
59+
- REVIEW: <https://maps.googleapis.com/maps/api/directions/json?key=API_KEY&mode=transit&departure_time=1593079800&origin=48.13443,17.206395&destination=Hrad,Bratislava&alternatives=true&region=sk&language=sk>

lib/Actual.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:shared_preferences/shared_preferences.dart';
66
import 'locale/locales.dart';
77

88
class ActualPage extends StatefulWidget {
9+
const ActualPage({Key key}) : super(key: key);
910
@override
1011
_ActualPageState createState() => _ActualPageState();
1112
}

lib/AllStops.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:developer';
2-
31
import 'package:flutter/material.dart';
42
import 'package:diacritic/diacritic.dart';
53
import 'package:draggable_scrollbar/draggable_scrollbar.dart';
@@ -15,6 +13,7 @@ import 'widgets/settings.dart';
1513
import 'locale/locales.dart';
1614

1715
class AllStopsPage extends StatefulWidget {
16+
const AllStopsPage({Key key}) : super(key: key);
1817
@override
1918
_AllStopsState createState() => _AllStopsState();
2019
}
@@ -24,7 +23,6 @@ class _AllStopsState extends State<AllStopsPage> {
2423
List<Stop> saved = List<Stop>();
2524
List<Stop> favorites = List<Stop>();
2625
List<Stop> _stopsForDisplay = List<Stop>();
27-
List<Stop> _savedForDisplay = List<Stop>();
2826
List<Stop> _favoritesForDisplay = List<Stop>();
2927
File stopsFile;
3028
File savedFile;
@@ -95,8 +93,8 @@ class _AllStopsState extends State<AllStopsPage> {
9593
// return a.name.toLowerCase().compareTo(b.name.toLowerCase());
9694
// });
9795
int i, s;
98-
for (i = 0; i < favorites.length; i++){
99-
for (s = 0; s < stops.length; s++){
96+
for (i = 0; i < favorites.length; i++) {
97+
for (s = 0; s < stops.length; s++) {
10098
if (favorites[i].id == stops[s].id) {
10199
_favoritesForDisplay.add(stops[s]);
102100
}
@@ -282,13 +280,13 @@ class _AllStopsState extends State<AllStopsPage> {
282280
child: Column(
283281
children: <Widget>[
284282
Padding(
285-
padding: const EdgeInsets.only(left:16.0, top: 4.0, bottom: 4.0),
283+
padding: const EdgeInsets.only(left: 16.0, top: 4.0, bottom: 4.0),
286284
child: Flex(
287-
direction: Axis.horizontal,
285+
direction: Axis.horizontal,
288286
mainAxisAlignment: MainAxisAlignment.spaceBetween,
289287
children: <Widget>[
290288
Expanded(
291-
child: Text(
289+
child: Text(
292290
_stopsForDisplay[index].name,
293291
overflow: TextOverflow.ellipsis,
294292
style: TextStyle(fontSize: 17.5, fontWeight: FontWeight.normal),

lib/NearMe.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import 'widgets/stopList.dart';
1313
import 'locale/locales.dart';
1414

1515
class NearMePage extends StatefulWidget {
16+
const NearMePage({Key key}) : super(key: key);
1617
@override
1718
_NearMeState createState() => _NearMeState();
1819
}

0 commit comments

Comments
 (0)