This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| double getScaledSize(int index) { | |
| return getPropertyValue( | |
| index: index, | |
| baseValue: baseItemHeight, | |
| maxValue: 70, | |
| nonHoveredMaxValue: 50, | |
| ); | |
| } | |
| double getTranslationY(int index) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:typed_data'; | |
| import 'package:meta/meta.dart'; | |
| /// Image formats supported by Flutter. | |
| enum ImageFormat { | |
| /// A Portable Network Graphics format image. | |
| png, | |
| /// A JPEG format image. | |
| /// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| // TODO edit your app | |
| void main() { | |
| print('Hello from your Flutter app!'); | |
| runApp(MyApp()); | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar( | |
| title: Text(widget.title), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar( | |
| title: Text(widget.title), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Container( | |
| color: MediaQuery.of(context).highContrast ? highContrastBgColor : BgColor, | |
| child: const Text("Hello World!"), | |
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Bar extends BodyComponent with ContactCallbacks, KeyboardHandler { | |
| late BodyDef bodyDef; | |
| late Vector2 barPosition; | |
| @override | |
| Body createBody() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma glslify: range = require('glsl-range'); | |
| void main () { | |
| // Your incoming value | |
| float x = 25.0; | |
| // Map value to 0..1 domain | |
| // (no need if x is already in 0..1 range) | |
| float min = 10.0; | |
| float max = 100.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //get the position of the latest coordinate on the curve at any point in animation based on animation position(t) | |
| class BezierTween extends Tween<Offset> { | |
| BezierTween({required this.begin, required this.end, required this.control}) | |
| : super(begin: begin, end: end); | |
| @override | |
| final Offset begin; | |
| @override | |
| final Offset end; | |
| final Offset control; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Implementation of De Casteljau's algorithm in dart | |
| // ref - https://pomax.github.io/bezierinfo/#splitting, https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm, | |
| List<List<math.Point<num>>> drawCurvePoint(List<math.Point> points, double t) { | |
| final List<math.Point<num>> left = <math.Point>[]; | |
| final List<math.Point<num>> right = <math.Point>[]; | |
| if (points.length == 1) { | |
| left.add(points[0]); | |
| right.add(points[0]); |