sweep_animation_button 0.0.3 copy "sweep_animation_button: ^0.0.3" to clipboard
sweep_animation_button: ^0.0.3 copied to clipboard

New package enables you to create a button move with other properties to discover

example/lib/main.dart

// ignore_for_file: avoid_print
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:sweep_animation_button/sweep_animation_button.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
    return const MaterialApp(
        debugShowCheckedModeBanner: false, home: MyHomePage());
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool isChanged = true;
  Color kbackroundColor = Colors.deepPurple.shade100;
  Color kbackroundColorOne = Colors.deepPurple;
  bool visibility = true;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: isChanged ? kbackroundColor : kbackroundColorOne,
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(
              isChanged ? "Exemple 2" : "excellent",
              style: TextStyle(
                color: isChanged ? kbackroundColorOne : kbackroundColor,
                fontSize: 35,
                fontWeight: FontWeight.w600,
                letterSpacing: 1,
              ),
            ),
            SizedBox(height: isChanged ? 25 : 0),
            Visibility(
              visible: visibility,
              child: SweepAnimationButton(
                width: 250,
                height: 50,
                animationProgressColor: Colors.deepPurple[100],
                borderRadius: 0,
                animationColor: Colors.deepPurple,
                backroundColor: Colors.deepPurple[200],
                durationCircle: 5,
                hideIcon: true,
                child: Text(
                  "Sweeped Button",
                  style: TextStyle(
                    fontSize: 15,
                    color: Colors.deepPurple[700],
                    fontWeight: FontWeight.w600,
                    letterSpacing: 1,
                  ),
                ),
                onTap: () {
                  setState(() => isChanged = !isChanged);
                  setState(() => visibility = false);
                },
              ),
            ),
          ],
        ),
      ),
    );
  }
}
12
likes
140
points
6
downloads

Publisher

unverified uploader

Weekly Downloads

New package enables you to create a button move with other properties to discover

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on sweep_animation_button