Skip to content

Instantly share code, notes, and snippets.

View cleong98's full-sized avatar
πŸ‰
ζˆ‘ε«ι˜Ώθ‰―οΌŒ ε–„θ‰―ηš„θ‰―

cleong98

πŸ‰
ζˆ‘ε«ι˜Ώθ‰―οΌŒ ε–„θ‰―ηš„θ‰―
  • Malaysia
  • 22:54 (UTC +08:00)
View GitHub Profile
@cleong98
cleong98 / main.dart
Created May 23, 2023 11:04
try-enum
void main() {
final p = PortType.typeA;
print(PortType.fromString('123'));
print(PortType.fromString('Type-C'));
print(p.isUsb);
}
enum PortType {
typeA('Type-A'),
import 'dart:ffi';
import 'dart:math';
import 'package:flutter/material.dart';
import 'dart:math' as math;
extension ConvertRadianOrAngleExtension on double {
double get toAngle => this * 180 / (pi);
double get toRadian => this * pi / 180;