Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
небольшие изменения
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacmi committed Dec 15, 2021
1 parent c47efb4 commit 6a556c0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -45,7 +45,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "ru.sacmi.temperature_viewer"
minSdkVersion 19
minSdkVersion 23
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
6 changes: 4 additions & 2 deletions lib/data/api/temperature_service_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ class TemperatureServiceApiClient {

Uri _getUri(String url, String path,
{Map<String, dynamic>? queryParameters}) =>
Uri.http(url, path, queryParameters);
url.contains('http://')
? Uri.http(url, path, queryParameters)
: Uri.https(url, path, queryParameters);

Future<dynamic> getRawSensorsList(String url) async {
final uri = Uri.http(url, '/sensor/');
final uri = _getUri(url, '/sensor/');
final sensorsResponse = await _httpClient.get(uri);

if (sensorsResponse.statusCode != 200) {
Expand Down
1 change: 0 additions & 1 deletion lib/logic/cubit/settings/settings_cubit.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:convert';

import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:hydrated_bloc/hydrated_bloc.dart';

Expand Down
6 changes: 6 additions & 0 deletions lib/presentation/view/sensor_data_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ class SensorDataView extends StatelessWidget {
child: CircularProgressIndicator(),
);
} else if (state is SensorDataLoaded) {
if (state.sensorData.length < 2) {
return const Center(
child: Text("Мало данных для построения графика"),
);
}

return ListView(
children: [
ListTile(
Expand Down
3 changes: 2 additions & 1 deletion lib/presentation/view/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class SettingsView extends StatelessWidget {
padding: const EdgeInsets.all(8.0),
child: TextField(
controller: textController,
decoration: const InputDecoration(labelText: 'Хост'),
decoration:
const InputDecoration(labelText: 'Хост (с протоколом)'),
),
),
ListTile(
Expand Down
18 changes: 9 additions & 9 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.1"
version: "2.8.2"
bloc:
dependency: "direct main"
description:
Expand Down Expand Up @@ -56,7 +56,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -267,7 +267,7 @@ packages:
name: graphic
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.1"
version: "0.6.0"
hive:
dependency: transitive
description:
Expand Down Expand Up @@ -344,7 +344,7 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10"
version: "0.12.11"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -587,21 +587,21 @@ packages:
name: test
url: "https://pub.dartlang.org"
source: hosted
version: "1.17.10"
version: "1.17.12"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2"
version: "0.4.3"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0"
version: "0.4.2"
timezone:
dependency: transitive
description:
Expand All @@ -622,7 +622,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
vm_service:
dependency: transitive
description:
Expand Down Expand Up @@ -681,4 +681,4 @@ packages:
version: "3.1.0"
sdks:
dart: ">=2.14.0 <3.0.0"
flutter: ">=2.5.0"
flutter: ">=2.6.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies:
sdk: flutter
flutter_bloc: ^7.3.3
flutter_local_notifications: ^9.1.2
graphic: ^0.4.1
graphic: ^0.6.0
http: ^0.13.4
hydrated_bloc: ^7.1.0
intl: ^0.17.0
Expand Down

0 comments on commit 6a556c0

Please sign in to comment.