Skip to content

Commit

Permalink
fries: Lints and stuff for dart 3
Browse files Browse the repository at this point in the history
  • Loading branch information
HrX03 committed Jul 8, 2023
1 parent 249a9d2 commit 246ec7d
Show file tree
Hide file tree
Showing 29 changed files with 288 additions and 576 deletions.
3 changes: 1 addition & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.potatoproject.fries">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
coreApp="true"
package="com.potatoproject.fries">
coreApp="true">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.potatoproject.fries">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
5 changes: 4 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
3 changes: 0 additions & 3 deletions lib/backend/appinfo.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:typed_data';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
Expand Down Expand Up @@ -43,7 +41,6 @@ class AppInfo extends ChangeNotifier {
case "config":
await _updateColors();
notifyListeners();
break;
}
}
});
Expand Down
77 changes: 41 additions & 36 deletions lib/backend/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ class Pages {
const Pages._();

static const FriesPage qs = FriesPage(
title: "QS",
icon: Icons.brightness_6_outlined,
selectedIcon: Icons.brightness_6,
sections: []);
title: "QS",
icon: Icons.brightness_6_outlined,
selectedIcon: Icons.brightness_6,
sections: [],
);

static const FriesPage system = FriesPage(
title: "System",
Expand Down Expand Up @@ -157,10 +158,11 @@ class Pages {
title: "Navigation",
preferences: [
SliderSettingPreference<int>(
setting: Settings.navigation_handle_width,
title: "Navigation handle length",
min: 10,
max: 20),
setting: Settings.navigation_handle_width,
title: "Navigation handle length",
min: 10,
max: 20,
),
],
),
],
Expand Down Expand Up @@ -229,27 +231,30 @@ class Pages {
icon: Icons.signal_cellular_0_bar,
selectedIcon: Icons.signal_cellular_4_bar,
sections: [
PageSection(title: "Battery", preferences: [
DropdownSettingPreference<int>(
setting: Settings.status_bar_battery_style,
title: "Battery Style",
options: {
0: "Portrait",
1: "Circle",
2: "Dotted Circle",
3: "Solid Circle",
4: "Text",
5: "Hidden"
},
icon: MdiIcons.battery,
),
DropdownSettingPreference<int>(
setting: Settings.status_bar_show_battery_percent,
title: "Battery Percentage",
options: {0: "Hidden", 1: "Inside the icon", 2: "Next to the icon"},
icon: MdiIcons.battery30,
),
]),
PageSection(
title: "Battery",
preferences: [
DropdownSettingPreference<int>(
setting: Settings.status_bar_battery_style,
title: "Battery Style",
options: {
0: "Portrait",
1: "Circle",
2: "Dotted Circle",
3: "Solid Circle",
4: "Text",
5: "Hidden",
},
icon: MdiIcons.battery,
),
DropdownSettingPreference<int>(
setting: Settings.status_bar_show_battery_percent,
title: "Battery Percentage",
options: {0: "Hidden", 1: "Inside the icon", 2: "Next to the icon"},
icon: MdiIcons.battery30,
),
],
),
],
);

Expand Down Expand Up @@ -314,19 +319,19 @@ class Pages {
SettingSink sink,
List<Setting> settings,
) async {
Future<void> _subscribeType<T>() async {
final Iterable<Setting<T>> _typeSettings =
Future<void> subscribeType<T>() async {
final Iterable<Setting<T>> typeSettings =
settings.whereType<Setting<T>>();

for (final Setting<T> setting in _typeSettings) {
for (final Setting<T> setting in typeSettings) {
await sink.subscribe<T>(setting);
}
}

await _subscribeType<int>();
await _subscribeType<String>();
await _subscribeType<bool>();
await _subscribeType<double>();
await subscribeType<int>();
await subscribeType<String>();
await subscribeType<bool>();
await subscribeType<double>();
}

static Future<void> _registerProperties(
Expand Down
14 changes: 7 additions & 7 deletions lib/backend/models/dependency.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import 'package:potato_fries/backend/models/properties.dart';
import 'package:potato_fries/backend/models/settings.dart';

abstract class Dependency<T> {
final T key;
final dynamic value;
sealed class Dependency<K, V> {
final K key;
final V value;

const Dependency(this.key, this.value);
}

class SettingDependency<T> extends Dependency<Setting<T>> {
const SettingDependency(Setting<T> key, T value) : super(key, value);
class SettingDependency<T> extends Dependency<Setting<T>, T> {
const SettingDependency(super.key, super.value);
}

class PropertyDependency extends Dependency<PropertyKey> {
const PropertyDependency(PropertyKey key, String? value) : super(key, value);
class PropertyDependency extends Dependency<PropertyKey, String?> {
const PropertyDependency(super.key, super.value);
}
Loading

0 comments on commit 246ec7d

Please sign in to comment.