change ffi flutter_config to flutter_option

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-08-10 22:27:35 +08:00
parent 7921be45f5
commit 7f6b18fc9c
10 changed files with 42 additions and 42 deletions

View File

@@ -64,7 +64,7 @@ class _PeerTabPageState extends State<PeerTabPage>
@override
void initState() {
final uiType = bind.getLocalFlutterConfig(k: 'peer-card-ui-type');
final uiType = bind.getLocalFlutterOption(k: 'peer-card-ui-type');
if (uiType != '') {
peerCardUiType.value = int.parse(uiType) == PeerUiType.list.index
? PeerUiType.list
@@ -174,7 +174,7 @@ class _PeerTabPageState extends State<PeerTabPage>
).paddingSymmetric(horizontal: 4),
onTap: () async {
await handleTabSelection(t);
await bind.setLocalFlutterConfig(
await bind.setLocalFlutterOption(
k: 'peer-tab-index', v: t.toString());
},
onHover: (value) => hover.value = value,
@@ -244,7 +244,7 @@ class _PeerTabPageState extends State<PeerTabPage>
onTap: () async {
final type = types.elementAt(
peerCardUiType.value == types.elementAt(0) ? 1 : 0);
await bind.setLocalFlutterConfig(
await bind.setLocalFlutterOption(
k: 'peer-card-ui-type', v: type.index.toString());
peerCardUiType.value = type;
},
@@ -561,7 +561,7 @@ class _PeerSortDropdownState extends State<PeerSortDropdown> {
void initState() {
if (!PeerSortType.values.contains(peerSort.value)) {
peerSort.value = PeerSortType.remoteId;
bind.setLocalFlutterConfig(
bind.setLocalFlutterOption(
k: "peer-sorting",
v: peerSort.value,
);
@@ -591,7 +591,7 @@ class _PeerSortDropdownState extends State<PeerSortDropdown> {
dense: true, (String? v) async {
if (v != null) {
peerSort.value = v;
await bind.setLocalFlutterConfig(
await bind.setLocalFlutterOption(
k: "peer-sorting",
v: peerSort.value,
);

View File

@@ -41,7 +41,7 @@ class LoadEvent {
final peerSearchText = "".obs;
/// for peer sort, global obs value
final peerSort = bind.getLocalFlutterConfig(k: 'peer-sorting').obs;
final peerSort = bind.getLocalFlutterOption(k: 'peer-sorting').obs;
// list for listener
final obslist = [peerSearchText, peerSort].obs;
@@ -261,7 +261,7 @@ class _PeersViewState extends State<_PeersView> with WindowListener {
// fallback to id sorting
if (!PeerSortType.values.contains(sortedBy)) {
sortedBy = PeerSortType.remoteId;
bind.setLocalFlutterConfig(
bind.setLocalFlutterOption(
k: "peer-sorting",
v: sortedBy,
);