Skip to content

Instantly share code, notes, and snippets.

🎉
Mostly Android stuff now, also FP

Jorge Castillo JorgeCastilloPrz

🎉
Mostly Android stuff now, also FP
Block or report user

Report or block JorgeCastilloPrz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JorgeCastilloPrz
JorgeCastilloPrz / MyFlutterFabLoaderApp.kt
Created Jun 4, 2019
This is a simple sample app for running our custom StatefulWidget.
View MyFlutterFabLoaderApp.kt
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'FabLoader Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
@JorgeCastilloPrz
JorgeCastilloPrz / FabLoadingWidget.kt
Created Jun 4, 2019
Stateful widget used to retain animations to calculate values for painting the arc.
View FabLoadingWidget.kt
class _FabLoadingWidget extends State<FabLoader>
with SingleTickerProviderStateMixin {
final Widget child;
final double strokeWidth;
AnimationController _controller;
_FabLoadingWidget({@required this.strokeWidth, @required this.child});
@override
View ArcRotationTween.kt
final Animatable<double> _kRotationTween = CurveTween(curve: const SawTooth(5));
@JorgeCastilloPrz
JorgeCastilloPrz / StepTween.kt
Created Jun 4, 2019
Current arc progress StepTween
View StepTween.kt
final Animatable<int> _kStepTween = StepTween(begin: 0, end: 5);
@JorgeCastilloPrz
JorgeCastilloPrz / ArcTailTween.kt
Created Jun 4, 2019
Arc tail animation Tween.
View ArcTailTween.kt
final Animatable<double> _kStrokeTailTween = CurveTween(
curve: const Interval(0.5, 1.0, curve: Curves.fastOutSlowIn),
).chain(CurveTween(
curve: const SawTooth(5),
));
View ArcHeadTween.kt
final Animatable<double> _kStrokeHeadTween = CurveTween(
curve: const Interval(0.0, 0.5, curve: Curves.fastOutSlowIn),
).chain(CurveTween(
curve: const SawTooth(5),
));
View ArcPainter4.dart
class ArcPainter extends CustomPainter {
// ...
@override
void paint(Canvas canvas, Size size) {
if (backgroundColor != null) {
final Paint backgroundPaint = Paint()
..color = backgroundColor
..strokeWidth = strokeWidth
..style = PaintingStyle.stroke;
@JorgeCastilloPrz
JorgeCastilloPrz / ArcPainter3.dart
Created May 29, 2019
ArcPainter, rendering background colored circle.
View ArcPainter3.dart
class ArcPainter extends CustomPainter {
// ...
@override
void paint(Canvas canvas, Size size) {
if (backgroundColor != null) {
final Paint backgroundPaint = Paint()
..color = backgroundColor
..strokeWidth = strokeWidth
..style = PaintingStyle.stroke;
@JorgeCastilloPrz
JorgeCastilloPrz / ArcPainter2.dart
Created May 29, 2019
ArcPainter with overriden paint method.
View ArcPainter2.dart
class ArcPainter extends CustomPainter {
ArcPainter({
this.strokeWidth,
this.backgroundColor,
this.valueColor,
this.headValue,
this.tailValue,
this.stepValue,
this.rotationValue
})
@JorgeCastilloPrz
JorgeCastilloPrz / ArcPainter1.dart
Last active May 29, 2019
CustomPainter declaration
View ArcPainter1.dart
class ArcPainter extends CustomPainter {
ArcPainter({
this.strokeWidth,
this.backgroundColor,
this.valueColor,
this.headValue,
this.tailValue,
this.stepValue,
this.rotationValue
})
You can’t perform that action at this time.