From cfecf0eafd5cd76ceab3a05e11fede643590ac66 Mon Sep 17 00:00:00 2001 From: Priyanshu Verma Date: Fri, 12 Jul 2024 18:16:31 +0530 Subject: [PATCH 1/2] context menu to add song in queue and play next --- lib/core/widgets/media_card.dart | 137 ++++++++++-------- lib/core/widgets/related_songs_list.dart | 66 +++++++++ lib/functions/album/view/album_view.dart | 44 ++++-- lib/functions/artist/view/artist_view.dart | 47 ++++-- lib/functions/charts/view/charts_view.dart | 43 ++++-- .../player/controllers/player_controller.dart | 53 ++++++- .../playlist/view/playlist_view.dart | 43 ++++-- lib/functions/song/view/song_view.dart | 42 +----- lib/main.dart | 43 +++--- pubspec.lock | 78 +++++++++- pubspec.yaml | 3 +- .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 13 files changed, 410 insertions(+), 193 deletions(-) create mode 100644 lib/core/widgets/related_songs_list.dart diff --git a/lib/core/widgets/media_card.dart b/lib/core/widgets/media_card.dart index 6a67194..24bded7 100644 --- a/lib/core/widgets/media_card.dart +++ b/lib/core/widgets/media_card.dart @@ -1,5 +1,5 @@ +import 'package:context_menus/context_menus.dart'; import 'package:flutter/material.dart'; - import 'cache_image.dart'; class MediaCard extends StatelessWidget { @@ -13,6 +13,7 @@ class MediaCard extends StatelessWidget { final bool showMenu; final bool explicitContent; final Color? accentColor; + final List contextMenu; const MediaCard({ super.key, required this.onTap, @@ -23,6 +24,7 @@ class MediaCard extends StatelessWidget { this.badgeIcon, required this.explicitContent, this.onDoubleTap, + this.contextMenu = const [], this.onMenuTap, this.showMenu = true, }); @@ -31,77 +33,86 @@ class MediaCard extends StatelessWidget { Widget build(BuildContext context) { return Card( surfaceTintColor: accentColor, - child: InkWell( - onTap: onTap, - onDoubleTap: onDoubleTap, - borderRadius: BorderRadius.circular(12), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Flexible( - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Badge( - isLabelVisible: badgeIcon != null, - backgroundColor: - explicitContent ? Colors.redAccent : Colors.teal, - label: Icon( - badgeIcon, - size: 10, - ), - child: ClipRRect( - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(8), - topLeft: Radius.circular(8), + child: ContextMenuRegion( + contextMenu: GenericContextMenu( + buttonStyle: ContextMenuButtonStyle( + hoverBgColor: Colors.teal.shade100, + hoverFgColor: Colors.black, + ), + buttonConfigs: contextMenu, + ), + child: InkWell( + onTap: onTap, + onDoubleTap: onDoubleTap, + borderRadius: BorderRadius.circular(12), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Badge( + isLabelVisible: badgeIcon != null, + backgroundColor: + explicitContent ? Colors.redAccent : Colors.teal, + label: Icon( + badgeIcon, + size: 10, ), - child: CacheImage( - url: image, - width: 60, - height: 60, + child: ClipRRect( + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(8), + topLeft: Radius.circular(8), + ), + child: CacheImage( + url: image, + width: 60, + height: 60, + ), ), ), - ), - Flexible( - child: Container( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - title, - style: const TextStyle( - fontWeight: FontWeight.bold, + Flexible( + child: Container( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + title, + style: const TextStyle( + fontWeight: FontWeight.bold, + ), + maxLines: 1, + softWrap: true, ), - maxLines: 1, - softWrap: true, - ), - Text( - subtitle, - style: const TextStyle( - overflow: TextOverflow.fade, + Text( + subtitle, + style: const TextStyle( + overflow: TextOverflow.fade, + ), + maxLines: 1, + softWrap: true, ), - maxLines: 1, - softWrap: true, - ), - ], + ], + ), ), ), - ), - ], + ], + ), ), - ), - Visibility( - visible: showMenu, - child: IconButton( - tooltip: "Options", - onPressed: onMenuTap ?? () {}, - icon: const Icon(Icons.more_vert_rounded), + Visibility( + visible: showMenu, + child: IconButton( + tooltip: "Options", + onPressed: onMenuTap ?? () {}, + icon: const Icon(Icons.more_vert_rounded), + ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/core/widgets/related_songs_list.dart b/lib/core/widgets/related_songs_list.dart new file mode 100644 index 0000000..f581e73 --- /dev/null +++ b/lib/core/widgets/related_songs_list.dart @@ -0,0 +1,66 @@ +import 'package:context_menus/context_menus.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:sangeet/core/core.dart'; +import 'package:sangeet/core/skeletions/media_loading_skeletion.dart'; +import 'package:sangeet/functions/explore/controllers/explore_controller.dart'; +import 'package:sangeet/functions/player/controllers/player_controller.dart'; +import 'package:sangeet/functions/song/view/song_view.dart'; + +import 'media_card.dart'; + +class RelatedSongsList extends ConsumerWidget { + final String songId; + const RelatedSongsList({required this.songId, super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final controller = ref.watch(playerControllerProvider.notifier); + return Container( + padding: const EdgeInsets.symmetric(vertical: 10), + child: ref.watch(getRelatedSongsProvider(songId)).when( + data: (songlist) { + return ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + scrollDirection: Axis.vertical, + itemCount: songlist.songs.length, + itemBuilder: (context, index) { + final song = songlist.songs[index]; + return MediaCard( + onDoubleTap: () => controller.runRadio( + radioId: song.id, + type: MediaType.song, + prevSongs: songlist.songs, + playCurrent: true, + ), + onTap: () => Navigator.of(context).push( + SongView.route(song.id), + ), + contextMenu: [ + ContextMenuButtonConfig( + icon: const Icon(Icons.queue_music_rounded), + "Add in Queue", + onPressed: () => controller.addSongToQueue(song: song), + ), + ContextMenuButtonConfig( + icon: const Icon(Icons.play_circle_filled_rounded), + "Play Next", + onPressed: () => controller.addSongToNext(song: song), + ) + ], + image: song.images[1].url, + title: song.title, + subtitle: + "${formatNumber(song.playCount)} listens, ${song.label}", + explicitContent: song.explicitContent, + ); + }, + ); + }, + error: (er, st) => ErrorPage(error: er.toString()), + loading: () => const MediaLoader(), + ), + ); + } +} diff --git a/lib/functions/album/view/album_view.dart b/lib/functions/album/view/album_view.dart index 99a3e5d..6fb88e7 100644 --- a/lib/functions/album/view/album_view.dart +++ b/lib/functions/album/view/album_view.dart @@ -1,3 +1,4 @@ +import 'package:context_menus/context_menus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:sangeet/core/core.dart'; @@ -24,7 +25,7 @@ class AlbumView extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final name = ModalRoute.of(context)?.settings.name ?? albumId; - + final controller = ref.watch(playerControllerProvider.notifier); return ref.watch(albumByIdProvider(name)).when( data: (album) { return BlurImageContainer( @@ -82,12 +83,10 @@ class AlbumView extends ConsumerWidget { ), ), PlayButton( - onPressed: () => ref - .watch(playerControllerProvider.notifier) - .runRadio( - radioId: album.id, - type: MediaType.album, - ), + onPressed: () => controller.runRadio( + radioId: album.id, + type: MediaType.album, + ), ) ], ), @@ -101,15 +100,28 @@ class AlbumView extends ConsumerWidget { itemBuilder: (context, index) { final song = album.songs[index]; return MediaCard( - onTap: () => ref - .watch(playerControllerProvider.notifier) - .runRadio( - radioId: song.id, - type: MediaType.song, - prevSongs: album.songs, - playCurrent: true, - ), - onDoubleTap: () => Navigator.of(context).push( + onDoubleTap: () => controller.runRadio( + radioId: song.id, + type: MediaType.song, + prevSongs: album.songs, + playCurrent: true, + ), + contextMenu: [ + ContextMenuButtonConfig( + icon: const Icon(Icons.queue_music_rounded), + "Add in Queue", + onPressed: () => + controller.addSongToQueue(song: song), + ), + ContextMenuButtonConfig( + icon: const Icon( + Icons.play_circle_filled_rounded), + "Play Next", + onPressed: () => + controller.addSongToNext(song: song), + ) + ], + onTap: () => Navigator.of(context).push( SongView.route(song.id), ), image: song.images[1].url, diff --git a/lib/functions/artist/view/artist_view.dart b/lib/functions/artist/view/artist_view.dart index 62922e7..ad8cf37 100644 --- a/lib/functions/artist/view/artist_view.dart +++ b/lib/functions/artist/view/artist_view.dart @@ -1,3 +1,4 @@ +import 'package:context_menus/context_menus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:sangeet/core/core.dart'; @@ -10,6 +11,7 @@ import 'package:sangeet/core/widgets/top_details.dart'; import 'package:sangeet/functions/album/view/album_view.dart'; import 'package:sangeet/functions/artist/controller/artist_controller.dart'; import 'package:sangeet/functions/player/controllers/player_controller.dart'; +import 'package:sangeet/functions/song/view/song_view.dart'; class ArtistView extends ConsumerWidget { static route(String id) => MaterialPageRoute( @@ -24,6 +26,7 @@ class ArtistView extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final name = ModalRoute.of(context)?.settings.name ?? artistId; + final controller = ref.watch(playerControllerProvider.notifier); return ref.watch(artistByIdProvider(name)).when( data: (artist) { @@ -61,13 +64,11 @@ class ArtistView extends ConsumerWidget { ], ), PlayButton( - onPressed: () => ref - .watch(playerControllerProvider.notifier) - .runRadio( - radioId: artist.id, - type: MediaType.artist, - prevSongs: artist.topSongs, - ), + onPressed: () => controller.runRadio( + radioId: artist.id, + type: MediaType.artist, + prevSongs: artist.topSongs, + ), ) ], ), @@ -82,19 +83,35 @@ class ArtistView extends ConsumerWidget { itemBuilder: (context, index) { final song = artist.topSongs[index]; return MediaCard( - onTap: () => ref - .watch(playerControllerProvider.notifier) - .runRadio( - radioId: song.id, - type: MediaType.song, - prevSongs: artist.topSongs, - playCurrent: true, - ), + onDoubleTap: () => controller.runRadio( + radioId: song.id, + type: MediaType.song, + prevSongs: artist.topSongs, + playCurrent: true, + ), + onTap: () => Navigator.of(context).push( + SongView.route(song.id), + ), image: song.images[1].url, title: song.title, subtitle: "${song.label}, ${formatDuration(song.duration)}", explicitContent: song.explicitContent, + contextMenu: [ + ContextMenuButtonConfig( + icon: const Icon(Icons.queue_music_rounded), + "Add in Queue", + onPressed: () => + controller.addSongToQueue(song: song), + ), + ContextMenuButtonConfig( + icon: const Icon( + Icons.play_circle_filled_rounded), + "Play Next", + onPressed: () => + controller.addSongToNext(song: song), + ) + ], ); }, ), diff --git a/lib/functions/charts/view/charts_view.dart b/lib/functions/charts/view/charts_view.dart index c3a765f..ff4108a 100644 --- a/lib/functions/charts/view/charts_view.dart +++ b/lib/functions/charts/view/charts_view.dart @@ -1,3 +1,4 @@ +import 'package:context_menus/context_menus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:sangeet/core/core.dart'; @@ -25,6 +26,7 @@ class ChartView extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final name = ModalRoute.of(context)?.settings.name ?? chartId; + final controller = ref.watch(playerControllerProvider.notifier); return ref.watch(chartByIdProvider(name)).when( data: (chart) { @@ -74,12 +76,10 @@ class ChartView extends ConsumerWidget { ), ), PlayButton( - onPressed: () => ref - .watch(playerControllerProvider.notifier) - .runRadio( - radioId: chart.id, - type: MediaType.playlist, - ), + onPressed: () => controller.runRadio( + radioId: chart.id, + type: MediaType.playlist, + ), ) ], ), @@ -94,17 +94,30 @@ class ChartView extends ConsumerWidget { itemBuilder: (context, index) { final song = chart.songs[index]; return MediaCard( - onTap: () => ref - .watch(playerControllerProvider.notifier) - .runRadio( - radioId: song.id, - type: MediaType.song, - prevSongs: chart.songs, - playCurrent: true, - ), - onDoubleTap: () => Navigator.of(context).push( + onDoubleTap: () => controller.runRadio( + radioId: song.id, + type: MediaType.song, + prevSongs: chart.songs, + playCurrent: true, + ), + onTap: () => Navigator.of(context).push( SongView.route(song.id), ), + contextMenu: [ + ContextMenuButtonConfig( + icon: const Icon(Icons.queue_music_rounded), + "Add in Queue", + onPressed: () => + controller.addSongToQueue(song: song), + ), + ContextMenuButtonConfig( + icon: const Icon( + Icons.play_circle_filled_rounded), + "Play Next", + onPressed: () => + controller.addSongToNext(song: song), + ) + ], image: song.images[1].url, title: song.title, subtitle: diff --git a/lib/functions/player/controllers/player_controller.dart b/lib/functions/player/controllers/player_controller.dart index 6661d79..cc1a858 100644 --- a/lib/functions/player/controllers/player_controller.dart +++ b/lib/functions/player/controllers/player_controller.dart @@ -10,6 +10,7 @@ import 'package:sangeet/core/api_provider.dart'; import 'package:sangeet/core/core.dart'; import 'package:sangeet/functions/player/widgets/common.dart'; import 'package:sangeet/functions/settings/controllers/settings_controller.dart'; +import 'package:sangeet_api/models.dart'; import 'package:sangeet_api/modules/song/models/song_model.dart'; import 'package:sangeet_api/sangeet_api.dart'; @@ -185,11 +186,12 @@ class PlayerController extends StateNotifier { final song = songsObjects.songs[i]; await playlist.insert( - playlist.length, - AudioSource.uri( - Uri.parse(uri), - tag: song, - )); + playlist.length, + AudioSource.uri( + Uri.parse(uri), + tag: song, + ), + ); } } catch (e) { if (kDebugMode) { @@ -199,6 +201,47 @@ class PlayerController extends StateNotifier { } } + Future addSongToQueue({required SongModel song}) async { + try { + final quality = await _settingsController.getSongQuality(); + final uri = song.urls + .where((element) => element.quality == quality.name) + .toList()[0] + .url; + await playlist.add(AudioSource.uri( + Uri.parse(uri), + tag: song, + )); + + BotToast.showText(text: "Added to queue"); + } catch (e) { + BotToast.showText(text: "Error: ${e.toString()}"); + } + } + + Future addSongToNext({required SongModel song}) async { + try { + final indx = (_player.currentIndex ?? 0) + 1; + + final quality = await _settingsController.getSongQuality(); + final uri = song.urls + .where((element) => element.quality == quality.name) + .toList()[0] + .url; + await playlist.insert( + indx, + AudioSource.uri( + Uri.parse(uri), + tag: song, + ), + ); + + BotToast.showText(text: "Added to play next"); + } catch (e) { + BotToast.showText(text: "Error: ${e.toString()}"); + } + } + @override void dispose() { super.dispose(); diff --git a/lib/functions/playlist/view/playlist_view.dart b/lib/functions/playlist/view/playlist_view.dart index b058f21..c131bf7 100644 --- a/lib/functions/playlist/view/playlist_view.dart +++ b/lib/functions/playlist/view/playlist_view.dart @@ -1,3 +1,4 @@ +import 'package:context_menus/context_menus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:sangeet/core/core.dart'; @@ -25,6 +26,7 @@ class PlaylistView extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final name = ModalRoute.of(context)?.settings.name ?? playlistId; + final controller = ref.watch(playerControllerProvider.notifier); return ref.watch(playlistByIdProvider(name)).when( data: (playlist) { @@ -73,12 +75,10 @@ class PlaylistView extends ConsumerWidget { ), ), PlayButton( - onPressed: () => ref - .watch(playerControllerProvider.notifier) - .runRadio( - radioId: playlist.id, - type: MediaType.playlist, - ), + onPressed: () => controller.runRadio( + radioId: playlist.id, + type: MediaType.playlist, + ), ), ], ), @@ -93,15 +93,13 @@ class PlaylistView extends ConsumerWidget { itemBuilder: (context, index) { final song = playlist.songs[index]; return MediaCard( - onTap: () => ref - .watch(playerControllerProvider.notifier) - .runRadio( - radioId: song.id, - type: MediaType.song, - prevSongs: playlist.songs, - playCurrent: true, - ), - onDoubleTap: () => Navigator.of(context).push( + onDoubleTap: () => controller.runRadio( + radioId: song.id, + type: MediaType.song, + prevSongs: playlist.songs, + playCurrent: true, + ), + onTap: () => Navigator.of(context).push( SongView.route(song.id), ), image: song.images[1].url, @@ -109,6 +107,21 @@ class PlaylistView extends ConsumerWidget { subtitle: "${formatNumber(song.playCount)} listens, ${song.label}", explicitContent: song.explicitContent, + contextMenu: [ + ContextMenuButtonConfig( + icon: const Icon(Icons.queue_music_rounded), + "Add in Queue", + onPressed: () => + controller.addSongToQueue(song: song), + ), + ContextMenuButtonConfig( + icon: const Icon( + Icons.play_circle_filled_rounded), + "Play Next", + onPressed: () => + controller.addSongToNext(song: song), + ) + ], ); }, ), diff --git a/lib/functions/song/view/song_view.dart b/lib/functions/song/view/song_view.dart index 289f384..b756dda 100644 --- a/lib/functions/song/view/song_view.dart +++ b/lib/functions/song/view/song_view.dart @@ -1,15 +1,14 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:sangeet/core/core.dart'; -import 'package:sangeet/core/skeletions/media_loading_skeletion.dart'; import 'package:sangeet/core/skeletions/screen_loading_skeleton.dart'; import 'package:sangeet/core/widgets/blur_image_container.dart'; import 'package:sangeet/core/widgets/media_card.dart'; import 'package:sangeet/core/widgets/play_button.dart'; +import 'package:sangeet/core/widgets/related_songs_list.dart'; import 'package:sangeet/core/widgets/split_view_container.dart'; import 'package:sangeet/core/widgets/top_details.dart'; import 'package:sangeet/functions/artist/view/artist_view.dart'; -import 'package:sangeet/functions/explore/controllers/explore_controller.dart'; import 'package:sangeet/functions/player/controllers/player_controller.dart'; import 'package:sangeet/functions/song/controllers/song_controller.dart'; @@ -105,44 +104,7 @@ class _SongViewState extends ConsumerState { ), ), ), - Container( - padding: const EdgeInsets.symmetric(vertical: 10), - child: ref.watch(getRelatedSongsProvider(song.id)).when( - data: (sug) { - return ListView.builder( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - scrollDirection: Axis.vertical, - itemCount: sug.songs.length, - itemBuilder: (context, index) { - final song = sug.songs[index]; - return MediaCard( - onTap: () => ref - .watch( - playerControllerProvider.notifier) - .runRadio( - radioId: song.id, - type: MediaType.song, - prevSongs: sug.songs, - playCurrent: true, - ), - onDoubleTap: () => - Navigator.of(context).push( - SongView.route(song.id), - ), - image: song.images[1].url, - title: song.title, - subtitle: - "${formatNumber(song.playCount)} listens, ${song.label}", - explicitContent: song.explicitContent, - ); - }, - ); - }, - error: (er, st) => ErrorPage(error: er.toString()), - loading: () => const MediaLoader(), - ), - ), + RelatedSongsList(songId: song.id), ], ), rightChild: Column( diff --git a/lib/main.dart b/lib/main.dart index 099b234..897cb0d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,4 @@ +import 'package:context_menus/context_menus.dart'; import 'package:flutter/material.dart'; import 'package:bot_toast/bot_toast.dart'; @@ -25,29 +26,31 @@ class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { - return MaterialApp( - title: 'Sangeet', - debugShowCheckedModeBanner: false, - theme: ThemeData( - colorSchemeSeed: Colors.lightBlueAccent, - ), - darkTheme: ThemeData.dark().copyWith( - textTheme: GoogleFonts.ubuntuTextTheme(ThemeData.dark().textTheme), - colorScheme: ColorScheme.fromSeed( - seedColor: Colors.lightBlueAccent, - brightness: Brightness.dark, + return ContextMenuOverlay( + child: MaterialApp( + title: 'Sangeet', + debugShowCheckedModeBanner: false, + theme: ThemeData( + colorSchemeSeed: Colors.lightBlueAccent, ), - cardTheme: const CardTheme( - color: Colors.transparent, - elevation: .5, + darkTheme: ThemeData.dark().copyWith( + textTheme: GoogleFonts.ubuntuTextTheme(ThemeData.dark().textTheme), + colorScheme: ColorScheme.fromSeed( + seedColor: Colors.lightBlueAccent, + brightness: Brightness.dark, + ), + cardTheme: const CardTheme( + color: Colors.transparent, + elevation: .5, + ), ), + themeMode: ThemeMode.dark, + home: const HomeFrame(), + builder: BotToastInit(), + navigatorObservers: [ + BotToastNavigatorObserver(), + ], ), - themeMode: ThemeMode.dark, - home: const HomeFrame(), - builder: BotToastInit(), - navigatorObservers: [ - BotToastNavigatorObserver(), - ], ); } } diff --git a/pubspec.lock b/pubspec.lock index d120159..6fdbef9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -121,6 +121,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" + context_menus: + dependency: "direct main" + description: + name: context_menus + sha256: "2c2002d7fd23462b1e123e2a444842645cb243aac0f0d0d3283115e4b1b750f5" + url: "https://pub.dev" + source: hosted + version: "2.0.0+1" crypto: dependency: transitive description: @@ -596,7 +604,7 @@ packages: description: path: "." ref: main - resolved-ref: d02146a23c234f051966fa9193f736536bb5fd64 + resolved-ref: de70e11db865efaad530f25408cf612db73ec2c0 url: "https://github.com/priyanshuverma-dev/sangeet-api" source: git version: "0.1.3" @@ -813,14 +821,78 @@ packages: url: "https://pub.dev" source: hosted version: "0.1.3" + url_launcher: + dependency: transitive + description: + name: url_launcher + sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "17cd5e205ea615e2c6ea7a77323a11712dffa0720a8a90540db57a01347f9ad9" + url: "https://pub.dev" + source: hosted + version: "6.3.2" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e + url: "https://pub.dev" + source: hosted + version: "6.3.1" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 + url: "https://pub.dev" + source: hosted + version: "3.1.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 + url: "https://pub.dev" + source: hosted + version: "3.1.1" uuid: dependency: transitive description: name: uuid - sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" + sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90" url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "4.4.2" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 5d3c02b..9545092 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.1.0+1 +version: 1.2.7+1 environment: sdk: '>=3.3.3 <4.0.0' @@ -60,6 +60,7 @@ dependencies: intl: ^0.19.0 http: ^1.2.1 fast_cached_network_image: ^1.2.9 + context_menus: ^2.0.0+1 dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index f7f6fe2..7594fe4 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -25,6 +26,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("ScreenRetrieverPlugin")); TrayManagerPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("TrayManagerPlugin")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); WindowManagerPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("WindowManagerPlugin")); WindowsNotificationPluginCApiRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 1a50e2b..2fd85a7 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -8,6 +8,7 @@ list(APPEND FLUTTER_PLUGIN_LIST just_audio_windows screen_retriever tray_manager + url_launcher_windows window_manager windows_notification ) From 81e43058c29d04a77800c81a4ffa9a5c9834a98c Mon Sep 17 00:00:00 2001 From: Priyanshu Verma Date: Fri, 12 Jul 2024 18:20:37 +0530 Subject: [PATCH 2/2] branch added tests --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5a92e3a..035b3ad 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,10 +3,12 @@ on: branches: - main - master + - dev push: branches: - main - master + - dev name: "Integration Tests"