stuff
This commit is contained in:
parent
9733984ae9
commit
237495def6
80
OldTypes.ts
Normal file
80
OldTypes.ts
Normal file
@ -0,0 +1,80 @@
|
||||
export interface Call {
|
||||
id: string;
|
||||
skyfeed?: string;
|
||||
title: string;
|
||||
text?: string;
|
||||
license?: string;
|
||||
beats?: number;
|
||||
dependencies?: Array<CallRef>;
|
||||
footwork?: CallRef;
|
||||
hold?: CallRef;
|
||||
isFootwork?: Boolean;
|
||||
isHold?: Boolean;
|
||||
modifiedAt?: Date;
|
||||
}
|
||||
|
||||
export interface CallRef {
|
||||
id: string;
|
||||
title: string;
|
||||
skyfeed?: string;
|
||||
beats?: number;
|
||||
delay?: number;
|
||||
}
|
||||
|
||||
export interface Dancer {
|
||||
gender: string;
|
||||
group: number;
|
||||
position: { x: number; y: number };
|
||||
}
|
||||
|
||||
export interface Formation {
|
||||
id: string;
|
||||
skyfeed?: string;
|
||||
title: string;
|
||||
text?: string;
|
||||
dancers?: Array<Dancer>;
|
||||
}
|
||||
|
||||
export interface FormationRef {
|
||||
id: string;
|
||||
title: string;
|
||||
skyfeed?: string;
|
||||
}
|
||||
|
||||
export interface Music {
|
||||
id: string;
|
||||
title?: string;
|
||||
skyfeed?: string;
|
||||
link?: string;
|
||||
skylink?: string;
|
||||
modifiedAt?: Date;
|
||||
}
|
||||
|
||||
export interface MusicRef {
|
||||
id: string;
|
||||
title?: string;
|
||||
skyfeed?: string;
|
||||
delay?: number;
|
||||
beatsPerDanceBeat?: number;
|
||||
}
|
||||
|
||||
export interface Dance {
|
||||
id: string;
|
||||
skyfeed?: string;
|
||||
title: string;
|
||||
text?: string;
|
||||
license?: string;
|
||||
formation?: FormationRef;
|
||||
instructions: Array<Array<CallRef>>;
|
||||
music?: Array<MusicRef>;
|
||||
variantOf?: DanceRef;
|
||||
footwork?: CallRef;
|
||||
hold?: CallRef;
|
||||
modifiedAt?: Date;
|
||||
}
|
||||
|
||||
export interface DanceRef {
|
||||
id: string;
|
||||
title: string;
|
||||
skyfeed?: string;
|
||||
}
|
@ -26,21 +26,54 @@ class MyApp extends StatelessWidget {
|
||||
}
|
||||
|
||||
class MyAppState extends ChangeNotifier {
|
||||
var current = WordPair.random();
|
||||
var rows = 3;
|
||||
var dance = {
|
||||
"instructions": [
|
||||
["call"],
|
||||
["call2"]
|
||||
]
|
||||
};
|
||||
void addCall(call) {
|
||||
dance["instructions"]?[0].add(call);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var appState = context.watch<MyAppState>();
|
||||
var rowElements = [];
|
||||
var instructions = appState.dance["instructions"];
|
||||
if (instructions != null) {
|
||||
for (var row in instructions) {
|
||||
rowElements.add(Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: row.map((e) => Text(e)).toList()));
|
||||
}
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
Text('A random idea:'),
|
||||
Text(appState.current.asLowerCase),
|
||||
],
|
||||
children: [...rowElements, AddCall(appState: appState)],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AddCall extends StatelessWidget {
|
||||
const AddCall({
|
||||
super.key,
|
||||
required this.appState,
|
||||
});
|
||||
|
||||
final MyAppState appState;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ElevatedButton(
|
||||
onPressed: () => appState.addCall("hello world"),
|
||||
child: Text("buttonText"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
25
pubspec.lock
25
pubspec.lock
@ -49,6 +49,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.5"
|
||||
english_words:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: english_words
|
||||
sha256: "6a7ef6473a97bd8571b6b641d006a6e58a7c67e65fb6f3d6d1151cb46b0e983c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -107,6 +115,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.1"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nested
|
||||
sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -115,6 +131,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.3"
|
||||
provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: provider
|
||||
sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.0.5"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@ -186,3 +210,4 @@ packages:
|
||||
version: "0.1.4-beta"
|
||||
sdks:
|
||||
dart: ">=3.1.0 <4.0.0"
|
||||
flutter: ">=1.16.0"
|
||||
|
@ -6,10 +6,6 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
|
||||
version: 0.0.1+1
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
environment:
|
||||
sdk: ">=3.1.0 <4.0.0"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user