mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-04 15:49:49 +00:00
40 lines
942 B
Dart
40 lines
942 B
Dart
import 'dart:convert';
|
|
import 'dart:typed_data';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
class CreateController extends GetxController
|
|
with GetSingleTickerProviderStateMixin {
|
|
// final files = [].obs;
|
|
final RxList fileInfos = [].obs;
|
|
final RxList selectedIndexes = [].obs;
|
|
final RxList openedFolders = [].obs;
|
|
final isResolving = false.obs;
|
|
final showAdvanced = false.obs;
|
|
late TabController advancedTabController;
|
|
final oldUrl = "".obs;
|
|
final fileDataUri = "".obs;
|
|
|
|
@override
|
|
void onInit() {
|
|
super.onInit();
|
|
advancedTabController = TabController(length: 2, vsync: this);
|
|
}
|
|
|
|
@override
|
|
void onClose() {
|
|
advancedTabController.dispose();
|
|
super.onClose();
|
|
}
|
|
|
|
void setFileDataUri(Uint8List bytes) {
|
|
fileDataUri.value =
|
|
"data:application/x-bittorrent;base64,${base64.encode(bytes)}";
|
|
}
|
|
|
|
void clearFileDataUri() {
|
|
fileDataUri.value = "";
|
|
}
|
|
}
|