Skip to content

Instantly share code, notes, and snippets.

View debojyoti452's full-sized avatar
🌏
an artist who codes

Debojyoti Singha debojyoti452

🌏
an artist who codes
View GitHub Profile
@psygo
psygo / reflection_and_annotations.md
Last active March 31, 2024 16:48
Reflection and Annotations in Dart

Reflection in Dart

Unfortunately, [since mirrors currently bloat compiled code][no_support_mirrors], it isn't supported for Flutter or web apps. A [workaround][source_gen_tutorial] would be to use a package like [source_gen][source_gen].

dart:mirrors

Most of the info here, comes from [Understanding Reflection and Annotations in Dart tutorial][reflection_tutorial], from the Fullstack Dart and Flutter Tutorials YouTube channel. He also created a [gist][gist_tutorial] with it.

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@androidseb
androidseb / TintableRatingBar
Last active June 20, 2020 11:04
Extends AppCompatRatingBar with the ability to tint the drawn stars when selected, pressed and un-selected. Limitation: Only draws full stars.
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.PointF;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.AppCompatRatingBar;