style_widget concept
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/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; | |
import 'package:timezone/data/latest_all.dart' as tz; | |
import 'package:timezone/timezone.dart' as tz; | |
extension EasyFlutterLocalNotifications on FlutterLocalNotificationsPlugin { | |
Future<void> easyInitialize() async { | |
tz.initializeTimeZones(); | |
await initialize( |
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
class NotificationController extends SimpleNotifications { | |
DateTime? trialExpiring = DateTime(2025, 2, 7, 6); | |
var winback = true; | |
var remindWorkouts = true; | |
var aiGirlfriendMessages = { | |
Duration(hours: 1): "whats up?", | |
Duration(hours: 2): "where are you?", | |
Duration(hours: 3): "do you still love me??", | |
}; |
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:async'; | |
import 'dart:convert'; | |
import 'dart:math'; | |
import 'dart:ui'; | |
import 'package:app/components/lifecycle_builder.dart'; | |
import 'package:app/components/button.dart'; | |
import 'package:app/components/cancelling_builder.dart'; | |
import 'package:app/components/keep_any_alive.dart'; | |
import 'package:app/components/listenables_builder.dart'; |
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
# install dart | |
sudo apt-get update && sudo apt-get install apt-transport-https | |
wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub \ | |
| sudo gpg --dearmor -o /usr/share/keyrings/dart.gpg | |
echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' \ | |
| sudo tee /etc/apt/sources.list.d/dart_stable.list | |
sudo apt-get update && sudo apt-get install dart | |
# install sqlite3 | |
sudo apt install libsqlite3-dev |
vim /lib/systemd/system/pocketbase.service
systemctl enable pocketbase
systemctl start pocketbase
systemctl status pocketbase
systemctl stop pocketbase
systemctl restart pocketbase
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:io'; | |
Future<void> main(List<String> arguments) async { | |
final x1 = tryOrNull(() => throwing()); | |
print(x1); | |
final (v1, e1) = tryTuple(() => throwing()); | |
print("$v1, $e1"); | |
final (v2, e2) = tryTuple(() => nonThrowing()); |
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:collection/collection.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import '/architecture/let.dart'; | |
import '/membership/membership_state.dart'; | |
import '/membership/membership_tasks.dart'; | |
import '/telemetry/analytics.dart'; | |
Future<void> appOpenAction() async { | |
$analytics.vglAppOpenActionRequested(); |
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:io'; | |
import 'package:xml/xml.dart'; | |
Future<void> main() async { | |
final str = File('./markers.fcpxmld/Info.fcpxml').readAsStringSync(); | |
final xml = XmlDocument.parse(str); | |
final markers = xml.findAllElements('marker'); | |
for (final x in markers) { |
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 '/features/architecture/logging.dart'; | |
class CachedQuery<T> { | |
final Duration invalidation; | |
final Future<T> Function(String key) fn; | |
CachedQuery( | |
this.fn, | |
this.invalidation, | |
); |
NewerOlder