Skip to content

Commit

Permalink
✨ Added lyrics support
Browse files Browse the repository at this point in the history
ℹ️ Implemented functionality to fetch and display song lyrics within the application. This feature includes:
- Integration with a lyrics API to retrieve lyrics for a given song.
- UI updates to dynamically display lyrics alongside the song playback.
  • Loading branch information
sheikhhaziq committed Jul 5, 2024
1 parent 0acc5c5 commit d93325a
Show file tree
Hide file tree
Showing 23 changed files with 1,032 additions and 554 deletions.
28 changes: 14 additions & 14 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = "1.0"
}
// def keystoreProperties = new Properties()
// def keystorePropertiesFile = rootProject.file('key.properties')
// if (keystorePropertiesFile.exists()) {
// keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
// }
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
namespace = "com.jhelum.gyawun.beta"
Expand All @@ -47,20 +47,20 @@ android {
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}
// signingConfigs {
// release {
// keyAlias keystoreProperties['keyAlias']
// keyPassword keystoreProperties['keyPassword']
// storeFile file('../../../../keystore.jks')
// storePassword keystoreProperties['storePassword']
// }
// }
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
signingConfig = signingConfigs.release
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/app_config.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AppConfig appConfig = AppConfig(version: 21, codeName: '2.0.0-beta-2');
AppConfig appConfig = AppConfig(version: 22, codeName: '2.0.0-beta-2');

class AppConfig {
int version;
Expand Down
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get_it/get_it.dart';
import 'package:gyawun_beta/services/lyrics.dart';
import 'package:gyawun_beta/services/yt_account.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:just_audio_background/just_audio_background.dart';
Expand Down Expand Up @@ -69,6 +70,7 @@ void main() async {

GetIt.I.registerSingleton<LibraryService>(libraryService);
GetIt.I.registerSingleton<YTAccount>(YTAccount());
GetIt.I.registerSingleton<Lyrics>(Lyrics());

runApp(
MultiProvider(
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/home_screen/section_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class _ItemListState extends State<ItemList> {
backgroundImage: CachedNetworkImageProvider(
getEnhancedImage(
items[index]['thumbnails'].first['url'],
width: width),
width: width.toInt()),
),
radius: height / 2,
)
Expand All @@ -345,7 +345,7 @@ class _ItemListState extends State<ItemList> {
child: CachedNetworkImage(
imageUrl: getEnhancedImage(
items[index]['thumbnails'].first['url'],
width: width,
width: width.toInt(),
),
height: height,
width: width,
Expand Down
8 changes: 0 additions & 8 deletions lib/screens/library_screen/library_screen/library_screen.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';

import '../../../generated/l10n.dart';
import '../../../services/yt_account.dart';
import '../../../utils/bottom_modals.dart';
import 'local_library.dart';
import 'ytm_library.dart';

Expand Down Expand Up @@ -61,12 +59,6 @@ class _LibraryScreenState extends State<LibraryScreen>
],
)
: const LocalLibrary(),
floatingActionButton: FloatingActionButton(
onPressed: () {
Modals.showCreateplaylistModal(context);
},
child: const Icon(CupertinoIcons.add),
),
);
});
}
Expand Down
41 changes: 35 additions & 6 deletions lib/screens/library_screen/library_screen/local_library.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'dart:math';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:gyawun_beta/generated/l10n.dart';
import 'package:gyawun_beta/screens/browse_screen/browse_screen.dart';
Expand All @@ -23,6 +24,8 @@ class LocalLibrary extends StatelessWidget {
@override
Widget build(BuildContext context) {
Map playlists = context.watch<LibraryService>().playlists;

// pprint(playlists);
return Scaffold(
body: SingleChildScrollView(
child: Column(
Expand Down Expand Up @@ -114,12 +117,13 @@ class LocalLibrary extends StatelessWidget {
onTap: () {
if (item['isPredefined']) {
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => BrowseScreen(
endpoint: item['endpoint']
.cast<String, dynamic>()),
));
context,
CupertinoPageRoute(
builder: (context) => BrowseScreen(
endpoint: item['endpoint']
.cast<String, dynamic>()),
),
);
} else {
Navigator.push(
context,
Expand Down Expand Up @@ -232,6 +236,31 @@ class LocalLibrary extends StatelessWidget {
],
),
),
floatingActionButtonLocation: ExpandableFab.location,
floatingActionButton: ExpandableFab(
openButtonBuilder: RotateFloatingActionButtonBuilder(
child: const Icon(CupertinoIcons.add),
),
closeButtonBuilder: DefaultFloatingActionButtonBuilder(
child: const Icon(CupertinoIcons.clear),
),
distance: 70,
type: ExpandableFabType.up,
children: [
FloatingActionButton.small(
onPressed: () {
Modals.showCreateplaylistModal(context);
},
child: const Icon(CupertinoIcons.create),
),
FloatingActionButton.small(
onPressed: () {
Modals.showImportplaylistModal(context);
},
child: const Icon(Icons.import_export),
),
],
),
);
}
}
Loading

0 comments on commit d93325a

Please sign in to comment.