Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 333249f
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Thu Dec 5 17:36:58 2019 -0500

    Preparing for publish.

commit 0aa32c5
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Dec 4 15:19:37 2019 -0800

    Adding Guss.

commit 6ba1f70
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Dec 4 09:12:26 2019 -0800

    Fixing type error in jelly component.

commit a522dff
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Sun Dec 1 17:31:28 2019 -0800

    Fixing effect on self.

commit 2375f0c
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Nov 27 18:03:08 2019 -0800

    Adding animation for effects.

commit dee0d83
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Tue Nov 26 16:40:01 2019 -0800

    Getting drop shadow, blur, and inner shadows working.

commit 31aa641
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Mon Nov 25 19:57:39 2019 -0800

    Major groundwork for effects & masking.

commit 9ff2b94
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Nov 20 16:38:28 2019 -0800

    Fixing gradient transformations for shapes with transformAffectsStroke set to true.

commit 1e88ddf
Merge: c7758eb 17f73ec
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Mon Nov 18 16:32:28 2019 -0800

    Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter

commit c7758eb
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Mon Nov 18 16:32:23 2019 -0800

    Fixing FlareControls.

commit 17f73ec
Author: Umberto Sonnino <rimher@gmail.com>
Date:   Fri Nov 15 11:09:51 2019 +0000

    Update README with latest version

commit c9f4341
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Thu Nov 7 15:05:04 2019 -0800

    Backing out changeImageFromNetwork. Issue #183

commit e9712a4
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Thu Nov 7 12:32:17 2019 -0800

    Bumping versions.

commit 366cdc0
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Thu Nov 7 12:27:53 2019 -0800

    Adding support for runtime image swapping, requires marking image nodes as isDynamic in Flare. Issue #183.

commit 53a7c65
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Nov 6 17:30:42 2019 -0800

    Updating flare_flutter version.

commit b391dd4
Merge: 1e9b22e 9ec074b
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Nov 6 17:28:34 2019 -0800

    Merge branch 'warmth_fix'

commit 9ec074b
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Nov 6 15:43:31 2019 -0800

    Call setState if mounted.

commit c66ac64
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Nov 6 15:38:06 2019 -0800

    Addressing an issue found in #177 with FlareCacheBuilder setting state when widget is no longer mounted.

commit 1e9b22e
Author: Umberto Sonnino <rimher@gmail.com>
Date:   Wed Nov 6 19:02:25 2019 +0100

    Init mat before inverting

commit bc07b87
Author: Umberto Sonnino <rimher@gmail.com>
Date:   Wed Nov 6 19:00:13 2019 +0100

    Remove local flare_dart from examples pubspec #184

commit e1cca7c
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Tue Oct 29 12:50:30 2019 -0700

    Bumping versions, merging optimal_load branch, and persisting settings in checkbox example.

commit 55cae39
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Tue Oct 29 12:41:43 2019 -0700

    Copy transform affects stroke properly when instancing shapes.

commit 43716dd
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Mon Oct 28 12:52:09 2019 -0700

    Prevent coldLoad (async) from happening when widget isn’t ready to load.

commit 506837e
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Fri Oct 25 13:00:56 2019 -0700

    Improving loading.

commit 9ee95b9
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Fri Oct 25 10:42:42 2019 -0700

    Make sure overrideColor is set even when drawableNodes is null.

commit 7d59de1
Author: Umberto Sonnino <rimher@gmail.com>
Date:   Fri Oct 25 13:15:34 2019 +0100

    Move null check

commit 528af53
Author: Umberto Sonnino <rimher@gmail.com>
Date:   Fri Oct 25 13:10:17 2019 +0100

    Insert null checks for artboards with no drawables #178

commit 33f23a7
Author: Umberto Sonnino <rimher@gmail.com>
Date:   Fri Oct 25 12:16:16 2019 +0100

    Remove GradientColor override of ActorPaint opacity getter #179

commit 59ba2f0
Author: Umberto Sonnino <rimher@gmail.com>
Date:   Thu Oct 24 09:31:41 2019 +0100

    Document the `actor_animatino.apply()` function

