mirror of
https://github.com/rive-app/rive-flutter
synced 2025-07-05 21:55:58 +00:00
feat: update build gradle to latest versions
Addresses: https://github.com/rive-app/rive-flutter/issues/398 I also created a fresh plugin using the latest Flutter and copied over the differences. How to use: In `android/local.properties` add: ``` rive.ndk.version=25.2.9519653 # set desired version ``` If not specified in a project, it will use the default. Rive-Android still uses the same ndk version. Should we update that as well? Diffs= 49bf612fd feat: update build gradle to latest versions (#7475) a134ab656 Layout joysticks runtime (#7923) 728ac6286 runtime: add tiling to n-slicing (#7934) e1b4a53ec Revive the WebGL backend (#7948) 813db58e7 Nnnn data binding editor native runtime (#7815) c71a37173 fix for syntax issue (#7910) e89437ef6 windows editor: fix format check and use raster ordering disabled (#7937) 7d00d35d3 Fix viewer tess builds (#7935) 455ebad60 Update rive cpp for submodules (#7932) 75e0f9aea runtime: support files with n-slicing defined (#7920) 85b28c39a Update readme of PLS (#7931) 21ecf2775 Fix actions yaml with rive-renderer (#7930) c33d5d81b Update rive renderer readme (#7929) b03895fcf Update pls README (#7927) 3316d15ca Refactor pls into runtime (#7914) b2d27b6bd mark dirty when constraint changes (#7909) 5c14a4a30 Fix Android goldens (#7902) 46a3045ae Improve Vulkan loading and organization (#7873) 160d9eefb Add webp decoder. (#7883) e992059d6 iOS images unpremult SIMD support (#7875) ad34dd4da add arithmetic operation and group converters (#7801) f99c93181 editor: setting up the update callbacks for n-slicing (#7869) 85343a4e1 Fix for bug in Runtime LayoutComponent proxy (#7867) Co-authored-by: Gordon <pggordonhayes@gmail.com>
This commit is contained in:
@ -1 +1 @@
|
||||
93cc33b45086e528b22d1245a8f7855bac299a21
|
||||
49bf612fd8e1e2ec4caecdc45ada328ea5cfbab2
|
||||
|
@ -40,7 +40,7 @@ android {
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.example.rive_example"
|
||||
minSdkVersion 16
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion 31
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1,82 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rive/rive.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
|
||||
/// An example demonstrating a simple state machine.
|
||||
///
|
||||
/// The "bumpy" state machine will be activated on tap of the vehicle.
|
||||
class EventSounds extends StatefulWidget {
|
||||
const EventSounds({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<EventSounds> createState() => _EventSoundsState();
|
||||
}
|
||||
|
||||
class _EventSoundsState extends State<EventSounds> {
|
||||
final _audioPlayer = AudioPlayer();
|
||||
late final StateMachineController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_audioPlayer.setAsset('assets/step.mp3');
|
||||
}
|
||||
|
||||
Future<void> _onRiveInit(Artboard artboard) async {
|
||||
_controller =
|
||||
StateMachineController.fromArtboard(artboard, 'skill-controller')!;
|
||||
artboard.addController(_controller);
|
||||
_controller.addEventListener(onRiveEvent);
|
||||
}
|
||||
|
||||
void onRiveEvent(RiveEvent event) {
|
||||
// Seconds since the event was triggered and it being reported.
|
||||
// This can be used to scrub the audio forward to the precise locaiton
|
||||
// if needed.
|
||||
// ignore: unused_local_variable
|
||||
var seconds = event.secondsDelay;
|
||||
|
||||
if (event.name == 'Step') {
|
||||
_audioPlayer.seek(Duration.zero);
|
||||
_audioPlayer.play();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.removeEventListener(onRiveEvent);
|
||||
_controller.dispose();
|
||||
_audioPlayer.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Event Sounds'),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: RiveAnimation.asset(
|
||||
'assets/event_sounds.riv',
|
||||
fit: BoxFit.cover,
|
||||
onInit: _onRiveInit,
|
||||
),
|
||||
),
|
||||
const Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Text(
|
||||
'Sound on!',
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -9,7 +9,6 @@ import 'package:rive_example/custom_cached_asset_loading.dart';
|
||||
import 'package:rive_example/carousel.dart';
|
||||
import 'package:rive_example/custom_controller.dart';
|
||||
import 'package:rive_example/event_open_url_button.dart';
|
||||
import 'package:rive_example/event_sounds.dart';
|
||||
import 'package:rive_example/event_star_rating.dart';
|
||||
import 'package:rive_example/example_state_machine.dart';
|
||||
import 'package:rive_example/liquid_download.dart';
|
||||
@ -77,7 +76,6 @@ class _RiveExampleAppState extends State<RiveExampleApp> {
|
||||
const _Page('Asset Loading', CustomAssetLoading()),
|
||||
const _Page('Cached Asset Loading', CustomCachedAssetLoading()),
|
||||
const _Page('Event Open URL Button', EventOpenUrlButton()),
|
||||
const _Page('Event Sounds', EventSounds()),
|
||||
const _Page('Event Star Rating', EventStarRating()),
|
||||
const _Page('Rive Audio', RiveAudioExample()),
|
||||
const _Page('Rive Audio [Out-of-Band]', RiveAudioOutOfBandExample()),
|
||||
|
@ -14,7 +14,6 @@ dependencies:
|
||||
rive:
|
||||
path: ../
|
||||
http:
|
||||
just_audio: ^0.9.34
|
||||
url_launcher: ^6.1.14
|
||||
|
||||
dev_dependencies:
|
||||
|
Reference in New Issue
Block a user