Skip to content

Instantly share code, notes, and snippets.

void main() {
print(fullName(null, null));
print(fullName('John', null));
print(fullName(null, 'Doe'));
print(fullName("John", 'Doe'));
}
@jezell
jezell / main.dart
Last active June 12, 2024 15:58
draggable
// Copyright 2019 the Dart project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
import UIKit
import Flutter
import app_links
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
class Test {
late Object? x = null;
void talk() {
print("value: $x");
}
}
void main() {
Test()..talk();
@jezell
jezell / memory_monitor.dart
Created June 1, 2024 01:06
Memory Monitor
import "package:flutter/material.dart";
import "package:google_fonts/google_fonts.dart";
import "memory_usage.dart" if (dart.library.html) 'memory_usage_web.dart';
import "dart:async";
const showMemMonitor = bool.fromEnvironment("SHOW_MEM_MONITOR");
class MemoryMonitor extends StatefulWidget {
const MemoryMonitor({super.key});
// Copyright 2019 the Dart project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class CenteredText extends StatelessWidget {
const CenteredText(this.text, {super.key, required this.style});
// Copyright 2019 the Dart project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class CenteredText extends StatelessWidget {
const CenteredText(this.text, {super.key, required this.style});
.slide-in {
animation: slide-in .5s forwards;
overflow: hidden;
}
@keyframes slide-in {
from {
max-height: 0px;
}
@jezell
jezell / kubernetes-websocket.go
Created September 25, 2016 08:04
Connect to Kubernetes endpoint over websockets
package main
import (
"bytes"
"flag"
"golang.org/x/net/websocket"
"io"
"k8s.io/client-go/1.4/rest"
"k8s.io/client-go/1.4/tools/clientcmd"
"log"
function hello() {
}