Skip to content

Commit

Permalink
migrate flutter theme code
Browse files Browse the repository at this point in the history
  • Loading branch information
crc-32 committed Jul 31, 2024
1 parent dc001ac commit 3e5e6b2
Show file tree
Hide file tree
Showing 20 changed files with 94 additions and 1,352 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ internal class GATTPacketTest {
@Test
fun decodeValidPacket() {
val expectedType = GATTPacket.PacketType.DATA
val expectedSeq = 16U.toUShort()
val expectedSeq = 16
val expectedPayload = payload.serialize().toByteArray()

val gattPacket = GATTPacket(byteArrayOf(0b10000000.toByte()) + expectedPayload)
assertEquals(expectedSeq, gattPacket.sequence)
assertEquals(expectedType, gattPacket.type)
assertArrayEquals(expectedPayload, gattPacket.data.slice(1..gattPacket.data.size - 1).toByteArray())
assertArrayEquals(expectedPayload, gattPacket.data.slice(1..<gattPacket.data.size).toByteArray())
}
}
247 changes: 0 additions & 247 deletions lib/domain/calendar/calendar_pin_convert.dart

This file was deleted.

3 changes: 0 additions & 3 deletions lib/domain/calendar/device_calendar_plugin_provider.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import 'package:cobble/infrastructure/pigeons/pigeons.g.dart';
import 'package:device_calendar/device_calendar.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

final deviceCalendarPluginProvider = Provider<DeviceCalendarPlugin>((ref) => DeviceCalendarPlugin());

final calendarControlProvider = Provider<CalendarControl>((ref) => CalendarControl());
12 changes: 0 additions & 12 deletions lib/domain/calendar/result_converter.dart

This file was deleted.

4 changes: 2 additions & 2 deletions lib/infrastructure/datasources/dev_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:cobble/domain/apps/app_manager.dart';
import 'package:cobble/domain/connection/raw_incoming_packets_provider.dart';
import 'package:cobble/infrastructure/pigeons/pigeons.g.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:network_info_plus/network_info_plus.dart';
import 'package:path_provider/path_provider.dart';

final ConnectionControl connectionControl = ConnectionControl();
Expand Down Expand Up @@ -124,7 +123,8 @@ class DevConnection extends StateNotifier<DevConnState> {
}

Future<void> start() async {
_localIp = await (NetworkInfo().getWifiIP()) ?? "";
//_localIp = await (NetworkInfo().getWifiIP()) ?? "";
_localIp = "";

final server = await HttpServer.bind(
InternetAddress.anyIPv4,
Expand Down
1 change: 0 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:noob/noob.dart';

import 'domain/permissions.dart';
import 'infrastructure/datasources/paired_storage.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/common/components/cobble_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ class CobbleCard extends StatelessWidget {
children: [
Text(
title,
style: context.textTheme.headline6!.copyWith(
style: context.textTheme.headlineMedium!.copyWith(
color: scheme.text,
),
),
if (subtitle != null) ...[
SizedBox(height: 4),
Text(
subtitle!,
style: context.textTheme.bodyText2!.copyWith(
style: context.textTheme.bodyMedium!.copyWith(
color: scheme.text,
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/common/components/cobble_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ class CobbleDialog extends StatelessWidget {
if (title is String)
Text(
title!,
style: context.textTheme.headline6!.copyWith(
style: context.textTheme.headlineMedium!.copyWith(
color: scheme.text,
),
),
if (title is String && content is String) SizedBox(height: 4),
if (content is String)
Text(
content!,
style: context.textTheme.bodyText2!.copyWith(
style: context.textTheme.bodyMedium!.copyWith(
color: scheme.text,
),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/common/components/cobble_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class CobbleSheet {
/// }
/// ```
static InlineCobbleSheet useInline() {
final _controller = useState<PersistentBottomSheetController<void>?>(null);
final _controller = useState<PersistentBottomSheetController?>(null);
final _sheet = useMemoized(() => InlineCobbleSheet(_controller));
return _sheet;
}
Expand All @@ -124,11 +124,11 @@ class CobbleSheet {
/// * [CobbleSheet.useInline]
/// * [InlineCobbleSheet.show]
class InlineCobbleSheet {
final ValueNotifier<PersistentBottomSheetController<void>?> _controller;
final ValueNotifier<PersistentBottomSheetController?> _controller;

InlineCobbleSheet(this._controller);

set _ctr(PersistentBottomSheetController<void> controller) {
set _ctr(PersistentBottomSheetController controller) {
_controller.value = controller;
if (controller != null) {
_shown = true;
Expand Down
Loading

0 comments on commit 3e5e6b2

Please sign in to comment.