commit d77438f
Author: Umberto Sonnino <rimher@gmail.com>
Date:   Thu Oct 24 09:31:10 2019 +0100

    Fix division by 0 on transform constraint

commit f0cf988
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Fri Oct 11 12:59:13 2019 -0700

    Fix reading of JSON clip values. Issue #172

commit a7796e0
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Fri Oct 11 12:39:48 2019 -0700

    Mitigating issue #172.

commit 373c14a
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Oct 9 14:21:47 2019 -0700

    Fixing issue with image clipping.

commit ae1c901
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Oct 9 11:19:16 2019 -0700

    Fix merge bugs.

commit d8cb780
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Wed Oct 9 11:09:42 2019 -0700

    Adding support for difference clipping.

commit bf99a76
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Tue Oct 8 19:07:26 2019 -0700

    Matching stable version

commit 9becc74
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Tue Oct 8 13:58:11 2019 -0700

    Bumping flare_dart to 2.0 due to breaking changes.

commit 0a292cc
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Tue Oct 8 13:39:57 2019 -0700

    Bumping versions and changelogs.

commit 431a98e
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Tue Oct 8 13:35:26 2019 -0700

    Fixing up analysis issues for #169

commit 72fb6fc
Merge: 4d00202 dc68dea
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Tue Oct 8 13:02:17 2019 -0700

    Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter

commit 4d00202
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Tue Oct 8 13:02:11 2019 -0700

    Cleaning up analysis issues.

commit dc68dea
Merge: 5ca8d49 f1d9749
Author: Luigi Rosso <luigi-rosso@users.noreply.github.com>
Date:   Tue Oct 8 11:06:53 2019 -0700

    Merge pull request #168 from mehmetf/master

    Escalate the severity of unused imports in analyzer

commit f1d9749
Author: Mehmet Fidanboylu <mehmetf@google.com>
Date:   Tue Oct 8 10:20:58 2019 -0700

    Do the same changes to flare_dart

commit 64f395e
Author: Mehmet Fidanboylu <mehmetf@google.com>
Date:   Tue Oct 8 10:17:51 2019 -0700

    Escalate the severity of unused imports in analyzer

commit 5ca8d49
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Mon Oct 7 11:22:38 2019 -0700

    Bumping versions and changelog.

commit 874ce8e
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Mon Oct 7 11:20:28 2019 -0700

    Adding support for nodes inside of shapes.

commit 4d06431
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Fri Oct 4 18:06:09 2019 -0700

    Introducing FlareTesting.setup();

commit 2c5f420
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Fri Oct 4 13:44:25 2019 -0700

    Clamping trim start/end.

commit daba34d
Author: Luigi Rosso <luigi.rosso@gmail.com>
Date:   Mon Sep 30 21:21:55 2019 +0200

    Cherry picking critical lints from #1 63 and updating for pub.
  • Loading branch information
luigi-rosso committed Dec 5, 2019
1 parent c911f41 commit 393c224
Show file tree
Hide file tree
Showing 123 changed files with 4,994 additions and 865 deletions.
71 changes: 71 additions & 0 deletions example/guss/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Miscellaneous
*.class
*.lock
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# Visual Studio Code related
.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
build/

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
10 changes: 10 additions & 0 deletions example/guss/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: faae8bde78ac273ae380cd8a6d18b093534ec58c
channel: master

project_type: app
41 changes: 41 additions & 0 deletions example/guss/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Teddy

<img align="right" src="https://i.imgur.com/hJU9Obt.gif" height="250">

