mirror of
https://github.com/flutter/samples.git
synced 2026-05-14 10:58:29 +00:00
Add game_template (#1180)
Adds a template / sample for games built in Flutter, with all the bells and whistles, like ads, in-app purchases, audio, main menu, settings, and so on. Co-authored-by: Parker Lougheed Co-authored-by: Shams Zakhour
This commit is contained in:
24
game_template/lib/src/audio/songs.dart
Normal file
24
game_template/lib/src/audio/songs.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2022, the Flutter project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
const Set<Song> songs = {
|
||||
// Filenames with whitespace break package:audioplayers on iOS
|
||||
// (as of February 2022), so we use no whitespace.
|
||||
Song('Mr_Smith-Azul.mp3', 'Azul', artist: 'Mr Smith'),
|
||||
Song('Mr_Smith-Sonorus.mp3', 'Sonorus', artist: 'Mr Smith'),
|
||||
Song('Mr_Smith-Sunday_Solitude.mp3', 'SundaySolitude', artist: 'Mr Smith'),
|
||||
};
|
||||
|
||||
class Song {
|
||||
final String filename;
|
||||
|
||||
final String name;
|
||||
|
||||
final String? artist;
|
||||
|
||||
const Song(this.filename, this.name, {this.artist});
|
||||
|
||||
@override
|
||||
String toString() => 'Song<$filename>';
|
||||
}
|
||||
Reference in New Issue
Block a user