Future<O> _read<I, O>(String key, Map<String, dynamic> defaults, [O Function(I)? map]) async { | |
if (I == O) { | |
map ??= (value) => value as O; | |
} else if (map == null) { | |
throw ArgumentError(); | |
} | |
try { | |
return switch (I) { | |
const (bool) => map(await db.getBoolean(key) as I), | |
const (int) => map(await db.getInteger(key) as I), |
There's this free coffee at the office that you can get. Not the best but good enough to feed caffeine requirement. One day I leave to get coffee somewhere else... I no longer find the taste in the ones I was having daily. I feel like your random messages leave me too sensitised the same way. It gets hard to focus on regular life & not think about you. It's very hard for me. I don't have the courage to say directly, but you're making everything very difficult.
%%{
init: {
'themeVariables': {
'fontFamily': 'BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji'
}
}
}%%
classDiagram
import 'dart:io'; | |
import 'dart:async'; | |
import 'dart:typed_data'; | |
import 'package:path/path.dart'; | |
/// Prefix needed on Windows for safely accessing local storage with long file path support. | |
const String _kWindowsLongFileSystemPathPrefix = '\\\\?\\'; | |
/// Adds `\\?\` prefix to the path if it is not already added & ensures all separators are `\\` on Windows. | |
String _clean(String path) { |
import 'dart:io'; | |
import 'dart:math'; | |
import 'dart:isolate'; | |
import 'package:image/image.dart'; | |
import 'package:http/http.dart' as http; | |
import 'package:flutter/foundation.dart'; | |
import 'package:safe_local_storage/safe_local_storage.dart'; | |
/// This method crops passed given [image] into square & returns it | |
/// as [Uint8List] in JPEG format. |
Embedding native windows into Flutter window.
A Flutter plugin / C++ library to embed other native Windows (HWND
on Windows, GtkWidget*
on Linux etc.) into Flutter window.
Current API design allows to embed any arbitrary HWND
completely from Dart as a Widget
. This can be a good choice when client code wants to embed any arbitrary third-party window (which is already opened) into the Flutter window.
However, this is not ideal in most cases because there is almost no point of embedding a third-party window directly (which will lack programmatic control via some API).
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
class WindowsLoader extends StatefulWidget { | |
final double size; | |
final Color color; | |
WindowsLoader({@required this.size,@required this.color}); | |
_WindowsLoaderState createState() => _WindowsLoaderState(); |
#include <string> | |
#include <vector> | |
class String { | |
public: | |
static bool startsWith(std::string string, std::string subString) { | |
if (string.substr(0, subString.size()) == subString) return true; | |
else return false; | |
} |