Skip to content

Commit

Permalink
A bit more cleanup
Browse files Browse the repository at this point in the history
* removed some unused things
* added packages explicitly, which were previously only indirectly references
* add more final to arguments
  • Loading branch information
susch19 committed Oct 22, 2023
1 parent 42c254c commit f5bfc4c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
9 changes: 1 addition & 8 deletions lib/controls/blurry_container.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//Copied from https://github.com/ranjeetrocky/blurry_container

import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:smarthome/helper/preference_manager.dart';
Expand All @@ -12,7 +10,7 @@ const Color kDefaultColor = Colors.transparent;
const BorderRadius kBorderRadius = BorderRadius.all(Radius.circular(10));
const BlendMode kblendMode = BlendMode.srcOver;

final blurryContainerBlurProvider = StateProvider<double>((ref) {
final blurryContainerBlurProvider = StateProvider<double>((final ref) {
return PreferencesManager.instance.getDouble("BlurryContainerBlur") ?? 0;
});

Expand All @@ -36,19 +34,14 @@ class BlurryContainer extends ConsumerWidget {

@override
Widget build(final BuildContext context, final WidgetRef ref) {
final blur = ref.watch(blurryContainerBlurProvider);
return ClipRRect(
borderRadius: borderRadius,
// child: BackdropFilter(
// blendMode: blendMode,
// filter: ImageFilter.blur(sigmaX: blur, sigmaY: blur),
child: Container(
padding: padding,
margin: margin,
color: color,
child: child,
),
// ),
);
}
}
6 changes: 3 additions & 3 deletions lib/devices/heater/log_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ class LogScreen extends ConsumerWidget {
LogScreen(this._logs, this._id, {final Key? key}) : super(key: key);

@override
Widget build(BuildContext context, WidgetRef ref) {
final _logsArray = ref.watch(_logs(_id)).split('\n');
Widget build(final BuildContext context, final WidgetRef ref) {
final logsArray = ref.watch(_logs(_id)).split('\n');
return Scaffold(
key: _scaffoldKey,
appBar: AppBar(
title: const Text("Logs"),
),
body: Container(
decoration: ThemeManager.getBackgroundDecoration(context),
child: ListView(padding: const EdgeInsets.all(16.0), children: _logsArray.map(_logLineWidget).toList())),
child: ListView(padding: const EdgeInsets.all(16.0), children: logsArray.map(_logLineWidget).toList())),
);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/devices/tradfrimotionsensor/tradfri_motion_sensor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ class TradfriMotionSensorScreen extends ConsumerStatefulWidget {
const TradfriMotionSensorScreen(this.device, {final Key? key}) : super(key: key);

@override
_TradfriMotionSensorScreenState createState() => _TradfriMotionSensorScreenState();
TradfriMotionSensorScreenState createState() => TradfriMotionSensorScreenState();
}

class _TradfriMotionSensorScreenState extends ConsumerState<TradfriMotionSensorScreen> {
class TradfriMotionSensorScreenState extends ConsumerState<TradfriMotionSensorScreen> {
DateTime dateTime = DateTime.now();

@override
Expand Down
2 changes: 1 addition & 1 deletion lib/helper/update_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final versionAndUrlProvider = StateNotifierProvider<UpdateManager, VersionAndUrl
});

class UpdateManager extends StateNotifier<VersionAndUrl?> {
static final Version version = Version(1, 2, 1);
static final Version version = Version(1, 2, 2);
static const int checkEveryHours = 16;
static final GitHub gitHub = GitHub();
static final RepositorySlug repositorySlug = RepositorySlug("susch19", "SmartHome");
Expand Down
6 changes: 1 addition & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ final _brightnessChangeProvider =
return AdaptiveThemeModeWatcher(b);
});

final _addItemSelectorProvider = StateProvider.family<bool, int>(
(ref, arg) {
return false;
},
);
final _addItemSelectorProvider = StateProvider.family<bool, int>((final ref, final arg) => false);

@riverpod
Brightness brightness(final BrightnessRef ref, final AdaptiveThemeManager b) {
Expand Down
9 changes: 8 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Controlling Smarthome devices with AppBroker.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org.
version: 1.2.1+0
version: 1.2.2+0

environment:
sdk: ">=2.17.0"
Expand Down Expand Up @@ -47,8 +47,14 @@ dependencies:
url_launcher: ^6.0.20
version: ^3.0.2
oktoast: ^3.3.1
riverpod:
flutter_riverpod: ^2.4.4
signalr_netcore: ^1.3.6
path: ^1.8.3
intl: ^0.18.1
logging: ^1.2.0
url_launcher_web: ^2.0.20
encrypt:


dev_dependencies:
Expand All @@ -63,6 +69,7 @@ dev_dependencies:
encrypt:
pointycastle: ^3.6.1
riverpod_generator:
riverpod_annotation: ^2.2.1

flutter:
uses-material-design: true
Expand Down

0 comments on commit f5bfc4c

Please sign in to comment.