Skip to content

Commit

Permalink
perf: improve animations
Browse files Browse the repository at this point in the history
  • Loading branch information
HayesGordon committed Jan 24, 2023
1 parent c59a9f4 commit 479eda7
Show file tree
Hide file tree
Showing 5 changed files with 358 additions and 318 deletions.
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
# Flutter Samples
# Optimised Animation's for Aashu-Dubey Demo App
The original code can be found [here](https://github.com/Aashu-Dubey/flutter-samples).

- [Animated App with Rive](./lib/rive_app#readme):- An application with interactive UI and animations, with custom UI components like Bottom TabBar and SideBar, and using animated assets from [Rive](https://rive.app) | [Demo](https://twitter.com/aashudubey_ad/status/1616536431010406400).
This fork adds some performance improvements to the animations to better showcase what Flutter can do.
The optimisations are:
- Using `AnimatedBuilder` instead of calling `setState` on each animation tick. This avoid unnecessary rebuilds and can allow for caching of child widgets
- Introduce some [RepaintBoundary's](https://www.youtube.com/watch?v=Nuni5VQXARo)

## 💪🏼 Getting Started
# Animated App with Rive and Flutter

This project is a starting point for this Flutter application.
An application with interactive UI and animations, with custom UI components like Bottom TabBar and SideBar, and using animated assets from [Rive](https://rive.app).

A few resources to get you started if this is your first Flutter project:
<p align="center">
<img alt="Flutter + Rive UI Preview" src="https://user-images.githubusercontent.com/46301285/212767021-ce434bc0-d6f8-41c1-a17a-360ea225009b.png" height="250px">
</p>

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
---

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
## 👀 This is how it looks

https://user-images.githubusercontent.com/46301285/213805689-d5c8eb3f-12d0-42ef-bdae-4bd857113579.mp4

## 📦 Packages used

1. [rive](https://pub.dev/packages/rive): To render and control the [Rive assets](../../assets/rive_app/rive).

## 🌻 Motivation

This app is a full Flutter replication of [this SwiftUI course](https://designcode.io/swiftui-rive-animated-app) by [@MengTo](https://twitter.com/MengTo).

## 🔗 Links

- [SwiftUI + Rive](https://designcode.io/swiftui-rive-animated-app): Original course in SwiftUI.
- [Ionic Rive](https://github.com/Aashu-Dubey/Ionic-UI-Templates/tree/main/ionic_ui_templates/src/app/templates/course-rive): Ionic + Angular version for the same.
- [Twitter Post](https://twitter.com/aashudubey_ad/status/1616536431010406400)
27 changes: 0 additions & 27 deletions lib/rive_app/README.md

This file was deleted.

5 changes: 4 additions & 1 deletion lib/rive_app/components/menu_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import 'package:flutter_samples/rive_app/assets.dart' as app_assets;

class MenuRow extends StatelessWidget {
const MenuRow(
{Key? key, required this.menu, this.selectedMenu = "Home", this.onMenuPress})
{Key? key,
required this.menu,
this.selectedMenu = "Home",
this.onMenuPress})
: super(key: key);

final MenuItemModel menu;
Expand Down
Loading

0 comments on commit 479eda7

Please sign in to comment.