Partially #18. App name and app version as global const
This commit is contained in:
		| @@ -9,11 +9,14 @@ import 'package:web_socket_channel/status.dart' as socketStatus; | |||||||
| import 'package:progress_indicators/progress_indicators.dart'; | import 'package:progress_indicators/progress_indicators.dart'; | ||||||
| import 'package:event_bus/event_bus.dart'; | import 'package:event_bus/event_bus.dart'; | ||||||
| import 'package:flutter/widgets.dart'; | import 'package:flutter/widgets.dart'; | ||||||
|  | import 'package:package_info/package_info.dart'; | ||||||
|  |  | ||||||
| part 'settings.dart'; | part 'settings.dart'; | ||||||
| part 'data_model.dart'; | part 'data_model.dart'; | ||||||
|  |  | ||||||
| EventBus eventBus = new EventBus(); | EventBus eventBus = new EventBus(); | ||||||
|  | const String appName = "Home Assistant Client"; | ||||||
|  | const appVersion = "0.0.5"; | ||||||
|  |  | ||||||
| void main() => runApp(new HassClientApp()); | void main() => runApp(new HassClientApp()); | ||||||
|  |  | ||||||
| @@ -22,7 +25,7 @@ class HassClientApp extends StatelessWidget { | |||||||
|   @override |   @override | ||||||
|   Widget build(BuildContext context) { |   Widget build(BuildContext context) { | ||||||
|     return new MaterialApp( |     return new MaterialApp( | ||||||
|       title: 'Hass Client', |       title: appName, | ||||||
|       theme: new ThemeData( |       theme: new ThemeData( | ||||||
|         primarySwatch: Colors.blue, |         primarySwatch: Colors.blue, | ||||||
|       ), |       ), | ||||||
| @@ -88,7 +91,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver { | |||||||
|         "/api/websocket"; |         "/api/websocket"; | ||||||
|     String _hassioPassword = prefs.getString('hassio-password'); |     String _hassioPassword = prefs.getString('hassio-password'); | ||||||
|     _dataModel = HassioDataModel(_hassioAPIEndpoint, _hassioPassword); |     _dataModel = HassioDataModel(_hassioAPIEndpoint, _hassioPassword); | ||||||
|     await _refreshData(); |     _refreshData(); | ||||||
|     eventBus.on<StateChangedEvent>().listen((event) { |     eventBus.on<StateChangedEvent>().listen((event) { | ||||||
|       debugPrint("State change event for ${event.entityId}"); |       debugPrint("State change event for ${event.entityId}"); | ||||||
|       setState(() { |       setState(() { | ||||||
| @@ -255,7 +258,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver { | |||||||
|  |  | ||||||
|   Widget _buildTitle() { |   Widget _buildTitle() { | ||||||
|     Row titleRow = Row( |     Row titleRow = Row( | ||||||
|       children: [Text(_instanceConfig != null ? _instanceConfig["location_name"] : "...")], |       children: [Text(_instanceConfig != null ? _instanceConfig["location_name"] : "")], | ||||||
|     ); |     ); | ||||||
|     if (loading) { |     if (loading) { | ||||||
|       titleRow.children.add(Padding( |       titleRow.children.add(Padding( | ||||||
| @@ -286,8 +289,8 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver { | |||||||
|             }, |             }, | ||||||
|           ), |           ), | ||||||
|           new AboutListTile( |           new AboutListTile( | ||||||
|             applicationName: "Hass Client", |             applicationName: appName, | ||||||
|             applicationVersion: "0.1", |             applicationVersion: appVersion, | ||||||
|             applicationLegalese: "Keyboard Crumbs", |             applicationLegalese: "Keyboard Crumbs", | ||||||
|           ) |           ) | ||||||
|         ], |         ], | ||||||
|   | |||||||
| @@ -207,6 +207,13 @@ packages: | |||||||
|       url: "https://pub.dartlang.org" |       url: "https://pub.dartlang.org" | ||||||
|     source: hosted |     source: hosted | ||||||
|     version: "1.0.5" |     version: "1.0.5" | ||||||
|  |   package_info: | ||||||
|  |     dependency: "direct main" | ||||||
|  |     description: | ||||||
|  |       name: package_info | ||||||
|  |       url: "https://pub.dartlang.org" | ||||||
|  |     source: hosted | ||||||
|  |     version: "0.3.2" | ||||||
|   package_resolver: |   package_resolver: | ||||||
|     dependency: transitive |     dependency: transitive | ||||||
|     description: |     description: | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ description: Home Assistant Android Client | |||||||
| # Both the version and the builder number may be overridden in flutter | # Both the version and the builder number may be overridden in flutter | ||||||
| # build by specifying --build-name and --build-number, respectively. | # build by specifying --build-name and --build-number, respectively. | ||||||
| # Read more about versioning at semver.org. | # Read more about versioning at semver.org. | ||||||
| version: 0.0.5 | version: 0.0.5+14 | ||||||
|  |  | ||||||
| environment: | environment: | ||||||
|   sdk: ">=2.0.0-dev.68.0 <3.0.0" |   sdk: ">=2.0.0-dev.68.0 <3.0.0" | ||||||
| @@ -18,6 +18,7 @@ dependencies: | |||||||
|   shared_preferences: any |   shared_preferences: any | ||||||
|   progress_indicators: ^0.1.2 |   progress_indicators: ^0.1.2 | ||||||
|   event_bus: ^1.0.1 |   event_bus: ^1.0.1 | ||||||
|  |   package_info: ^0.3.2 | ||||||
|  |  | ||||||
|   # The following adds the Cupertino Icons font to your application. |   # The following adds the Cupertino Icons font to your application. | ||||||
|   # Use with the CupertinoIcons class for iOS style icons. |   # Use with the CupertinoIcons class for iOS style icons. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user