This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:signals/signals_flutter.dart'; | |
import 'package:signals_hooks/signals_hooks.dart'; | |
import 'package:sqlite3/common.dart'; | |
import 'package:sqlite3/sqlite3.dart'; | |
const _memoryPath = ':memory:'; | |
CommonDatabase useDatabase({ | |
String path = _memoryPath, | |
String? vfs, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
Future<String?> prompt(BuildContext context, {String? value, String title = 'Edit Text'}) async { | |
final controller = TextEditingController(text: value); | |
final theme = Theme.of(context); | |
final colors = theme.colorScheme; | |
final saved = await showDialog<bool>( | |
context: context, | |
builder: | |
(context) => AlertDialog( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sqlite3ext.h> | |
SQLITE_EXTENSION_INIT1 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdbool.h> | |
// Helper function to execute a SQL statement | |
static int execute_sql(sqlite3 *db, const char *sql) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ffi'; | |
import 'dart:typed_data'; | |
import 'package:sqlite3/sqlite3.dart'; | |
import 'package:sqlite3/src/ffi/implementation.dart'; | |
import 'package:uuid/uuid.dart'; | |
import 'hlc.dart'; | |
void main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ffi'; | |
import 'dart:io'; | |
import 'dart:typed_data'; | |
import 'package:sqlite3/sqlite3.dart'; | |
import 'package:sqlite3/src/ffi/implementation.dart'; | |
void main() { | |
final lib = DynamicLibrary.open('cr-sqlite/core/dist/sqlite3'); | |
final sqlite3 = FfiSqlite3(lib); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @ts-check | |
import { WebComponent } from "./utils.js"; | |
const tagName = "my-element"; | |
const template = /*html*/ ` | |
<span> | |
Hello, <span id="name">World</span>! | |
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:jaspr/jaspr.dart'; | |
import 'package:signals/signals_core.dart'; | |
import 'watch.dart'; | |
import 'embedded_counter.dart'; | |
class Counter extends StatefulComponent { | |
const Counter({super.key}); | |
@override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:js_interop'; | |
import 'dart:js_interop_unsafe'; | |
import 'package:web/web.dart'; | |
class WebComponent<T extends HTMLElement> { | |
late T element; | |
String get extendsType => 'HTMLElement'; | |
void connectedCallback() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:mustache_template/mustache_template.dart'; | |
import 'package:signals/signals_core.dart'; | |
import 'package:sqlite3/sqlite3.dart'; | |
class UndoRedoManager { | |
final Database _db; | |
UndoRedoManager(this._db); | |
bool _active = false; | |
List<List<int>> _undoStack = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:signals/signals_flutter.dart'; | |
final debugShowCheckedModeBanner = signal(false); | |
final app = computed<Widget>(() { | |
return MaterialApp( | |
debugShowCheckedModeBanner: debugShowCheckedModeBanner(), | |
home: home(), | |
); |
NewerOlder