mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 15:54:35 +01:00
fix: cloud sync (#769)
This commit is contained in:
@@ -1,36 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:icons_plus/icons_plus.dart';
|
||||
import 'package:server_box/core/extension/context/locale.dart';
|
||||
import 'package:server_box/data/res/store.dart';
|
||||
|
||||
part 'server_func.g.dart';
|
||||
|
||||
@HiveType(typeId: 6)
|
||||
enum ServerFuncBtn {
|
||||
@HiveField(0)
|
||||
terminal._(),
|
||||
@HiveField(1)
|
||||
sftp._(),
|
||||
@HiveField(2)
|
||||
container._(),
|
||||
@HiveField(3)
|
||||
process._(),
|
||||
//@HiveField(4)
|
||||
//pkg,
|
||||
@HiveField(5)
|
||||
snippet._(),
|
||||
@HiveField(6)
|
||||
iperf._(),
|
||||
// @HiveField(7)
|
||||
// pve,
|
||||
@HiveField(8)
|
||||
systemd._(1058),
|
||||
terminal(),
|
||||
sftp(),
|
||||
container(),
|
||||
process(),
|
||||
//pkg(),
|
||||
snippet(),
|
||||
iperf(),
|
||||
// pve(),
|
||||
systemd(1058),
|
||||
;
|
||||
|
||||
final int? addedVersion;
|
||||
|
||||
const ServerFuncBtn._([this.addedVersion]);
|
||||
const ServerFuncBtn([this.addedVersion]);
|
||||
|
||||
static void autoAddNewFuncs(int cur) {
|
||||
if (cur >= systemd.addedVersion!) {
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'server_func.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class ServerFuncBtnAdapter extends TypeAdapter<ServerFuncBtn> {
|
||||
@override
|
||||
final int typeId = 6;
|
||||
|
||||
@override
|
||||
ServerFuncBtn read(BinaryReader reader) {
|
||||
switch (reader.readByte()) {
|
||||
case 0:
|
||||
return ServerFuncBtn.terminal;
|
||||
case 1:
|
||||
return ServerFuncBtn.sftp;
|
||||
case 2:
|
||||
return ServerFuncBtn.container;
|
||||
case 3:
|
||||
return ServerFuncBtn.process;
|
||||
case 5:
|
||||
return ServerFuncBtn.snippet;
|
||||
case 6:
|
||||
return ServerFuncBtn.iperf;
|
||||
case 8:
|
||||
return ServerFuncBtn.systemd;
|
||||
default:
|
||||
return ServerFuncBtn.terminal;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, ServerFuncBtn obj) {
|
||||
switch (obj) {
|
||||
case ServerFuncBtn.terminal:
|
||||
writer.writeByte(0);
|
||||
break;
|
||||
case ServerFuncBtn.sftp:
|
||||
writer.writeByte(1);
|
||||
break;
|
||||
case ServerFuncBtn.container:
|
||||
writer.writeByte(2);
|
||||
break;
|
||||
case ServerFuncBtn.process:
|
||||
writer.writeByte(3);
|
||||
break;
|
||||
case ServerFuncBtn.snippet:
|
||||
writer.writeByte(5);
|
||||
break;
|
||||
case ServerFuncBtn.iperf:
|
||||
writer.writeByte(6);
|
||||
break;
|
||||
case ServerFuncBtn.systemd:
|
||||
writer.writeByte(8);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is ServerFuncBtnAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
Reference in New Issue
Block a user