Giter Site home page Giter Site logo

abuanwar072 / build-an-animated-app-with-rive-and-flutter Goto Github PK

View Code? Open in Web Editor NEW
288.0 288.0 104.0 174.43 MB

Kotlin 0.01% Swift 0.27% Objective-C 24.26% Dart 2.43% CMake 1.03% C++ 1.23% C 5.07% HTML 0.10% Ruby 0.15% Makefile 65.37% Shell 0.08%

build-an-animated-app-with-rive-and-flutter's Introduction

Hi ๐Ÿ‘‹, I'm Abu Anwar

A self-taught programmer and born at very little age๐Ÿ˜œ

Twitter Follow GitHub followers

  • ๐Ÿ”ญ Iโ€™m currently working on TakeIn, The Flutter Way

  • ๐ŸŒฑ Iโ€™m currently learning Flutter, SwiftUI

  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate with other content creators

  • โšก Fun fact I love to play Badminton and Chai over coffee.

Connect with me:

abuanwar072 abuanwar072 ucjm7i4g4z7zgcja_hkhlcvw


Languages and Tools:

dart django figma firebase flask flutter git linux mysql postgresql python sketch swift

abuanwar072

ย abuanwar072

build-an-animated-app-with-rive-and-flutter's People

Contributors

abuanwar072 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

build-an-animated-app-with-rive-and-flutter's Issues

Problem with Rive button

I tried to code simple rive button from your code and my button works strangely. If I add your riv button I have this same problem too. Can you try my code and will tell me what is wrong?

import 'package:flutter/material.dart';
import 'package:rive/rive.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'HOME PAGE',
      theme: ThemeData(
        textTheme: const TextTheme(
          titleLarge: TextStyle(fontSize: 25.0, color: Colors.lightBlueAccent),
        ),
        scaffoldBackgroundColor: const Color(0xFF011230),
      ),
      home: const MyHomePage(title: 'HOME PAGE'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  late RiveAnimationController _controller;

  @override
  void initState() {
    super.initState();
    _controller = OneShotAnimation(
      "active",
      autoplay: false,
    );
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        extendBodyBehindAppBar: true,
        appBar: AppBar(
          elevation: 0,
          centerTitle: true,
          title: Text(
            widget.title,
            style: const TextStyle(
                fontSize: 25,
                color: Colors.lightBlueAccent,
                fontWeight: FontWeight.bold,
                fontStyle: FontStyle.italic),
          ),
          backgroundColor: Colors.transparent,
        ),
        body: SizedBox(
            width: MediaQuery.of(context).size.width,
            height: MediaQuery.of(context).size.height,
            child: Container(
              padding: const EdgeInsets.only(
                  top: 60, right: 20, left: 20, bottom: 1),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                crossAxisAlignment: CrossAxisAlignment.center,
                mainAxisSize: MainAxisSize.max,
                children: <Widget>[
                  Flex(direction: Axis.horizontal, children: [
                    Expanded(
                        child: GestureDetector(
                      onTap: () {
                        _controller.isActive = true;
                        Future.delayed(
                          const Duration(milliseconds: 750),
                          () {
                            Navigator.push(
                              context,
                              MaterialPageRoute(
                                builder: (context) => const Test(),
                              ),
                            );
                          },
                        );
                      },
                      child: SizedBox(
                        height: 64,
                        width: MediaQuery.of(context).size.width,
                        child: RiveAnimation.asset(
                          "assets/RiveAssets/buttonT.riv",
                          controllers: [_controller],
                        ),
                      ),
                    )),
                  ]),
                ],
              ),
            )));
  }
}

class Test extends StatelessWidget {
  const Test({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          centerTitle: true,
          title: const Text(
            "NEXT PAGE",
            style: TextStyle(
              fontSize: 25,
              fontWeight: FontWeight.bold,
            ),
          ),
          backgroundColor: const Color(0xFF011230),
          elevation: 0,
        ),
        body: SizedBox(
            width: MediaQuery.of(context).size.width,
            height: MediaQuery.of(context).size.height,
            child: ListView(
              padding: const EdgeInsets.only(
                  top: 10, right: 20, left: 20, bottom: 5),
              children: <Widget>[
                Flex(
                  direction: Axis.horizontal,
                  children: [
                    Expanded(
                      child: ElevatedButton(
                        onPressed: () {},
                        child: const Text("test 1",
                            style: TextStyle(
                              fontSize: 20,
                              fontWeight: FontWeight.bold,
                            )),
                      ),
                    ),
                  ],
                ),
                const SizedBox(height: 15),
                Flex(
                  direction: Axis.horizontal,
                  children: [
                    Expanded(
                      child: ElevatedButton(
                        onPressed: () {},
                        child: const Text("test 2",
                            style: TextStyle(
                              fontSize: 20,
                              fontWeight: FontWeight.bold,
                            )),
                      ),
                    ),
                  ],
                ),
                const SizedBox(height: 15),
                Flex(
                  direction: Axis.horizontal,
                  children: [
                    Expanded(
                      child: ElevatedButton(
                        onPressed: () {},
                        child: const Text("test 3",
                            style: TextStyle(
                              fontSize: 20,
                              fontWeight: FontWeight.bold,
                            )),
                      ),
                    ),
                  ],
                ),
                const SizedBox(height: 5),
              ],
            )));
  }
}

Rive animation button https://rive.app/community/4478-9135-test-button/

Navigation

It would be cool to see episode 6 with the implementation of Go_router ๐Ÿคฉ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.