game_utils library

Various game-related functions I've been using in other projects.

Thought I'd bundle them together so I can use them elsewhere..

Classes

Book
A book, which acts like a menu. [...]
BookOptions
The options for a Book instance. [...]
FormBuilder
A class for building html forms.
FormBuilderElement
An element within a FormBuilder instance. [...]
Hotkey
A hotkey. [...]
Keyboard
A class for storing and triggering Hotkey instances.
KeyState
A key with modifiers.
Line
A menu item. [...]
Music
Plays music on a loop.
Page
A page of Line instances.
Sound
A sound object. [...]
SoundPool

Properties

random Random
Random number generator.
final

Functions

englishList(List<String> items, {String andString = ', and ', String sepString = ', ', String emptyString = 'nothing'}) String
Convert a list of items to a properly formatted english list.
notEmptyValidator(String name, Map<String, String> values, String value) String
A validator which will complain if value is empty.
notSameAsValidator(String getValue(), {String message = 'Values must not match.', ValidatorType onSuccess}) ValidatorType
A validator which will return message if value is the same as the result of calling getValue.
randInt(int end, {int start = 0}) int
Generate a random number between start and end inclusive.
randomElement<T>(List<T> items) → T
Return a random element from a list. [...]
timestamp() int
A shortcut for getting a milliseconds timestamp.

Enums

OutputTypes
The output types, for use with SoundPool.setVolume.

Typedefs

BookFunctionType = void Function()
The type for all Line functions.
OnEndedType = void Function(Event)
TitleFunctionType = String Function()
The type for all titleFunc arguments.
ValidatorType = String Function(String name, Map<String, String>, String)
The type of all validators.