Skip to content

Instantly share code, notes, and snippets.

@CalculatorLib
CalculatorLib / Lottie-decoder.dart
Created September 6, 2025 06:54
Flutter Lottie decoder
child: Lottie.network(
"https://lottie.host/422c67a2-7f5b-4ef3-a69b-93cde7745af2/jBshJ7zAOp.lottie",
decoder: (bytes) => LottieComposition.decodeZip(
bytes,
filePicker: (files) => files.firstWhere(
(f) => f.name.startsWith('animations/') && f.name.endsWith('.json'),
orElse: () => files.first, // fallback if structure differs
)
),
fit: BoxFit.contain
const FORMAT_NUMBER_CHARACTER = ',';
applyFormattingToInputs('numeric', formatNumeric);
applyFormattingToInputs('decimal', formatDecimal);
// Function to format input numeric value with a thousand separators
function formatNumeric(input) {
// Get the input value
const inputValue = input.value.toString();