Skip to content

Instantly share code, notes, and snippets.

View LiewJunTung's full-sized avatar

Liew Jun Tung LiewJunTung

View GitHub Profile
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. 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(MyApp());
class MyApp extends StatelessWidget {
@override
animation_button.setOnClickListener {
it.apply {
val transition = ChangeBounds()
transition.duration = 2000L
TransitionManager.beginDelayedTransition(constraint_parent_view, transition)
when {
translationX == 0f -> translationX = 450f
translationX < 0f -> translationX = 0f
translationX > 0f -> translationX = -450f
}
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let json = "{\n \"a\": \"a\",\n \"a_\": \"a_\",\n \"a_a\": \"a_a\",\n \"a_a_\": \"a_a_\",\n \"a_a_a\": \"a_a_a\",\n \"a_a_a_\": \"a_a_a_\",\n \"a_a_a_a\": \"a_a_a_a\",\n \"a_a_a_a_\": \"a_a_a_a_\",\n \"a_a_a_a_a\": \"a_a_a_a_a\",\n \"a_a_a_a_a_\": \"a_a_a_a_a_\",\n \"a_a_a_a_a_a\": \"a_a_a_a_a_a\",\n \"a_a_a_a_a_a_\": \"a_a_a_a_a_a_\",\n \"a_a_a_a_a_a_a\": \"a_a_a_a_a_a_a\",\n \"a_a_a_a_a_a_a_\": \"a_a_a_a_a_a_a_\",\n \"a_a_a_a_a_a_a_a\": \"a_a_a_a_a_a_a_a\",\n \"a_a_a_a_a_a_a_a_\": \"a_a_a_a_a_a_a_a_\",\n \"a_a_a_a_a_a_a_a_a\": \"a_a_a_a_a_a_a_a_a\",\n \"a_a_a_a_a_a_a_a_a_\": \"a_a_a_a_a_a_a_a_a_\",\n \"a_a_a_a_a_a_a_a_a_a\": \"a_a_a_a_a_a_a_a_a_a\",\n \"a_a_a_a_a_a_a_a_a_a_\": \"a_a_a_a_a_a_a_a_a_a_\",\n \"a_a_a_a_a_a_a
class Dog {
String name;
int age;
Dog(this.name, this.age);
}
class DogHouse {
Dog dog;
DogHouse(this.dog);
void main(){
var map = {"a": "b"};
var map2 = {"b": "c"};
print({...map, ...map2, "c": "d"});
var list = ["a", "b"];
var list2 = ["c", "d"];
print([...list, ...list2, "f", "g"]);
}
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
class Dog {
String name;
int age;
Dog(this.name, this.age);
}
class Cat {
String name;
int age;
import 'dart:async';
Future<String> networkCallGetString() async {
await Future.delayed(Duration(seconds: 5));
return "Simulated Network Call";
}
doNetworkCall() async {
var result = networkCallGetString();
print(result);
extension NumberParsing on String {
int parseInt() {
return int.parse(this);
}
double parseDouble() {
return double.parse(this);
}
}
package com.netvirta.ci_image_resize_plugin
import javax.imageio.ImageIO
import java.awt.image.BufferedImage;
import java.io.File
import javax.imageio.stream.ImageInputStream
class CiImageResize {
fun resize(inputJpgFilePath: String, outputJpgFilePath: String, outputWidth: Int, outputHeight: Int) {