Skip to content

Instantly share code, notes, and snippets.

View aecea's full-sized avatar

Duc-Thien Bui aecea

  • aecea
  • Cadenberge
View GitHub Profile
@WebReflection
WebReflection / esx.md
Last active October 6, 2024 12:35
Proposal: an ESX for JS implementation
@sma
sma / star_rating.dart
Created March 24, 2019 11:09
A simple star display and interactive star rating widget
import 'package:flutter/material.dart';
class StarDisplayWidget extends StatelessWidget {
final int value;
final Widget filledStar;
final Widget unfilledStar;
const StarDisplayWidget({
Key key,
this.value = 0,
@sma
sma / wrapping_text.dart
Last active April 22, 2019 11:31
A variant of the Text widget that displays with its intrinsic width when wrapping to multiple lines
class WrappingText extends StatelessWidget {
final String data;
final TextStyle style;
final TextAlign textAlign;
final TextDirection textDirection;
final Locale locale;
final bool softWrap;
final TextOverflow overflow;
final double textScaleFactor;
final int maxLines;
@sma
sma / parse_xml.dart
Created December 8, 2018 19:59
A tiny XML parser written in Dart
/// Parses [input] as XML document.
/// It assumes that the document is well-formed.
/// CDATA sections and DTDs are not supported.
void parseXml(
String input, {
@required void Function(String name, Map<String, String> attributes) onStartTag,
@required void Function(String name) onEndTag,
@required void Function(String text) onText,
}) {
for (Match m in _tags.allMatches(input)) {
import 'package:flutter/material.dart';
import 'dart:math' as math;
import 'dart:async';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {