Skip to content

Commit

Permalink
update line data and icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Lowa committed Apr 18, 2024
1 parent 094f177 commit dfcc8f7
Show file tree
Hide file tree
Showing 30 changed files with 186 additions and 203 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
.svn/
migrate_working_dir/

# here sdk
/plugins/here_sdk/

# credentials
*credentials.dart
*google-services.json
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</p>

<p align="center">
<a href='https://play.google.com/store/apps/details?id=com.lowa.navika_r&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img height="60" alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png'/></a>
<a href='https://play.google.com/store/apps/details?id=com.lowa.navika&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img height="60" alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png'/></a>
</p>

## Geting Started
Expand Down
Binary file added assets/img/icons/null.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/img/icons/sncf/inoui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/icons/sncf/inoui_color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/icons/sncf/inoui_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/icons/sncf/intercites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/icons/sncf/intercites_color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/icons/sncf/intercites_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
188 changes: 86 additions & 102 deletions lib/src/data/lines.dart

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/src/screens/schedules_departures.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class _DepartureDetailsState extends State<DepartureDetails> with SingleTickerPr
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(globals.schedulesStopName, style: appBarTitle),
if (LINES.getLinesById(departure['id']).libelle != '')
Text(LINES.getLinesById(departure['id']).libelle,
if (LINES.getLines(departure) != null && LINES.getLines(departure)!['name'] != '')
Text(LINES.getLines(departure)!['name'],
style: appBarSubtitle),
],
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/screens/settings.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

Expand Down Expand Up @@ -272,6 +271,7 @@ class _SettingsState extends State<Settings> {
color: Colors.white,
),
),

