Select Git revision
classification.dart
-
Madlen Ort authoredMadlen Ort authored
classification.dart 22.29 KiB
import 'package:ambient/firebase.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'CustomSearchDelegate.dart';
import '../homepage.dart';
import 'package:google_fonts/google_fonts.dart';
/*
Klasse & Screen zur Klassifizierung der Farben zu den Genres.
Es gibt eine graue Default Seite wenn keine Farbe ausgewählt ist.
Wenn eine Farbe ausgewählt wird, kann man das Genre dazu auswählen.
Die Klassifizierung wird dann in der Datenbank aktualisiert
*/
class ClassificationPage extends StatefulWidget {
const ClassificationPage({Key? key}) : super(key: key);
@override
State<StatefulWidget> createState() => _ClassificationPageState();
}
class _ClassificationPageState extends State<ClassificationPage> {
final String id = (FirebaseAuth.instance.currentUser?.uid.toString())!+'_genres';
Color _ambientBackgroundColor = Colors.grey.withOpacity(0.5);
String genreValue = '';
bool _redSelected = false;
bool _orangeSelected = false;
bool _yellowSelected = false;
bool _greenSelected = false;
bool _whiteSelected = false;
bool _blueSelected = false;
bool _pinkSelected = false;
bool _purpleSelected = false;
bool _brownSelected = false;
bool _blackSelected = false;
bool _errorText = false;
@override
Widget build(BuildContext context) {
Firebase.initializeApp();
print("User");
print(FirebaseAuth.instance.currentUser?.uid.toString());
return Scaffold(
resizeToAvoidBottomInset: false,
body: Container(
color: _ambientBackgroundColor,
child: Column(
children: [
const SizedBox(height: 40,),
SizedBox( height: 50, width: 300,
child: Text('Ambient!',
style:
GoogleFonts.cabin(
fontSize: 40.0, color: Colors.white.withOpacity(0.85)),),),
const SizedBox(height: 20,),
SizedBox(
height: 80,
width: 300,
child : Text('Select the genre that fits to the emotion of each color',
style:
GoogleFonts.cabin(
fontSize: 20.0, color: Colors.white.withOpacity(0.85),),),),
Expanded(