An example built using [JCToon's](https://www.2dimensions.com/a/JuanCarlos/files/flare/teddy/preview) Flare File as a custom UI component. <br/>
Teddy will follow the cursor as you type or move it around.

## Overview

The basic idea is to use the `ctrl_face` node in JCToon's file to change the direction of Teddy's gaze, as it's shown here in the gif to the right.

This is done by using [custom `FlareControls`](lib/teddy_controller.dart), available in `/lib/teddy_controller.dart`.

`FlareControls` is a custom implementation of the `FlareController` interface. <br/>The interface and can be found in [flare_actor.dart](../../lib/flare_actor.dart#L13-L17) and it has three methods:

```
abstract class FlareController {
void initialize(FlutterActorArtboard artboard);
void setViewTransform(Mat2D viewTransform);
bool advance(FlutterActorArtboard artboard, double elapsed);
}
```

<img align="right" src="https://i.imgur.com/WdjurVo.gif" width="300" />

An instance of `TeddyController` is passed to the `FlareActor` in [`/lib/main.dart`](lib/main.dart#L77). This ties the controller to this widget, and allows it to use the three overrides to perform custom actions:

```
FlareActor(
"assets/Teddy.flr",
controller: _teddyController,
[...]
)
```

In this example, `initialize()` will grab the reference to the `ctrl_face` node through the library call `artboard.getNode("ctrl_face")`.

Moreover, by [extending `FlareControls`](../../lib/flare_actor.dart#L462), `TeddyController` can take advantage of a concrete implementation of this interface:
- `play(String animationName)`
- `advance(double elapsed)` - a base implementation which advances and mixes multiple animations

122 changes: 122 additions & 0 deletions example/guss/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors:
unused_import: error

linter:
rules:
- always_put_required_named_parameters_first
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_annotating_with_dynamic
- avoid_bool_literals_in_conditional_expressions
- avoid_catches_without_on_clauses
- avoid_catching_errors
- avoid_classes_with_only_static_members
- avoid_double_and_int_checks
- avoid_empty_else
- avoid_field_initializers_in_const_classes
- avoid_implementing_value_types
- avoid_init_to_null
- avoid_js_rounded_ints
- avoid_null_checks_in_equality_operators
- avoid_relative_lib_imports
- avoid_return_types_on_setters
- avoid_returning_null
- avoid_returning_null_for_future
- avoid_returning_null_for_void
- avoid_returning_this
- avoid_setters_without_getters
- avoid_shadowing_type_parameters
- avoid_single_cascade_in_expression_statements
- avoid_slow_async_io
- avoid_types_as_parameter_names
- avoid_unused_constructor_parameters
- avoid_void_async
- await_only_futures
- camel_case_types
- cancel_subscriptions
- close_sinks
- constant_identifier_names
- control_flow_in_finally
- curly_braces_in_flow_control_structures
- directives_ordering
- empty_catches
- empty_constructor_bodies
- empty_statements
- file_names
- hash_and_equals
- implementation_imports
- invariant_booleans
- iterable_contains_unrelated_type
- join_return_with_assignment
- library_names
- library_prefixes
- lines_longer_than_80_chars
- list_remove_unrelated_type
- literal_only_boolean_expressions
- no_adjacent_strings_in_list
- no_duplicate_case_values
- non_constant_identifier_names
- null_closures
- one_member_abstracts
- only_throw_errors
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
- parameter_assignments
- prefer_adjacent_string_concatenation
- prefer_asserts_in_initializer_lists
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- prefer_constructors_over_static_methods
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_final_in_for_each
- prefer_foreach
- prefer_function_declarations_over_variables
- prefer_initializing_formals
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
# - prefer_mixin
- prefer_null_aware_operators
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- recursive_getters
- slash_for_doc_comments
- sort_pub_dependencies
- sort_unnamed_constructors_first
- test_types_in_equals
- throw_in_finally
- type_annotate_public_apis
- type_init_formals
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_lambdas
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_statements
- unnecessary_this
- unrelated_type_equality_checks
- use_full_hex_values_for_flutter_colors
- use_rethrow_when_possible
- use_setters_to_change_properties
- use_string_buffers
- use_to_and_as_if_applicable
- valid_regexps
- void_checks
61 changes: 61 additions & 0 deletions example/guss/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.teddy"
minSdkVersion 16
targetSdkVersion 27
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
39 changes: 39 additions & 0 deletions example/guss/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.teddy">

<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="teddy"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.teddy;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions example/guss/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
</resources>

0 comments on commit 393c224

Please sign in to comment.