flutter_audio_games library
This package provides useful widgets for rapid creation of audio games.
Getting Started
- Create audio menus with the AudioGameMenu class.
- Schedule a single task to happen on a regular basis with the
Ticking
widget. - Schedule random tasks with the
RandomTasks
widget. - Add music to any widget by wrapping it in a Music widget.
- Add a sound to play when a widget is focused by wrapping it in a PlaySoundSemantics widget.
- Add game shortcuts with the
GameShortcuts
widget. - Show splash screens and play cut scenes with the
TimedBuilders
widget.
Classes
- AmbiancesBuilder
- A widget which plays ambiances.
- AmbiancesBuilderState
- State for AmbiancesBuilder.
- AudioGameMenu
- A menu in an audio game.
- AudioGameMenuItem
- A menu item in an AudioGameMenu.
- AudioGameMenuItemListTile
- A ListTile for use in an AudioGameMenu widget.
- GameCredit
- A credit in a game.
- GameCredits
- A screen which shows game credits.
- InheritedMusic
- The inherited version of a Music.
- LoadSounds
- A widget which loads sounds before rendering child.
- MaybeMusic
- A widget that possibly plays music.
- MaybePlaySoundSemantics
-
A widget which uses PlaySoundSemantics to play sound if sound is not
null
. - Music
- A widget that plays music.
- MusicState
- State for Music.
- PlaySound
- A widget which plays a sound when built.
- PlaySoundSemantics
- A Semantics widget which plays a sound when focused.
- PlaySoundSemanticsState
- State for PlaySoundSemantics.
- PlaySoundsSemantics
- A widget which plays a random sound from sounds every interval when selected.
- PlaySoundsSemanticsState
- State for PlaySoundsSemantics.
- PlaySoundState
- State for PlaySound.
- ProtectSounds
- A widget which protects a list of sounds from being disposed for the duration of its life.
- ProtectSoundsState
- State for ProtectSounds.
- SelectPlaybackDevice
-
A screen for selecting a new
SoLoud
playback device. - SelectPlaybackDeviceState
- State for SelectPlaybackDevice.
- SideScroller
- A widget for showing a side scroller.
- SideScrollerState
- State for SideScroller.
- SideScrollerSurface
- A surface in a SideScroller level.
- SideScrollerSurfaceObject
- An object in a SideScrollerSurface.
- SoLoudScope
-
Manage the life cycle of
SoLoud
. - SoLoudScopeState
- State for SoLoudScope.
- Sound
- A single sound to play.
- SoundPosition
- The base class for sound positions.
- SoundPosition3d
- Position for a 3d sound.
- SoundPositionPanned
- Position for a panned sound.
- SourceLoader
-
A class for creating
AudioSource
s from Sounds. - StartWebAudio
- A widget which shows a button for starting web audio.
- StartWebAudioState
- State for StartWebAudio.
- VoiceGroup
- The voice group class.
- VolumeListTile
- A ListTile for editing volume.
Enums
- MovingDirection
- Possible movement directions.
- SideScrollerDirection
- The directions which can be moved in a SideScroller level.
- SoundType
- The type of a Sound.
- TurningDirection
- Possible turning directions.
Extensions
- AudioHandleX on SoundHandle
- Useful methods on sound handles.
- AudioSourceX on AudioSource
- Useful methods for sources.
- BuildContextX on BuildContext
- Useful extensions on build contexts.
- DirectoryX on Directory
- Useful extensions to turn Directory instances into Sounds.
- FileX on File
- Useful methods to turn Files into Sounds.
-
ListStringX
on List<
String> - Useful methods on string lists.
-
ListX
on List<
E> - Useful extensions for lists.
-
PointDoubleX
on Point<
double> - Useful methods for points.
-
PointIntX
on Point<
int> - Useful methods for points.
-
PointX
on Point<
T> - Useful methods on generic points.
- SoLoudX on SoLoud
- Useful methods.
- StringX on String
- Useful string methods.
Constants
- unpanned → const SoundPositionPanned
- The position for an unpanned sound.
Functions
-
angleToRad(
double angle) → double -
Convert an
angle
to radians. -
buildStartWebAudioButton(
BuildContext context, VoidCallback onDone) → Widget - Build a button for starting web audio.
-
defaultLoadCustomSound(
SourceLoader sourceLoader, Sound sound) → Future< AudioSource> - The default custom loader.
-
normaliseAngle(
double angle) → double - Return an angle between 0 and 359 degrees.
-
radsToDegrees(
double radians) → double -
Convert
radians
to degrees.
Typedefs
-
LoadSound
= Future<
AudioSource> Function(SourceLoader sourceLoader, Sound sound) - The type for functions which load sources from sounds.
-
SideScrollerSurfaceAction
= FutureOr<
void> Function(SideScrollerState state) - The type of side scroller move functions for players.
- WebAudioButtonBuilder = Widget Function(BuildContext context, VoidCallback onDone)
- The type of a function which builds a button for starting web audio.