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
// 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 |
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
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 | |
} |
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 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 |
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 Dog { | |
String name; | |
int age; | |
Dog(this.name, this.age); | |
} | |
class DogHouse { | |
Dog dog; | |
DogHouse(this.dog); |
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
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"]); | |
} |
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'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@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
class Dog { | |
String name; | |
int age; | |
Dog(this.name, this.age); | |
} | |
class Cat { | |
String name; | |
int age; |
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'; | |
Future<String> networkCallGetString() async { | |
await Future.delayed(Duration(seconds: 5)); | |
return "Simulated Network Call"; | |
} | |
doNetworkCall() async { | |
var result = networkCallGetString(); | |
print(result); |
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
extension NumberParsing on String { | |
int parseInt() { | |
return int.parse(this); | |
} | |
double parseDouble() { | |
return double.parse(this); | |
} | |
} |
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
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) { |
NewerOlder