Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Details on how BlueBubbles integrates with Tasker
How can you support the project?
If you are using GitHub releases for one reason or another, whether it's because of Android Auto support or something else, follow this guide to receive automatic updates.
%url variable.Add App tab
sudo apt-get -y install libnotify-dev vlc libvlc-dev appindicator3-0.1 libappindicator3-devGIPHY_API_KEY = ""flutter clean
git reset
flutter build windows@JS()
import 'package:js/js.dart';
import 'package:js/js_util.dart';
// Call invokes JavaScript `getPastedImage()`.
@JS('getPastedImage')
external dynamic getClipboardData();
Future<dynamic> getPastedImageWeb() {
return promiseToFuture(getClipboardData());
}function checkClipboard() {
return new Promise(resolve => {
navigator.permissions.query({ name: "clipboard-read" }).then((result) => {
// If permission to read the clipboard is granted or if the user will
// be prompted to allow it, we proceed.
if (result.state == "granted" || result.state == "prompt") {
navigator.clipboard.read().then((data) => {
for (let i = 0; i < data.length; i++) {
if (!data[i].types.includes("image/png")) {
resolve(null);
} else {
data[i].getType("image/png").then((blob) => {
resolve(blob);
});
}
}
});
} else {
resolve(null);
}
});
});
}
async function getPastedImage() {
const result = await checkClipboard();
return result;
}import 'package:objectbox/objectbox.dart';
@Entity()
class ScheduledMessage {
int? id;
String? chatGuid;
String? message;
int? epochTime;
bool? completed;
ScheduledMessage({this.id, this.chatGuid, this.message, this.epochTime, this
}class ScheduledMessage {
int? id;
String? chatGuid;
String? message;
int? epochTime;
bool? completed;
ScheduledMessage({this.id, this.chatGuid, this.message, this.epochTime, this
}export 'package:path/to/io/scheduled.dart'
if (dart.library.html) 'package:path/to/html/scheduled.dart';import 'package:objectbox/objectbox.dart';
void openObjectbox() {
store = await openStore(directory: '/objectbox');
...
}void openObjectbox() {}prefs.setString("objectbox-reference", base64.encode(store.reference.buffer.asUint8List()));@Entity()
class Chat {
//other parameters here
static Future<List<Chat>> getChats({int limit = 15, int offset = 0}) async {
return await compute(getChatsIsolate, [limit, offset, prefs.getString("objectbox-reference")!, fakeNames]);
}
}/// Async method to get chats from objectbox
Future<List<Chat>> getChatsIsolate(List<dynamic> stuff) async {
/// Pull args from input and create new instances of store and boxes
store = Store.fromReference(getObjectBoxModel(), base64.decode(stuff[2]).buffer.asByteData());
attachmentBox = store.box<Attachment>();
chatBox = store.box<Chat>();
handleBox = store.box<Handle>();
messageBox = store.box<Message>();
return store.runInTransaction(TxMode.read, () {
/// Query the [chatBox] for chats with limit and offset, prioritize pinned
/// chats and order by latest message date
final query = (chatBox.query()
..order(Chat_.isPinned, flags: Order.descending)
..order(Chat_.latestMessageDate, flags: Order.descending))
.build();
query
..limit = stuff[0]
..offset = stuff[1];
final chats = query.find();
query.close();
return chats;
});
}@Entity()
class Chat {
//other parameters here
static Future<List<Chat>> getChats({int limit = 15, int offset = 0}) async {
final task = GetChatAttachments([id!, prefs.getString("objectbox-reference")]);
return (await createAsyncTask<List<Attachment>>(task)) ?? [];
}
}/// Async method to get chats from objectbox
class GetChats extends AsyncTask<List<dynamic>, List<Chat>> {
final List<dynamic> stuff;
GetChats(this.stuff);
@override
AsyncTask<List<dynamic>, List<Chat>> instantiate(List<dynamic> parameters, [Map<String, SharedData>? sharedData]) {
return GetChats(parameters);
}
@override
List<dynamic> parameters() {
return stuff;
}
@override
FutureOr<List<Chat>> run() {
return store.runInTransaction(TxMode.read, () {
/// Query the [chatBox] for chats with limit and offset, prioritize pinned
/// chats and order by latest message date
final query = (chatBox.query()
..order(Chat_.isPinned, flags: Order.descending)
..order(Chat_.latestMessageDate, flags: Order.descending))
.build();
query
..limit = stuff[0]
..offset = stuff[1];
final chats = query.find();
query.close();
return chats;
});
}
}/// Create a "fake" asynchronous task from a traditionally synchronous task
///
/// Used for heavy ObjectBox read/writes to avoid causing jank
Future<T?> createAsyncTask<T>(AsyncTask<List<dynamic>, T> task) async {
final executor = AsyncExecutor(parallelism: 0, taskTypeRegister: () => [task]);
executor.logger.enabled = true;
executor.logger.enabledExecution = true;
await executor.execute(task);
return task.result;
}//run inside initState
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
if (ModalRoute.of(context)?.animation != null) {
if (ModalRoute.of(context)?.animation?.status != AnimationStatus.completed) {
late final AnimationStatusListener listener;
listener = (AnimationStatus status) {
if (status == AnimationStatus.completed) {
fetchAttachments();
ModalRoute.of(context)?.animation?.removeStatusListener(listener);
}
};
ModalRoute.of(context)?.animation?.addStatusListener(listener);
} else {
fetchAttachments();
}
} else {
fetchAttachments();
}
});String? storeRef = prefs.getString("objectbox-reference");
if (storeRef != null) {
debugPrint("Opening ObjectBox store from reference");
try {
store = Store.fromReference(getObjectBoxModel(), base64.decode(storeRef).buffer.asByteData());
} catch (_) {
debugPrint("Failed to open store from reference, opening from path");
store = await openStore(directory: documentsDirectory.path + '/objectbox');
}
} else {
debugPrint("Opening ObjectBox store from path");
store = await openStore(directory: documentsDirectory.path + '/objectbox');
}prefs.setString("objectbox-reference", base64.encode(store.reference.buffer.asUint8List()));