Skip to content
Snippets Groups Projects
Commit 7bfd7886 authored by Erik Hinkelmanns's avatar Erik Hinkelmanns
Browse files

- cleanup

parent bdeceaaa
No related branches found
No related tags found
No related merge requests found
......@@ -169,10 +169,10 @@ class HomePage extends StatelessWidget {
}
}
Future<void> queue() async {
Future<void> queue(String songId) async {
try {
await SpotifySdk.queue(
spotifyUri: 'spotify:track:0RT1qESYHlNcUJI0Yo5Hzl');
spotifyUri: 'spotify:track:$songId');
} on PlatformException catch (e) {
setStatus(e.code, message: e.message);
} on MissingPluginException {
......
import 'dart:typed_data';
import 'package:ambient/widgets/MusicPlayerState.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:ambient/emptyMoodpage.dart';
import 'package:ambient/searchpage.dart';
import 'package:ambient/widgets/navbars.dart';
import 'package:ambient/widgets/MusicPlayerState.dart';
import 'package:ambient/widgets/navbars.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:spotify_sdk/models/image_uri.dart';
import 'package:spotify_sdk/models/player_state.dart';
import 'package:spotify_sdk/spotify_sdk.dart';
import 'homepage.dart';
import 'moodpage.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
......@@ -30,7 +25,7 @@ class MyApp extends StatelessWidget {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MusicPlayerState(
child: HUD(),
child: const HUD(),
),
);
}
......@@ -42,7 +37,7 @@ const Color primaryContainer = Color(0xFFFFDFBD);
const Color onPrimaryContainer = Color(0xFF312B25);
class HUD extends StatefulWidget {
HUD({super.key});
const HUD({super.key});
@override
State<StatefulWidget> createState() => _HUDState();
......@@ -75,18 +70,22 @@ class _HUDState extends State<HUD> {
},
children: const [
HomePage(),
StateMoodPage(),
emptyMoodpage(),
StateSearcgPage(),
],
),
bottomNavigationBar: Column(
mainAxisSize: MainAxisSize.min,
children: [
_currentIndex != 0
? MusicBar()
: const Center(
child: Text('Moin'),
),
StreamBuilder<void>(
stream: MusicPlayerState.of(context).rebuildStream.stream,
builder: (context, _) {
if(_currentIndex != 0){
return MusicBar();
} else{
return const Center(child: Text('Moin'));
}
}),
BottomNavigationBar(
currentIndex: _currentIndex,
backgroundColor: ligten(primaryContainer),
......@@ -114,7 +113,7 @@ class _HUDState extends State<HUD> {
}
class MusicBar extends StatelessWidget {
const MusicBar({
MusicBar({
Key? key,
}) : super(key: key);
......
......@@ -2,9 +2,7 @@ import 'package:flutter/material.dart';
import 'dart:developer';
import 'package:ambient/homepage.dart';
import 'package:ambient/services/spotify.dart';
import 'package:flutter/material.dart';
class StateSearcgPage extends StatefulWidget {
const StateSearcgPage({super.key});
......
......@@ -14,11 +14,6 @@ BuildContext context, bool isLogin, Function onTap) {
onPressed: (){
onTap();
},
child: Text(
isLogin? 'Login' : 'Registrate',
style: const TextStyle(
color: Colors.black),
),
style: ButtonStyle(
backgroundColor: MaterialStateColor.resolveWith((states){
if(states.contains(MaterialState.pressed)){
......@@ -28,6 +23,11 @@ BuildContext context, bool isLogin, Function onTap) {
}),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)))),
child: Text(
isLogin? 'Login' : 'Registrate',
style: const TextStyle(
color: Colors.black),
),
)
);
}
......@@ -48,11 +48,6 @@ Container signOutButton(
(context) => LoginPage()));
});
},
child: Text(
"Sign Out",
style: const TextStyle(
color: Colors.black),
),
style: ButtonStyle(
backgroundColor: MaterialStateColor.resolveWith((states) {
if (states.contains(MaterialState.pressed)) {
......@@ -63,6 +58,11 @@ Container signOutButton(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)))),
child: const Text(
"Sign Out",
style: TextStyle(
color: Colors.black),
),
)
);
}
......
......@@ -8,7 +8,7 @@ import 'package:spotify_sdk/spotify_sdk.dart';
class MusicPlayerState extends InheritedWidget {
MusicPlayerState({required super.child});
MusicPlayerState({super.key, required super.child});
bool loading = false;
bool connected = false;
......
......@@ -9,15 +9,13 @@ class SettingsDrawer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Drawer(
return const Drawer(
backgroundColor: onPrimary,
width: 200,
child: Center(
child: Container(
child: const Text("Moin",
child: Text("Moin",
style: TextStyle(fontSize: 30, color: onPrimaryContainer)),
),
),
);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment