Skip to content
Snippets Groups Projects
Commit b878a1e5 authored by Madlen Ort's avatar Madlen Ort
Browse files

kleine Änderungen

parent cb792ed7
No related branches found
No related tags found
No related merge requests found
......@@ -3,10 +3,132 @@ import 'package:flutter/material.dart';
class CustomSearchDelegate extends SearchDelegate {
// Demo list to show querying
static List<String> searchTerms = [
"Genre1",
"Genre1",
"Genre1",
"Genre1",
"acoustic",
"afrobeat",
"alt-rock",
"alternative",
"ambient",
"anime",
"black-metal",
"bluegrass",
"blues",
"bossanova",
"brazil",
"breakbeat",
"british",
"cantopop",
"chicago-house",
"children",
"chill",
"classical",
"club",
"comedy",
"country",
"dance",
"dancehall",
"death-metal",
"deep-house",
"detroit-techno",
"disco",
"disney",
"drum-and-bass",
"dub",
"dubstep",
"edm",
"electro",
"electronic",
"emo",
"folk",
"forro",
"french",
"funk",
"garage",
"german",
"gospel",
"goth",
"grindcore",
"groove",
"grunge",
"guitar",
"happy",
"hard-rock",
"hardcore",
"hardstyle",
"heavy-metal",
"hip-hop",
"holidays",
"honky-tonk",
"house",
"idm",
"indian",
"indie",
"indie-pop",
"industrial",
"iranian",
"j-dance",
"j-idol",
"j-pop",
"j-rock",
"jazz",
"k-pop",
"kids",
"latin",
"latino",
"malay",
"mandopop",
"metal",
"metal-misc",
"metalcore",
"minimal-techno",
"movies",
"mpb",
"new-age",
"new-release",
"opera",
"pagode",
"party",
"philippines-opm",
"piano",
"pop",
"pop-film",
"post-dubstep",
"power-pop",
"progressive-house",
"psych-rock",
"punk",
"punk-rock",
"r-n-b",
"rainy-day",
"reggae",
"reggaeton",
"road-trip",
"rock",
"rock-n-roll",
"rockabilly",
"romance",
"sad",
"salsa",
"samba",
"sertanejo",
"show-tunes",
"singer-songwriter",
"ska",
"sleep",
"songwriter",
"soul",
"soundtracks",
"spanish",
"study",
"summer",
"swedish",
"synth-pop",
"tango",
"techno",
"trance",
"trip-hop",
"turkish",
"work-out",
"world-music"
];
// first overwrite to
......
......@@ -22,6 +22,9 @@ class _ClassificationPageState extends State<ClassificationPage> {
String genreValue = '';
bool _redSelected = false;
bool _orangeSelected = false;
bool _yellowSelected = false;
bool _greenSelected = false;
void _redContainerWasTapped() {
setState(() => _redSelected = !_redSelected);
......@@ -29,13 +32,22 @@ class _ClassificationPageState extends State<ClassificationPage> {
_ambientBackgroundColor = Colors.red;
if (!_redSelected){_ambientBackgroundColor = Colors.grey.withOpacity(0.5);}
}
bool _orangeSelected = false;
void _orangeContainerWasTapped() {
setState(() => _orangeSelected = !_orangeSelected);
_ambientBackgroundColor = Colors.orange;
if (!_orangeSelected){_ambientBackgroundColor = Colors.grey.withOpacity(0.5);}
}
void _yellowContainerWasTapped() {
setState(() => _yellowSelected = !_yellowSelected);
_ambientBackgroundColor = Colors.yellow;
if (!_yellowSelected){_ambientBackgroundColor = Colors.grey.withOpacity(0.5);}
}
void _greenContainerWasTapped() {
setState(() => _greenSelected = !_greenSelected);
_ambientBackgroundColor = Colors.green;
if (!_greenSelected){_ambientBackgroundColor = Colors.grey.withOpacity(0.5);}
}
@override
Widget build(BuildContext context) {
......@@ -85,6 +97,28 @@ class _ClassificationPageState extends State<ClassificationPage> {
)
,),
SizedBox(height: 20,),
GestureDetector(
onTap: _yellowContainerWasTapped,
child: Container(
child: _yellowSelected ?
selectedColor(
"Yellow", Colors.yellow, "Yellow1",
"Yellow1", "Yellow1") : noSelection(
"Yellow")
)
,),
SizedBox(height: 20,),
GestureDetector(
onTap: _greenContainerWasTapped,
child: Container(
child: _greenSelected ?
selectedColor(
"Green", Colors.green, "Green1",
"Green2", "Green3") : noSelection(
"Green")
)
,),
SizedBox(height: 20,),
ElevatedButton(
style:ButtonStyle(backgroundColor: MaterialStatePropertyAll<Color>(Colors.white.withOpacity(0.9))),
child: const Text(
......@@ -287,8 +321,10 @@ class _ClassificationPageState extends State<ClassificationPage> {
String id = '${FirebaseAuth.instance.currentUser?.uid.toString()}_genres';
var document = FirebaseFirestore.instance.collection('classification').doc(id);
var snapshot = await document.get();
//snapshot.sata()
return snapshot.get(colorText);
//snapshot.data();
//if(snapshot.data()?.containsKey(colorText)){
return await snapshot.get(colorText);
}
closeAll(){
......
......@@ -142,6 +142,7 @@ class _RegistrationPage extends State<RegistrationPage> {
'user' : _usernameTextController.text,
'Red' : 'Not Selected',
'Orange' : 'Not Selected',
'Yellow' : 'Not Selected',
};
await user.set(json);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment