You do this.
const handleEvent = e => {
setState(e.target.value);
console.log(state);
}| // Based on: https://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/ | |
| public static Matrix CreateBillboard(Vector3 position, Matrix view) | |
| { | |
| var result = Matrix.Identity; | |
| result.Translation = position; | |
| result.M11 = view.M11; | |
| result.M12 = view.M21; | |
| result.M13 = view.M31; | |
| result.M21 = view.M12; |
| var battleHowls = [ | |
| "PAM!", | |
| "BAM!", | |
| "BANG!", | |
| "BIFF!", | |
| "BLOOP!", | |
| "BONK!", | |
| "CLASH!", | |
| "CRASH!", | |
| "KAPOW!", |
| import * as React from "react" | |
| import { | |
| Frame, | |
| addPropertyControls, | |
| ControlType, | |
| useMotionValue, | |
| useAnimation, | |
| animate, | |
| Color, | |
| } from "framer" |
| func loadData() { | |
| guard let url = URL(string: "https://jsonplaceholder.typicode.com/todos") else { | |
| print("Invalid URL") | |
| return | |
| } | |
| let request = URLRequest(url: url) | |
| URLSession.shared.dataTask(with: request) { data, response, error in | |
| if let data = data { | |
| if let response = try? JSONDecoder().decode([TaskEntry].self, from: data) { |
| import * as React from "react"; | |
| import { Frame, addPropertyControls, ControlType } from "framer"; | |
| export function Component({ childComponent }) { | |
| return ( | |
| <div style={{ width: "100%" }}> | |
| {React.Children.map(childComponent, (child, index) => { | |
| return React.cloneElement(child, { | |
| width: "100%", | |
| key: index, |
| /// An iOS style TabView that doesn't reset it's childrens navigation stacks when tabs are switched. | |
| public struct UIKitTabView: View { | |
| private var viewControllers: [UIHostingController<AnyView>] | |
| private var selectedIndex: Binding<Int>? | |
| @State private var fallbackSelectedIndex: Int = 0 | |
| public init(selectedIndex: Binding<Int>? = nil, @TabBuilder _ views: () -> [Tab]) { | |
| self.viewControllers = views().map { | |
| let host = UIHostingController(rootView: $0.view) | |
| host.tabBarItem = $0.barItem |
| bool validateEmail(String value) { | |
| Pattern pattern = | |
| r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$'; | |
| RegExp regex = new RegExp(pattern); | |
| return (!regex.hasMatch(value)) ? false : true; | |
| } | |
| void main() { | |
| print(validateEmail("aslam@gmail.com")); | |
| } |
| import 'dart:async'; | |
| import 'dart:typed_data'; | |
| import 'dart:ui' as ui; | |
| import 'package:flutter/material.dart'; | |
| void main() async => runApp(MaterialApp(home: Root())); | |
| /// Waits till [ui.Image] is generated and renders | |
| /// it using [CustomPaint] to render it. Allows use of [MediaQuery] | |
| class Root extends StatelessWidget { |
| import { mergeUniforms } from 'three/src/renderers/shaders/UniformsUtils.js' | |
| import { UniformsLib } from 'three/src/renderers/shaders/UniformsLib.js' | |
| export default { | |
| uniforms: mergeUniforms([ | |
| UniformsLib.lights, | |
| UniformsLib.fog, | |
| ]), |