Container(
padding: const EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10),
child: const Text(
Expand Down
80 changes: 40 additions & 40 deletions lib/src/screens/trafic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,39 +242,39 @@ class _TraficState extends State<Trafic> {
child: Wrap(
children: [
TraficBlock(
name: 'TRANSILIEN H',
name: 'Transilien H',
trafic: trafic,
),
TraficBlock(
name: 'TRANSILIEN J',
name: 'Transilien J',
trafic: trafic,
),
TraficBlock(
name: 'TRANSILIEN K',
name: 'Transilien K',
trafic: trafic,
),
TraficBlock(
name: 'TRANSILIEN L',
name: 'Transilien L',
trafic: trafic,
),
TraficBlock(
name: 'TRANSILIEN N',
name: 'Transilien N',
trafic: trafic,
),
TraficBlock(
name: 'TRANSILIEN P',
name: 'Transilien P',
trafic: trafic,
),
TraficBlock(
name: 'TRANSILIEN R',
name: 'Transilien R',
trafic: trafic,
),
TraficBlock(
name: 'TRANSILIEN U',
name: 'Transilien U',
trafic: trafic,
),
TraficBlock(
name: 'TRANSILIEN V',
name: 'Transilien V',
trafic: trafic,
),
],
Expand All @@ -285,7 +285,7 @@ class _TraficState extends State<Trafic> {

divider,

// METRO
// Métro
Row(
children: [
Container(
Expand All @@ -304,67 +304,67 @@ class _TraficState extends State<Trafic> {
child: Wrap(
children: [
TraficBlock(
name: 'METRO 1',
name: 'Métro 1',
trafic: trafic,
),
TraficBlock(
name: 'METRO 2',
name: 'Métro 2',
trafic: trafic,
),
TraficBlock(
name: 'METRO 3',
name: 'Métro 3',
trafic: trafic,
),
TraficBlock(
name: 'METRO 3B',
name: 'Métro 3bis',
trafic: trafic,
),
TraficBlock(
name: 'METRO 4',
name: 'Métro 4',
trafic: trafic,
),
TraficBlock(
name: 'METRO 5',
name: 'Métro 5',
trafic: trafic,
),
TraficBlock(
name: 'METRO 6',
name: 'Métro 6',
trafic: trafic,
),
TraficBlock(
name: 'METRO 7',
name: 'Métro 7',
trafic: trafic,
),
TraficBlock(
name: 'METRO 7B',
name: 'Métro 7bis',
trafic: trafic,
),
TraficBlock(
name: 'METRO 8',
name: 'Métro 8',
trafic: trafic,
),
TraficBlock(
name: 'METRO 9',
name: 'Métro 9',
trafic: trafic,
),
TraficBlock(
name: 'METRO 10',
name: 'Métro 10',
trafic: trafic,
),
TraficBlock(
name: 'METRO 11',
name: 'Métro 11',
trafic: trafic,
),
TraficBlock(
name: 'METRO 12',
name: 'Métro 12',
trafic: trafic,
),
TraficBlock(
name: 'METRO 13',
name: 'Métro 13',
trafic: trafic,
),
TraficBlock(
name: 'METRO 14',
name: 'Métro 14',
trafic: trafic,
),
TraficBlock(
Expand Down Expand Up @@ -402,59 +402,59 @@ class _TraficState extends State<Trafic> {
child: Wrap(
children: [
TraficBlock(
name: 'T1',
name: 'Tram T1',
trafic: trafic,
),
TraficBlock(
name: 'T2',
name: 'Tram T2',
trafic: trafic,
),
TraficBlock(
name: 'T3A',
name: 'Tram T3a',
trafic: trafic,
),
TraficBlock(
name: 'T3B',
name: 'Tram T3b',
trafic: trafic,
),
TraficBlock(
name: 'T4',
name: 'Tram T4',
trafic: trafic,
),
TraficBlock(
name: 'T5',
name: 'Tram T5',
trafic: trafic,
),
TraficBlock(
name: 'T6',
name: 'Tram T6',
trafic: trafic,
),
TraficBlock(
name: 'T7',
name: 'Tram T7',
trafic: trafic,
),
TraficBlock(
name: 'T8',
name: 'Tram T8',
trafic: trafic,
),
TraficBlock(
name: 'T9',
name: 'Tram T9',
trafic: trafic,
),
TraficBlock(
name: 'T10',
name: 'Tram T10',
trafic: trafic,
),
TraficBlock(
name: 'T11',
name: 'Tram T11',
trafic: trafic,
),
TraficBlock(
name: 'T12',
name: 'Tram T12',
trafic: trafic,
),
TraficBlock(
name: 'T13',
name: 'Tram T13',
trafic: trafic,
),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/src/screens/trafic_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class _TraficDetailsState extends State<TraficDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('Info Trafic', style: appBarTitle),
if (LINES.getLinesById(globals.lineTrafic['id']).libelle != '')
Text(LINES.getLinesById(globals.lineTrafic['id']).libelle, style: appBarSubtitle),
if (LINES.getLines(globals.lineTrafic) != null && LINES.getLines(globals.lineTrafic)!['name'] != '')
Text(LINES.getLines(globals.lineTrafic)!['name'], style: appBarSubtitle),
],
),
actions: [
Expand Down
5 changes: 2 additions & 3 deletions lib/src/screens/trafic_work_schedule.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:navika/src/screens/journeys.dart';
import 'package:navika/src/screens/navigation_bar.dart';
import 'package:navika/src/style.dart';
import 'package:navika/src/data/global.dart' as globals;
import 'package:navika/src/utils.dart';
import 'package:navika/src/widgets/trafic_details/disruptions.dart';

Map shortDay = {
Expand Down Expand Up @@ -174,8 +173,8 @@ class _TraficWorkScheduleState extends State<TraficWorkSchedule> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('Calendrier des travaux', style: appBarTitle),
if (LINES.getLinesById(globals.lineTrafic['id']).libelle != '')
Text(LINES.getLinesById(globals.lineTrafic['id']).libelle, style: appBarSubtitle),
if (LINES.getLines(globals.lineTrafic) != null && LINES.getLines(globals.lineTrafic)!['name'] != '')
Text(LINES.getLines(globals.lineTrafic)!['name'], style: appBarSubtitle),
],
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ getShimmerHighlightColor(context) {

String getIconLine(Brightness brightness, line) {
if (Brightness.dark == brightness) {
return line.imageLight;
return 'assets/img/icons/${line['logo_light']}';
}
return line.imageDark;
return 'assets/img/icons/${line['logo']}';
}

Color getActiveColor(context, status) {
Expand Down
22 changes: 11 additions & 11 deletions lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,38 +61,38 @@ int getMaxLength(int max, List list) {
return list.length;
}

Map? getTraficLines(Info line) {
Map? getTraficLines(Map line) {
for (var lines in globals.trafic) {
if (lines['id'] == line.id) {
if (lines['id'] == line['id']) {
return lines;
}
}
return null;
}

Map getDefaultLine(Info line) {
Map getDefaultLine(Map line) {
return {
'id': line.id,
'code': line.name,
'name': line.libelle,
'id': line['id'],
'code': line['code'],
'name': line['name'],
'color': 'aaaaaa',
'text_color': '000000',
};
}

Map? getReports(String lineId) {
return getTraficLines(LINES.getLines(lineId))?['reports'];
return getTraficLines(LINES.getLines(lineId)!)?['reports'];
}

int? getSeverity(String lineId) {
return getTraficLines(LINES.getLines(lineId))?['severity'];
return getTraficLines(LINES.getLines(lineId)!)?['severity'];
}

String getModeImage(Brightness brightness, line) {
if (LINES.isLineById(line['id'])) {
if (LINES.getLines(line) != null && LINES.getLines(line)!['symbol'] != null) {
return Brightness.light == brightness
? LINES.getLinesById(line['id']).imageModeDark
: LINES.getLinesById(line['id']).imageModeLight;
? 'assets/img/icons/${LINES.getLines(line)!['symbol']}'
: 'assets/img/icons/${LINES.getLines(line)!['symbol_light']}';
}

String img = 'assets/img/icons/';
Expand Down
25 changes: 13 additions & 12 deletions lib/src/widgets/departures/block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,22 @@ class DeparturesBlock extends StatelessWidget {
brightness: Theme.of(context).colorScheme.brightness,
),
LinesIcones(line: line, size: 30),
Container(
SizedBox(
width: 10,
),

Text( LINES.getLinesById(line['id']).libelle,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
fontFamily: 'Segoe Ui',
color: accentColor(context),
),
maxLines: 1,
softWrap: false,
overflow: TextOverflow.fade,
)
if ( LINES.getLines(line) != null )
Text( LINES.getLines(line)!['name'],
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
fontFamily: 'Segoe Ui',
color: accentColor(context),
),
maxLines: 1,
softWrap: false,
overflow: TextOverflow.fade,
)
],
),
),
Expand Down
Loading

0 comments on commit dfcc8f7

Please sign in to comment.