Skip to content

Signals to drive Flutter Animations #114

Closed Answered by rodydavis
rodydavis asked this question in Q&A
Discussion options

You must be logged in to vote

It is a small change but it is now working:

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:signals/signals_flutter.dart';

class Sample extends StatelessWidget {
  const Sample({super.key});

  @override
  Widget build(BuildContext context) {
    final ticker = TickerSignal(); // could be a global
    final controller = ticker.toAnimationController(
        duration: const Duration(seconds: 1)); // can be local or global
    final curve = CurvedAnimation(
        parent: controller,
        curve: Curves.easeOut); // can be used outside of widget tree
    final alpha = IntTween(begin: 0, end: 255).animate(curve);
    final alphaSignal =
        valueListenabl…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@rodydavis
Comment options

rodydavis Apr 16, 2024
Maintainer Author

@snakeshift
Comment options

Comment options

rodydavis
Apr 16, 2024
Maintainer Author

You must be logged in to vote
3 replies
@rodydavis
Comment options

rodydavis Apr 16, 2024
Maintainer Author

@rodydavis
Comment options

rodydavis Apr 16, 2024
Maintainer Author

@snakeshift
Comment options

Answer selected by rodydavis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants