Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.04 KB

translate.md

File metadata and controls

48 lines (36 loc) · 1.04 KB

Translate

simple_fade

Simple Translate

   Spring.translate(
          beginOffset: Offset(100, 30),
          endOffset: Offset(-39, 200),
          child: RedCard(),
        ),

Customized Translate

import 'package:flutter/material.dart';
import 'package:spring/spring.dart';
import 'package:test123/red_card.dart';

class SpringExample extends StatelessWidget {
  

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: Center(
        child: Spring.translate(
          beginOffset: Offset(100, 30), //required
          endOffset: Offset(-39, -200), //required
          animDuration: Duration(seconds: 1), //def=1s
          animStatus: (AnimStatus status) {
            print(status);
          },
          curve: Curves.bounceInOut, //def=Curves.easInOut
          delay: Duration(seconds: 1), //def=0
          child: RedCard(),
        ),
      ),
    );
  }
}