Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ambient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Furaev
Ambient
Commits
17b68264
Commit
17b68264
authored
2 years ago
by
Erik Hinkelmanns
Browse files
Options
Downloads
Patches
Plain Diff
- when there is no song in que the user will be redirected to the search page
parent
9bcf4b6b
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/homepage.dart
+6
-2
6 additions, 2 deletions
lib/homepage.dart
lib/main.dart
+6
-6
6 additions, 6 deletions
lib/main.dart
lib/widgets/musicPlayerState.dart
+0
-6
0 additions, 6 deletions
lib/widgets/musicPlayerState.dart
with
12 additions
and
14 deletions
lib/homepage.dart
+
6
−
2
View file @
17b68264
...
@@ -17,7 +17,8 @@ void printErr(String msg) {
...
@@ -17,7 +17,8 @@ void printErr(String msg) {
}
}
class
HomePage
extends
StatelessWidget
{
class
HomePage
extends
StatelessWidget
{
const
HomePage
({
super
.
key
});
final
pageController
;
const
HomePage
({
super
.
key
,
this
.
pageController
});
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
@@ -95,7 +96,10 @@ class HomePage extends StatelessWidget {
...
@@ -95,7 +96,10 @@ class HomePage extends StatelessWidget {
textColor:
Colors
.
white
,
textColor:
Colors
.
white
,
shape:
const
CircleBorder
(),
shape:
const
CircleBorder
(),
onPressed:
(){
onPressed:
(){
play
()
.
then
((
value
)
=
>
MusicPlayerState
.
of
(
context
)
.
rebuildPage
());
pageController
.
animateToPage
(
2
,
duration:
const
Duration
(
milliseconds:
500
),
curve:
Curves
.
ease
);
//_title = _titleList[2];
},
},
child:
const
Icon
(
child:
const
Icon
(
Icons
.
play_arrow_rounded
,
Icons
.
play_arrow_rounded
,
...
...
This diff is collapsed.
Click to expand it.
lib/main.dart
+
6
−
6
View file @
17b68264
...
@@ -50,7 +50,7 @@ class _HUDState extends State<HUD> {
...
@@ -50,7 +50,7 @@ class _HUDState extends State<HUD> {
int
_currentIndex
=
0
;
int
_currentIndex
=
0
;
final
List
<
String
>
_titleList
=
[
"Player"
,
"Mood"
,
"Search"
];
final
List
<
String
>
_titleList
=
[
"Player"
,
"Mood"
,
"Search"
];
String
_title
=
""
;
String
_title
=
""
;
PageController
_pageController
=
PageController
(
initialPage:
0
);
final
PageController
_pageController
=
PageController
(
initialPage:
0
);
@override
@override
void
initState
()
{
void
initState
()
{
...
@@ -71,10 +71,10 @@ class _HUDState extends State<HUD> {
...
@@ -71,10 +71,10 @@ class _HUDState extends State<HUD> {
_title
=
_titleList
[
newIndex
];
_title
=
_titleList
[
newIndex
];
});
});
},
},
children:
const
[
children:
[
HomePage
(),
HomePage
(
pageController:
_pageController
,
),
StateMoodPage
(),
const
StateMoodPage
(),
StateSearcgPage
(),
const
StateSearcgPage
(),
],
],
),
),
bottomNavigationBar:
Column
(
bottomNavigationBar:
Column
(
...
@@ -93,7 +93,7 @@ class _HUDState extends State<HUD> {
...
@@ -93,7 +93,7 @@ class _HUDState extends State<HUD> {
),
),
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
mood
),
label:
"Moods"
),
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
mood
),
label:
"Moods"
),
BottomNavigationBarItem
(
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
search
),
label:
"S
uchen
"
),
icon:
Icon
(
Icons
.
search
),
label:
"S
earch
"
),
],
],
onTap:
(
newIndex
)
{
onTap:
(
newIndex
)
{
_pageController
.
animateToPage
(
newIndex
,
_pageController
.
animateToPage
(
newIndex
,
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/musicPlayerState.dart
+
0
−
6
View file @
17b68264
...
@@ -34,12 +34,6 @@ class MusicPlayerState extends InheritedWidget {
...
@@ -34,12 +34,6 @@ class MusicPlayerState extends InheritedWidget {
rebuildStream
.
sink
.
add
(
null
);
rebuildStream
.
sink
.
add
(
null
);
}
}
void
rebuildPage
()
async
{
playerState
=
await
getPlayerState
();
currentTrackImageUri
=
playerState
?.
track
?.
imageUri
;
rebuildStream
.
sink
.
add
(
null
);
}
void
updatePlayerState
()
async
{
void
updatePlayerState
()
async
{
playerState
=
await
getPlayerState
();
playerState
=
await
getPlayerState
();
currentTrackImageUri
=
playerState
?.
track
?.
imageUri
;
currentTrackImageUri
=
playerState
?.
track
?.
imageUri
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment