Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #41

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Dev #41

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"audioplayers","path":"C:\\\\Users\\\\grjur\\\\Documents\\\\development\\\\sdks\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\audioplayers-0.10.1\\\\","dependencies":["path_provider"]},{"name":"path_provider","path":"C:\\\\Users\\\\grjur\\\\Documents\\\\development\\\\sdks\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-0.5.0+1\\\\","dependencies":[]}],"android":[{"name":"audioplayers","path":"C:\\\\Users\\\\grjur\\\\Documents\\\\development\\\\sdks\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\audioplayers-0.10.1\\\\","dependencies":["path_provider"]},{"name":"path_provider","path":"C:\\\\Users\\\\grjur\\\\Documents\\\\development\\\\sdks\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-0.5.0+1\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"audioplayers","dependencies":["path_provider"]},{"name":"path_provider","dependencies":[]}],"date_created":"2021-09-22 19:28:05.321601","version":"2.2.3"}
14 changes: 14 additions & 0 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\Users\grjur\Documents\development\sdks\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\grjur\Documents\development\projects\xylophone-flutter"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
45 changes: 44 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,57 @@
import 'package:flutter/material.dart';
import 'package:audioplayers/audio_cache.dart';

void main() => runApp(XylophoneApp());

class XylophoneApp extends StatelessWidget {

void playSound(int noteCode) {

final player = AudioCache();
player.play('note$noteCode.wav');

}

Expanded produceKeyNote(Color noteColor, String letter, int noteNo) {
return Expanded(
child: Container(
width: double.infinity,
child: FlatButton(
color: noteColor,
onPressed: () {
playSound(noteNo);
},
child: Text(letter,
style: TextStyle(
color: Colors.black,
fontSize: 30
),
),
),
),
);
}


@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: SafeArea(
child: Container(),
child: Center(
child: Column(
children: [
produceKeyNote(Colors.red,'C', 1),
produceKeyNote(Colors.orange,'D', 2),
produceKeyNote(Colors.yellow,'E', 3),
produceKeyNote(Colors.green,'F', 4),
produceKeyNote(Colors.teal,'G', 5),
produceKeyNote(Colors.blue,'A', 6),
produceKeyNote(Colors.purple,'B', 7),
],
),
),
),
),
);
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
sdk: flutter

cupertino_icons: ^0.1.2
audioplayers: ^0.10.0

dev_dependencies:
flutter_test:
Expand Down