diff --git a/README.md b/README.md index 0b5c1cf..cf62f62 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# mileograph_sbb_flutter +# mileograph_flutter A new Flutter project. diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index c5c908d..c6a85e8 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "com.example.mileograph_sbb_flutter" + namespace = "com.example.mileograph_flutter" compileSdk = flutter.compileSdkVersion ndkVersion = "27.0.12077973" @@ -21,7 +21,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.example.mileograph_sbb_flutter" + applicationId = "com.example.mileograph_flutter" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 60c3c20..7772c02 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - mileograph_sbb_flutter + mileograph_flutter CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/components/calculator/calculator.dart b/lib/components/calculator/calculator.dart new file mode 100644 index 0000000..3048a49 --- /dev/null +++ b/lib/components/calculator/calculator.dart @@ -0,0 +1,286 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:mileograph_flutter/objects/objects.dart'; +import 'package:mileograph_flutter/services/apiService.dart'; +import 'package:mileograph_flutter/services/dataService.dart'; +import './routeSummaryWidget.dart'; + +class RouteCalculatorLoader extends StatelessWidget { + const RouteCalculatorLoader({super.key}); + + @override + Widget build(BuildContext context) { + final data = context.read(); + + return FutureBuilder>( + future: data.fetchStations(), + builder: (context, snapshot) { + if (snapshot.connectionState != ConnectionState.done) { + return const Center(child: CircularProgressIndicator()); + } + + if (snapshot.hasError) { + return Center(child: Text('Error: ${snapshot.error}')); + } + + final stations = snapshot.data!; + return RouteCalculator(allStations: stations); + }, + ); + } +} + +class StationAutocomplete extends StatefulWidget { + const StationAutocomplete({ + super.key, + required this.allStations, + this.initialValue, + required this.onChanged, + }); + + final List allStations; + final String? initialValue; + final ValueChanged onChanged; + + @override + State createState() => _StationAutocompleteState(); +} + +class _StationAutocompleteState extends State { + late final TextEditingController _controller; + + // Simulated list of over 10,000 stations + final List stations = List.generate(10000, (i) => 'Station $i'); + + @override + void initState() { + super.initState(); + _controller = TextEditingController(text: widget.initialValue ?? ''); + _controller.addListener(() { + widget.onChanged(_controller.text); + }); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Autocomplete( + optionsBuilder: (TextEditingValue textEditingValue) { + if (textEditingValue.text.isEmpty) { + return const Iterable.empty(); + } + final query = textEditingValue.text.toLowerCase(); + final matches = widget.allStations + .map((s) => s.name) + .where((name) => name.toLowerCase().contains(query)) + .toList(); + + matches.sort((a, b) => a.length.compareTo(b.length)); + + return matches.take(10); + }, + onSelected: (String selection) { + _controller.text = selection; + widget.onChanged(selection); + }, + fieldViewBuilder: + (context, textEditingController, focusNode, onFieldSubmitted) { + textEditingController.value = _controller.value; + return TextField( + controller: textEditingController, + focusNode: focusNode, + decoration: const InputDecoration( + labelText: 'Select station', + border: OutlineInputBorder(), + ), + ); + }, + ); + } +} + +class RouteCalculator extends StatefulWidget { + final List allStations; + + const RouteCalculator({super.key, required this.allStations}); + + @override + State createState() => _RouteCalculatorState(); +} + +class _RouteCalculatorState extends State { + List stations = ['']; + + RouteResult? _routeResult; + RouteResult? get result => _routeResult; + String? _errorMessage; + + bool _showDetails = false; + + Future _calculateRoute(List stations) async { + setState(() { + _errorMessage = null; + _routeResult = null; + }); + final api = context.read(); // context is valid here + final res = await api.post('/route/distance2', { + 'route': stations.where((s) => s.trim().isNotEmpty).toList(), + }); + + if (res['error'] == false) { + setState(() { + _routeResult = RouteResult.fromJson(res); + }); + } else { + setState(() { + _errorMessage = + RouteError.fromJson(res["error_obj"][0]).msg ?? + 'Unknown error occurred'; + }); + } + } + + void _addStation() { + setState(() { + stations.add(''); + }); + } + + void _removeStation(int index) { + setState(() { + stations.removeAt(index); + }); + } + + void _updateStation(int index, String value) { + setState(() { + stations[index] = value; + }); + } + + @override + Widget build(BuildContext context) { + if (_showDetails && _routeResult != null) { + return RouteDetailsView( + route: _routeResult!.calculatedRoute, + costs: _routeResult!.costs, + onBack: () => setState(() => _showDetails = false), + ); + } + return Column( + children: [ + Expanded( + child: ReorderableListView( + padding: const EdgeInsets.symmetric(vertical: 8), + onReorder: (oldIndex, newIndex) { + if (newIndex > oldIndex) newIndex -= 1; + setState(() { + final moved = stations.removeAt(oldIndex); + stations.insert(newIndex, moved); + }); + }, + children: List.generate(stations.length, (index) { + return Container( + key: ValueKey('$index-${stations[index]}'), + margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 4), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ReorderableDragStartListener( + index: index, + child: const Padding( + padding: EdgeInsets.only(top: 16), + child: Icon(Icons.drag_indicator), + ), + ), + const SizedBox(width: 8), + Expanded( + child: Card( + child: Padding( + padding: const EdgeInsets.all(12), + child: Row( + children: [ + Expanded( + child: StationAutocomplete( + allStations: widget.allStations, + initialValue: stations[index], + onChanged: (val) => + _updateStation(index, val), + ), + ), + IconButton( + icon: const Icon(Icons.close), + onPressed: () => _removeStation(index), + ), + ], + ), + ), + ), + ), + ], + ), + ); + }), + ), + ), + if (_errorMessage != null) + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + _errorMessage!, + style: TextStyle(color: Theme.of(context).colorScheme.error), + ), + ) + else if (_routeResult != null) + RouteSummaryWidget( + distance: _routeResult!.distance, + onDetailsPressed: () => setState(() => _showDetails = true), + ) + else + SizedBox.shrink(), + const SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton.icon( + icon: const Icon(Icons.add), + label: const Text('Add Station'), + onPressed: _addStation, + ), + const SizedBox(width: 16), + ElevatedButton.icon( + icon: const Icon(Icons.route), + label: const Text('Calculate Route'), + onPressed: () async { + await _calculateRoute(stations); + }, + ), + ], + ), + const SizedBox(height: 16), + ], + ); + } +} + +Widget debugPanel(List stations) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + child: Wrap( + crossAxisAlignment: WrapCrossAlignment.center, + spacing: 8, + children: [ + const Text( + 'Current Order:', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ...stations.map((s) => Chip(label: Text(s.isEmpty ? '' : s))), + ], + ), + ); +} diff --git a/lib/components/calculator/routeSummaryWidget.dart b/lib/components/calculator/routeSummaryWidget.dart new file mode 100644 index 0000000..a4eacd2 --- /dev/null +++ b/lib/components/calculator/routeSummaryWidget.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; + +class RouteSummaryWidget extends StatelessWidget { + final double distance; + final VoidCallback onDetailsPressed; + + const RouteSummaryWidget({ + super.key, + required this.distance, + required this.onDetailsPressed, + }); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(16), + child: Row( + children: [ + Expanded( + child: Text( + "Total Distance: ${distance.toStringAsFixed(2)} mi", + style: Theme.of(context).textTheme.titleMedium, + ), + ), + TextButton( + onPressed: onDetailsPressed, + child: const Text("View Details"), + ), + ], + ), + ); + } +} + +class RouteDetailsView extends StatelessWidget { + final List route; + final List costs; + final VoidCallback onBack; + + const RouteDetailsView({ + super.key, + required this.route, + required this.costs, + required this.onBack, + }); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Align( + alignment: Alignment.centerLeft, + child: TextButton.icon( + onPressed: onBack, + icon: const Icon(Icons.arrow_back), + label: const Text('Back'), + ), + ), + Expanded( + child: ListView.builder( + itemCount: route.length, + itemBuilder: (context, index) { + return ListTile( + title: Text(route[index]), + trailing: Text("${costs[index].toStringAsFixed(2)} mi"), + ); + }, + ), + ), + ], + ); + } +} diff --git a/lib/components/dashboard/topTractionPanel.dart b/lib/components/dashboard/topTractionPanel.dart index f400e22..1ce3b91 100644 --- a/lib/components/dashboard/topTractionPanel.dart +++ b/lib/components/dashboard/topTractionPanel.dart @@ -21,52 +21,53 @@ class TopTractionPanel extends StatelessWidget { ), ), Column( - children: List.generate(data.homepageStats?.topLocos.length ?? 0, ( - index, - ) { - final loco = data.homepageStats!.topLocos[index]; - return Container( - width: double.infinity, - child: Container( - margin: EdgeInsets.symmetric(horizontal: 0, vertical: 8), - child: Padding( - padding: EdgeInsets.all(8), + children: List.generate( + data.homepageStats?.topLocos.length ?? 0, + (index) { + final loco = data.homepageStats!.topLocos[index]; + return Container( + width: double.infinity, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 0, vertical: 8), + child: Padding( + padding: EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text.rich( - TextSpan( - children: [ - TextSpan( - text: '${index + 1}. ', - style: TextStyle( - fontWeight: FontWeight.bold, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: '${index + 1}. ', + style: TextStyle( + fontWeight: FontWeight.bold, + ), ), - ), - TextSpan( - text: - '${loco.locoClass} ${loco.locoNumber}', - ), - ], + TextSpan( + text: + '${loco.locoClass} ${loco.number}', + ), + ], + ), ), - ), - Text( - '${loco.locoName}', - style: TextStyle(fontStyle: FontStyle.italic), - ), - ], - ), - Text('${loco.locoMileage?.toStringAsFixed(1)} mi'), - ], + Text( + '${loco.name}', + style: TextStyle(fontStyle: FontStyle.italic), + ), + ], + ), + Text('${loco.mileage?.toStringAsFixed(1)} mi'), + ], + ), ), ), - ), - ); - }), + ); + }, + ), ), ], ), diff --git a/lib/components/login/login.dart b/lib/components/login/login.dart index 229e693..42808eb 100644 --- a/lib/components/login/login.dart +++ b/lib/components/login/login.dart @@ -19,12 +19,22 @@ class LoginScreen extends StatelessWidget { Text.rich( TextSpan( children: [ - TextSpan(text: "Mile"), + TextSpan( + text: "Mile", + style: TextStyle( + color: Theme.of(context).textTheme.bodyLarge?.color, + ), + ), TextSpan( text: "O", style: TextStyle(color: Colors.red), ), - TextSpan(text: "graph"), + TextSpan( + text: "graph", + style: TextStyle( + color: Theme.of(context).textTheme.bodyLarge?.color, + ), + ), ], style: TextStyle( decoration: TextDecoration.none, diff --git a/lib/components/pages/calculator.dart b/lib/components/pages/calculator.dart new file mode 100644 index 0000000..5f5c083 --- /dev/null +++ b/lib/components/pages/calculator.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; +import 'package:mileograph_flutter/components/calculator/calculator.dart'; +import 'package:provider/provider.dart'; +import 'package:mileograph_flutter/services/dataService.dart'; + +class CalculatorPage extends StatelessWidget { + Widget build(BuildContext context) { + return RouteCalculatorLoader(); + } +} diff --git a/lib/components/pages/traction.dart b/lib/components/pages/traction.dart index 4def901..eceaa7a 100644 --- a/lib/components/pages/traction.dart +++ b/lib/components/pages/traction.dart @@ -14,7 +14,7 @@ class TractionPage extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: Padding( padding: EdgeInsets.all(16), - child: Text('${loco.locoClass} ${loco.locoNumber}'), + child: Text('${loco.locoClass} ${loco.number}'), ), ); }, diff --git a/lib/main.dart b/lib/main.dart index 52ac872..9fefb34 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:dynamic_color/dynamic_color.dart'; +import 'package:mileograph_flutter/components/pages/calculator.dart'; import 'package:mileograph_flutter/components/pages/traction.dart'; import 'package:provider/provider.dart'; @@ -124,7 +125,7 @@ class _MyHomePageState extends State { int pageIndex = 0; final List contentPages = [ Dashboard(), - Center(child: Text("Calculator Page")), + CalculatorPage(), LegsPage(), TractionPage(), Center(child: Text("Trips Page")), diff --git a/lib/objects/objects.dart b/lib/objects/objects.dart index e70bfe3..80a9e6c 100644 --- a/lib/objects/objects.dart +++ b/lib/objects/objects.dart @@ -81,37 +81,71 @@ class YearlyMileage { ); } -class LocoSummary { - final String locoType, locoClass, locoNumber, locoName, locoOperator; - final String? locoNotes, locoEvn; - final int locoId; - final int? locoJourneys; - final double? locoMileage; +class Loco { + final int id; + final String type, number, locoClass; + final String? name, operator, notes, evn; - LocoSummary({ - required this.locoType, + Loco({ + required this.id, + required this.type, + required this.number, + required this.name, required this.locoClass, - required this.locoNumber, - required this.locoName, - required this.locoOperator, - this.locoNotes, - this.locoEvn, - required this.locoId, - this.locoMileage, - this.locoJourneys, + required this.operator, + this.notes, + this.evn, }); - factory LocoSummary.fromJson(Map json) => LocoSummary( - locoType: json['loco_type'], + factory Loco.fromJson(Map json) => Loco( + id: json['loco_id'], + type: json['loco_type'], + number: json['loco_number'], + name: json['loco_name'] ?? "", locoClass: json['loco_class'], + operator: json['loco_operator'], + notes: json['loco_notes'], + evn: json['loco_evn'], + ); +} + +class LocoSummary extends Loco { + final double? mileage; + final int? journeys; + + LocoSummary({ + required int locoId, + required String locoType, + required String locoNumber, + required String locoName, + required String locoClass, + required String locoOperator, + String? locoNotes, + String? locoEvn, + this.mileage, + this.journeys, + }) : super( + id: locoId, + type: locoType, + number: locoNumber, + name: locoName, + locoClass: locoClass, + operator: locoOperator, + notes: locoNotes, + evn: locoEvn, + ); + + factory LocoSummary.fromJson(Map json) => LocoSummary( + locoId: json['loco_id'], + locoType: json['loco_type'], locoNumber: json['loco_number'], locoName: json['loco_name'] ?? "", + locoClass: json['loco_class'], locoOperator: json['loco_operator'], locoNotes: json['loco_notes'], locoEvn: json['loco_evn'], - locoId: json['loco_id'], - locoMileage: (json['loco_mileage'] as num).toDouble(), - locoJourneys: json['loco_journeys'], + mileage: (json['loco_mileage'] as num?)?.toDouble(), + journeys: json['loco_journeys'], ); } @@ -153,34 +187,6 @@ class TripSummary { ); } -class Loco { - final int id; - final String type, number, name, locoClass, operator; - final String? notes, evn; - - Loco({ - required this.id, - required this.type, - required this.number, - required this.name, - required this.locoClass, - required this.operator, - this.notes, - this.evn, - }); - - factory Loco.fromJson(Map json) => Loco( - id: json['loco_id'], - type: json['loco_type'], - number: json['loco_number'], - name: json['loco_name'] ?? "", - locoClass: json['loco_class'], - operator: json['loco_operator'], - notes: json['loco_notes'], - evn: json['loco_evn'], - ); -} - class Leg { final int id, tripId, timezone, driving; final String start, end, route, network, notes, headcode, user; @@ -224,3 +230,58 @@ class Leg { .toList(), ); } + +class RouteError { + final String error; + final String msg; + + RouteError({required this.error, required this.msg}); + + factory RouteError.fromJson(Map json) { + return RouteError(error: json["error"], msg: json["msg"]); + } +} + +class RouteResult { + final List inputRoute; + final List calculatedRoute; + final List costs; + final double distance; + + RouteResult({ + required this.inputRoute, + required this.calculatedRoute, + required this.costs, + required this.distance, + }); + + factory RouteResult.fromJson(Map json) { + return RouteResult( + inputRoute: List.from(json['input_route']), + calculatedRoute: List.from(json['calculated_route']), + costs: (json['costs'] as List).map((e) => (e as num).toDouble()).toList(), + distance: (json['distance'] as num).toDouble(), + ); + } +} + +class Station { + final int id; + final String name; + final String network; + final String country; + + Station({ + required this.id, + required this.name, + required this.network, + required this.country, + }); + + factory Station.fromJson(Map json) => Station( + id: json['id'], + name: json['name'], + network: json['network'], + country: json['country'], + ); +} diff --git a/lib/services/dataService.dart b/lib/services/dataService.dart index d968fb8..8cbaadc 100644 --- a/lib/services/dataService.dart +++ b/lib/services/dataService.dart @@ -7,15 +7,22 @@ class DataService extends ChangeNotifier { DataService({required this.api}); + // Homepage Data HomepageStats? _homepageStats; HomepageStats? get homepageStats => _homepageStats; + // Legs Data List _legs = []; List get legs => _legs; + // Traction Data List _traction = []; List get traction => _traction; + // Station Data + List? _cachedStations; + DateTime? _stationsFetchedAt; + bool _isHomepageLoading = false; bool get isHomepageLoading => _isHomepageLoading; @@ -84,4 +91,23 @@ class DataService extends ChangeNotifier { .mileage ?? 0; } + + Future> fetchStations() async { + final now = DateTime.now(); + + // If cache exists and is less than 30 minutes old, return it + if (_cachedStations != null && + _stationsFetchedAt != null && + now.difference(_stationsFetchedAt!) < Duration(minutes: 30)) { + return _cachedStations!; + } + + final response = await api.get('/location'); + final parsed = (response as List).map((e) => Station.fromJson(e)).toList(); + + _cachedStations = parsed; + _stationsFetchedAt = now; + + return parsed; + } } diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index f7a3faf..cb1e7e6 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -4,10 +4,10 @@ project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "mileograph_sbb_flutter") +set(BINARY_NAME "mileograph_flutter") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.example.mileograph_sbb_flutter") +set(APPLICATION_ID "com.example.mileograph_flutter") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/linux/runner/my_application.cc b/linux/runner/my_application.cc index 3a41b17..71a5cfb 100644 --- a/linux/runner/my_application.cc +++ b/linux/runner/my_application.cc @@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "mileograph_sbb_flutter"); + gtk_header_bar_set_title(header_bar, "mileograph_flutter"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "mileograph_sbb_flutter"); + gtk_window_set_title(window, "mileograph_flutter"); } gtk_window_set_default_size(window, 1280, 720); diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 07e652d..94005d0 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -64,7 +64,7 @@ 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* mileograph_sbb_flutter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "mileograph_sbb_flutter.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* mileograph_flutter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "mileograph_flutter.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -131,7 +131,7 @@ 33CC10EE2044A3C60003C045 /* Products */ = { isa = PBXGroup; children = ( - 33CC10ED2044A3C60003C045 /* mileograph_sbb_flutter.app */, + 33CC10ED2044A3C60003C045 /* mileograph_flutter.app */, 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, ); name = Products; @@ -217,7 +217,7 @@ ); name = Runner; productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* mileograph_sbb_flutter.app */; + productReference = 33CC10ED2044A3C60003C045 /* mileograph_flutter.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -388,7 +388,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.example.mileographSbbFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/mileograph_sbb_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/mileograph_sbb_flutter"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/mileograph_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/mileograph_flutter"; }; name = Debug; }; @@ -402,7 +402,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.example.mileographSbbFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/mileograph_sbb_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/mileograph_sbb_flutter"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/mileograph_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/mileograph_flutter"; }; name = Release; }; @@ -416,7 +416,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.example.mileographSbbFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/mileograph_sbb_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/mileograph_sbb_flutter"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/mileograph_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/mileograph_flutter"; }; name = Profile; }; diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index de9b559..2fb28eb 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -66,7 +66,7 @@ @@ -83,7 +83,7 @@ diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig index 882775e..86997a8 100644 --- a/macos/Runner/Configs/AppInfo.xcconfig +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -5,7 +5,7 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = mileograph_sbb_flutter +PRODUCT_NAME = mileograph_flutter // The application's bundle identifier PRODUCT_BUNDLE_IDENTIFIER = com.example.mileographSbbFlutter diff --git a/web/index.html b/web/index.html index 14dd7b4..b0489a4 100644 --- a/web/index.html +++ b/web/index.html @@ -23,13 +23,13 @@ - + - mileograph_sbb_flutter + mileograph_flutter diff --git a/web/manifest.json b/web/manifest.json index 380f3b9..1e79d79 100644 --- a/web/manifest.json +++ b/web/manifest.json @@ -1,35 +1,35 @@ { - "name": "mileograph_sbb_flutter", - "short_name": "mileograph_sbb_flutter", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] + "name": "mileograph_flutter", + "short_name": "mileograph_flutter", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] } diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 189f167..9cac386 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -1,10 +1,10 @@ # Project-level configuration. cmake_minimum_required(VERSION 3.14) -project(mileograph_sbb_flutter LANGUAGES CXX) +project(mileograph_flutter LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "mileograph_sbb_flutter") +set(BINARY_NAME "mileograph_flutter") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc index b48a1e5..17548a5 100644 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -90,12 +90,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "mileograph_sbb_flutter" "\0" + VALUE "FileDescription", "mileograph_flutter" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "mileograph_sbb_flutter" "\0" + VALUE "InternalName", "mileograph_flutter" "\0" VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0" - VALUE "OriginalFilename", "mileograph_sbb_flutter.exe" "\0" - VALUE "ProductName", "mileograph_sbb_flutter" "\0" + VALUE "OriginalFilename", "mileograph_flutter.exe" "\0" + VALUE "ProductName", "mileograph_flutter" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp index 1baa1e3..edffbea 100644 --- a/windows/runner/main.cpp +++ b/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.Create(L"mileograph_sbb_flutter", origin, size)) { + if (!window.Create(L"mileograph_flutter", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true);