Skip to content

Commit

Permalink
feat: Use secondary color for overscroll
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinkey04 committed Oct 12, 2021
1 parent a8db138 commit d7c15a3
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 86 deletions.
4 changes: 1 addition & 3 deletions lib/provider/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ hex(String hexColor) {
if (hexColor.length == 6) {
hexColor = "FF" + hexColor;
}
if (hexColor.length == 8) {
return Color(int.parse("0x$hexColor"));
}
return Color(int.parse("0x$hexColor"));
}

TextStyle durationTheme =
Expand Down
177 changes: 94 additions & 83 deletions lib/widgets/song_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,93 +45,104 @@ class SongWidget extends StatelessWidget {
return Column(
children: [
Flexible(
child: ListView.builder(
itemCount: songList?.length,
padding: EdgeInsets.only(bottom: screenHeight * 0.2),
itemBuilder: (context, songIndex) {
Song song = songList[songIndex];
if (!song.filePath.contains('WhatsApp/Media'))
return Column(
children: [
SizedBox(height: 10),
Container(
padding: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
color: Theme.of(context).dividerColor,
borderRadius:
BorderRadius.all(Radius.circular(24))),
child: InkWell(
onTap: () {
if (provider.audioManagerInstance.isPlaying)
provider.audioManagerInstance.toPause();
provider.playerState = PlayerState.playing;
provider.audioManagerInstance
.start("file://${song.filePath}", song.title,
desc: song.displayName,
auto: true,
cover: song.albumArtwork)
.then((err) {
print(err);
});
playFABController.forward();
},
child: Card(
elevation: 0,
color: Colors.transparent,
child: ListTile(
contentPadding: EdgeInsets.zero,
title: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(40),
child: Container(
color: Theme.of(context)
.colorScheme
.secondary,
width: 50,
height: 50,
child: getAlbumArt(song, context))),
SizedBox(
width: screenWidth * 0.03,
child: ScrollConfiguration(
behavior: ScrollBehavior(),
child: GlowingOverscrollIndicator(
color: Colors.black,
axisDirection: AxisDirection.down,
child: ListView.builder(
itemCount: songList?.length,
padding: EdgeInsets.only(bottom: screenHeight * 0.2),
itemBuilder: (context, songIndex) {
Song song = songList[songIndex];
if (!song.filePath.contains('WhatsApp/Media'))
return Column(
children: [
SizedBox(height: 10),
Container(
padding: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
color: Theme.of(context).dividerColor,
borderRadius:
BorderRadius.all(Radius.circular(24))),
child: InkWell(
onTap: () {
if (provider.audioManagerInstance.isPlaying)
provider.audioManagerInstance.toPause();
provider.playerState = PlayerState.playing;
provider.audioManagerInstance
.start(
"file://${song.filePath}", song.title,
desc: song.displayName,
auto: true,
cover: song.albumArtwork)
.then((err) {
print(err);
});
playFABController.forward();
},
child: Card(
elevation: 0,
color: Colors.transparent,
child: ListTile(
contentPadding: EdgeInsets.zero,
title: Row(
children: <Widget>[
ClipRRect(
borderRadius:
BorderRadius.circular(40),
child: Container(
color: Theme.of(context)
.colorScheme
.secondary,
width: 50,
height: 50,
child:
getAlbumArt(song, context))),
SizedBox(
width: screenWidth * 0.03,
),
Container(
width:
MediaQuery.of(context).size.width *
0.7,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(song.title,
overflow: TextOverflow.ellipsis,
style: Theme.of(context)
.textTheme
.headline3),
Text(song.artist,
overflow: TextOverflow.ellipsis,
style: Theme.of(context)
.textTheme
.subtitle2),
],
),
),
SizedBox(width: screenWidth * 0.01),
Text(
parseToMinutesSeconds(
int.parse(song.duration)),
style: durationTheme),
],
),
Container(
width:
MediaQuery.of(context).size.width * 0.7,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(song.title,
overflow: TextOverflow.ellipsis,
style: Theme.of(context)
.textTheme
.headline3),
Text(song.artist,
overflow: TextOverflow.ellipsis,
style: Theme.of(context)
.textTheme
.subtitle2),
],
),
),
SizedBox(width: screenWidth * 0.01),
Text(
parseToMinutesSeconds(
int.parse(song.duration)),
style: durationTheme),
],
),
),
),
),
),
),
],
);
return SizedBox(
height: 0,
);
}),
],
);
return SizedBox(
height: 0,
);
}),
),
),
),
],
);
Expand Down

0 comments on commit d7c15a3

Please sign in to comment.