How to align Row in a Column despite setting alignments?

I want to align following cards in a way that on both sides margin is same, but as you can see on right side, margin is increased. I have added required alignments to the Column, but margin on right is still more Code: body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: rows.map((row) => Row(children:… Read More How to align Row in a Column despite setting alignments?

How to play different animations when a button is tapped depending on the current state?

I have a widget that is using a GestureDetector and AnimatedBuilder to play an animation when the button is tapped. I can play a single animation without issue. What I want to do is be able to play three different animations on the button (different colors, different duration) depending on the state. Ex; If State… Read More How to play different animations when a button is tapped depending on the current state?

How to animate a drawPaint using a custom painter?

I want to achieve this: This is my code: import ‘package:flutter/material.dart’; import ‘dart:math’ as math; class CustomTimePainter extends CustomPainter { CustomTimePainter({ required this.animation, required this.backgroundColor, required this.color, }) : super(repaint: animation); final Animation<double> animation; final Color backgroundColor, color; @override void paint(Canvas canvas, Size size) { var paint = Paint() ..color = const Color.fromARGB(255, 204, 255,… Read More How to animate a drawPaint using a custom painter?

How to make animation value always run from 0 to 1

I’m trying to create an animation tween from 0 to 1: final Tween<double> _tween = Tween(begin: 0, end: 1); late AnimationController _controller; late Animation<double> _animation; And for some reason, sometimes I need to call _controller.reverse() or _controller.forward(), and my animation.value runs from 0 to 1 then from 1 to 0. How do I always get… Read More How to make animation value always run from 0 to 1

How to animate background color on ElevatedButton?

I would like to create a fade between two background colors when my ElevatedButton change his state to disable, how can I do that ? final _buttonStyle = ElevatedButton.styleFrom( backgroundColor: Colors.white, disabledBackgroundColor: Colors.white.withOpacity(0.5), animationDuration: const Duration(milliseconds: 0), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), ); I see there is an animationDuration property, however it seems to only create a… Read More How to animate background color on ElevatedButton?