Skip to content

Commit

Permalink
broken
Browse files Browse the repository at this point in the history
Saving radios across devices.. still broken
  • Loading branch information
cconstab committed Nov 1, 2021
1 parent b295388 commit 4b44751
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 45 deletions.
2 changes: 1 addition & 1 deletion ui/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:at_client_mobile/at_client_mobile.dart';
import 'package:path_provider/path_provider.dart' as path_provider;
import 'package:at_app_flutter/at_app_flutter.dart';
import 'package:ui/screens/edit_radio.dart';
import 'package:ui/screens/main_screen.dart';
import 'package:ui/screens/new_radio.dart';
import 'package:ui/theme/ui_theme.dart';
Expand All @@ -24,6 +23,7 @@ Future<AtClientPreference> loadAtClientPreference() async {
..hiveStoragePath = dir.path
..commitLogPath = dir.path
..isLocalStoreRequired = true
// ignore: todo
// TODO set the rest of your AtClientPreference here
;
}
Expand Down
8 changes: 8 additions & 0 deletions ui/lib/screens/main_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class _MainScreenState extends State<MainScreen> {
atClient = atClientManager.atClient;
currentAtsign = atClient.getCurrentAtSign();
currentAtsign = currentAtsign!.toUpperCase();
var syncService = AtClientManager.getInstance().syncService;
syncService.setOnDone(_syncRadios);
print(syncService.isSyncInProgress);
initRadios();
}

Expand All @@ -48,6 +51,11 @@ class _MainScreenState extends State<MainScreen> {
});
}

void _syncRadios(synchResult) {
print('SYNC COMPLETE RUNNING initRADIOS');
initRadios();
}

Future<void> initRadios() async {
print('GETTING RADIOS');
radios = await getHamradio(radios);
Expand Down
6 changes: 2 additions & 4 deletions ui/lib/services/at_get_radios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Future<List<HamRadio>> getHamradio(List<HamRadio> radios) async {
..sharedWith = currentAtsign;

var atRadiocount = await atClient.get(key);
if (atRadiocount != 'null') {
if (atRadiocount.value != 'null') {
radios = [];
print(atRadiocount.value);
var val = atRadiocount.value;
int radioCount = int.parse(val);
Expand All @@ -42,8 +43,5 @@ Future<List<HamRadio>> getHamradio(List<HamRadio> radios) async {
}
}

// Pull in radios from @platform
var keys = await atClient.getKeys(sharedWith: '@ai6bh');
print('keys' + keys.toString());
return (radios);
}
115 changes: 86 additions & 29 deletions ui/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ packages:
source: hosted
version: "2.8.1"
at_app_flutter:
dependency: "direct main"
dependency: "direct overridden"
description:
name: at_app_flutter
url: "https://pub.dartlang.org"
Expand All @@ -39,9 +39,11 @@ packages:
at_backupkey_flutter:
dependency: transitive
description:
name: at_backupkey_flutter
url: "https://pub.dartlang.org"
source: hosted
path: at_backupkey_flutter
ref: "desktop/development"
resolved-ref: "617ebdf7001217dd8ca93462aa06ce848f6cc734"
url: "https://github.com/atsign-foundation/at_widgets.git"
source: git
version: "3.0.0"
at_base2e15:
dependency: transitive
Expand All @@ -53,16 +55,20 @@ packages:
at_client:
dependency: transitive
description:
name: at_client
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.4"
path: at_client
ref: desktop-compatible
resolved-ref: "7c0404d4c9f1530455227e2af72a17640a512f7b"
url: "https://github.com/atsign-foundation/at_client_sdk.git"
source: git
version: "3.0.3"
at_client_mobile:
dependency: transitive
dependency: "direct overridden"
description:
name: at_client_mobile
url: "https://pub.dartlang.org"
source: hosted
path: at_client_mobile
ref: desktop-compatible
resolved-ref: "7c0404d4c9f1530455227e2af72a17640a512f7b"
url: "https://github.com/atsign-foundation/at_client_sdk.git"
source: git
version: "3.0.3"
at_commons:
dependency: transitive
Expand All @@ -79,12 +85,14 @@ packages:
source: hosted
version: "3.0.3"
at_onboarding_flutter:
dependency: transitive
dependency: "direct overridden"
description:
name: at_onboarding_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.4"
path: at_onboarding_flutter
ref: "desktop/development"
resolved-ref: "617ebdf7001217dd8ca93462aa06ce848f6cc734"
url: "https://github.com/atsign-foundation/at_widgets.git"
source: git
version: "3.0.2"
at_persistence_secondary_server:
dependency: transitive
description:
Expand Down Expand Up @@ -127,6 +135,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0-nullsafety.0"
biometric_storage:
dependency: transitive
description:
name: biometric_storage
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -176,6 +191,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
cross_file:
dependency: transitive
description:
name: cross_file
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
crypto:
dependency: transitive
description:
Expand All @@ -191,7 +213,7 @@ packages:
source: hosted
version: "2.0.3"
cupertino_icons:
dependency: "direct main"
dependency: "direct overridden"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
Expand All @@ -212,7 +234,7 @@ packages:
source: hosted
version: "5.0.1"
expansion_tile_card:
dependency: "direct main"
dependency: "direct overridden"
description:
name: expansion_tile_card
url: "https://pub.dartlang.org"
Expand Down Expand Up @@ -246,25 +268,60 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.4"
file_selector:
dependency: transitive
description:
name: file_selector
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.2+1"
file_selector_linux:
dependency: transitive
description:
name: file_selector_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2+1"
file_selector_macos:
dependency: transitive
description:
name: file_selector_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+1"
file_selector_platform_interface:
dependency: transitive
description:
name: file_selector_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
file_selector_web:
dependency: transitive
description:
name: file_selector_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.1+2"
file_selector_windows:
dependency: transitive
description:
name: file_selector_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2+1"
flutter:
dependency: "direct main"
dependency: "direct overridden"
description: flutter
source: sdk
version: "0.0.0"
flutter_form_builder:
dependency: "direct main"
dependency: "direct overridden"
description:
name: flutter_form_builder
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.0+1"
flutter_keychain:
dependency: transitive
description:
name: flutter_keychain
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
flutter_lints:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -545,7 +602,7 @@ packages:
source: hosted
version: "0.4.2"
timer_builder:
dependency: "direct main"
dependency: "direct overridden"
description:
name: timer_builder
url: "https://pub.dartlang.org"
Expand Down
22 changes: 11 additions & 11 deletions ui/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ dependencies:
font_awesome_flutter: ^9.1.0
mdi: ^5.0.0-nullsafety.0

# dependency_overrides:
# at_onboarding_flutter:
# git:
# url: https://github.com/atsign-foundation/at_widgets.git
# path: at_onboarding_flutter
# ref: desktop/development
# at_client_mobile:
# git:
# url: https://github.com/atsign-foundation/at_client_sdk.git
# path: at_client_mobile
# ref: desktop-compatible
dependency_overrides:
at_onboarding_flutter:
git:
url: https://github.com/atsign-foundation/at_widgets.git
path: at_onboarding_flutter
ref: desktop/development
at_client_mobile:
git:
url: https://github.com/atsign-foundation/at_client_sdk.git
path: at_client_mobile
ref: desktop-compatible



Expand Down
3 changes: 3 additions & 0 deletions ui/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@

#include "generated_plugin_registrant.h"

#include <file_selector_windows/file_selector_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
FileSelectorPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorPlugin"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
1 change: 1 addition & 0 deletions ui/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
file_selector_windows
url_launcher_windows
)

Expand Down

0 comments on commit 4b44751

Please sign in to comment.