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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Furaev
Ambient
Commits
0b1a79c4
Commit
0b1a79c4
authored
2 years ago
by
Erik Hinkelmanns
Browse files
Options
Downloads
Patches
Plain Diff
- update/fixed page routing
- fixed title render bug when skipping a song - fixed albumImage loading
parent
f89d22ab
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
+1
-1
1 addition, 1 deletion
lib/homepage.dart
lib/main.dart
+2
-2
2 additions, 2 deletions
lib/main.dart
lib/widgets/musicPlayerState.dart
+9
-5
9 additions, 5 deletions
lib/widgets/musicPlayerState.dart
with
12 additions
and
8 deletions
lib/homepage.dart
+
1
−
1
View file @
0b1a79c4
...
...
@@ -272,7 +272,7 @@ class SongInfo extends StatelessWidget{
width:
300
,
height:
300
,
),
offset:
Offset
(
10
,
10
),
offset:
const
Offset
(
10
,
10
),
scale:
1
,
blurRadius:
10
,
borderRadius:
20
,
...
...
This diff is collapsed.
Click to expand it.
lib/main.dart
+
2
−
2
View file @
0b1a79c4
...
...
@@ -132,7 +132,7 @@ class MusicBar extends StatelessWidget {
}
return
Container
(
height:
80
,
color:
Colors
.
grey
,
color:
primaryContainer
,
child:
Row
(
children:
[
MusicPlayerState
.
of
(
context
)
.
albumImage
!
,
...
...
@@ -146,7 +146,7 @@ class MusicBar extends StatelessWidget {
child:
Column
(
children:
[
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5
,
top:
5
),
child:
Text
(
track
!
.
name
,
child:
Text
(
track
.
name
,
style:
const
TextStyle
(
fontSize:
16.0
,
fontWeight:
FontWeight
.
bold
,
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/musicPlayerState.dart
+
9
−
5
View file @
0b1a79c4
...
...
@@ -34,9 +34,9 @@ class MusicPlayerState extends InheritedWidget {
void
updatePlayerState
()
async
{
playerState
=
await
getPlayerState
();
//
loadAlbumImage().then((value) => playStatedStream.sink.add(null));
currentTrackImageUri
=
playerState
?.
track
?.
imageUri
;
spotifyImageWidget
(
currentTrackImageUri
!
);
loadAlbumImage
()
.
then
((
value
)
=
>
playStatedStream
.
sink
.
add
(
null
));
//
currentTrackImageUri = playerState?.track?.imageUri;
//
spotifyImageWidget(currentTrackImageUri!);
playStatedStream
.
sink
.
add
(
null
);
}
...
...
@@ -81,7 +81,6 @@ class MusicPlayerState extends InheritedWidget {
//Todo how does the FutureBuilder works
Widget
spotifyImageWidget
(
ImageUri
imageUri
)
{
print
(
"-------------------------------------------------moin
${albumImage?.hashCode}
--------------------------------"
);
return
FutureBuilder
(
future:
SpotifySdk
.
getImage
(
imageUri:
imageUri
,
...
...
@@ -95,6 +94,7 @@ class MusicPlayerState extends InheritedWidget {
rebuildStream
.
sink
.
add
(
null
);
return
const
Center
(
child:
Text
(
'Getting image...'
));
}
else
if
(
snapshot
.
hasError
)
{
print
(
"-------------------------------------------------bevor
${albumImage?.hashCode}
--------------------------------"
);
setStatus
(
snapshot
.
error
.
toString
());
return
SizedBox
(
width:
ImageDimension
.
small
.
value
.
toDouble
(),
...
...
@@ -102,6 +102,7 @@ class MusicPlayerState extends InheritedWidget {
child:
const
Center
(
child:
Text
(
'Error getting image'
)),
);
}
else
{
print
(
"-------------------------------------------------bevor
${albumImage?.hashCode}
--------------------------------"
);
return
SizedBox
(
width:
ImageDimension
.
small
.
value
.
toDouble
(),
height:
ImageDimension
.
small
.
value
.
toDouble
(),
...
...
@@ -113,7 +114,10 @@ class MusicPlayerState extends InheritedWidget {
Future
<
void
>
loadAlbumImage
()
async
{
currentTrackImageUri
=
playerState
?.
track
?.
imageUri
;
spotifyImageWidget
(
currentTrackImageUri
!
);
albumImage
=
Image
.
memory
((
await
SpotifySdk
.
getImage
(
imageUri:
currentTrackImageUri
!
,
dimension:
ImageDimension
.
large
,
))
!
);
}
void
setStatus
(
String
code
,
{
String
?
message
})
{
...
...
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