diff --git a/android/build.gradle b/android/build.gradle index 7ebc3a3f9..80fedb156 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,8 +1,8 @@ buildscript { ext.kotlin_version = '1.8.0' repositories { + jcenter() google() - mavenCentral() } dependencies { diff --git a/lib/widgets/multi_reaction.dart b/lib/widgets/multi_reaction.dart index 6e28e7ca3..7d7677487 100644 --- a/lib/widgets/multi_reaction.dart +++ b/lib/widgets/multi_reaction.dart @@ -14,11 +14,12 @@ class _MultiReactionButtonState extends State { @override Widget build(BuildContext context) { return ReactionButton( + itemSize: const Size.square(35), onReactionChanged: (value) { // ignore: unnecessary_statements - widget.toggle; + widget.toggle(); }, - initialReaction: Reaction( + selectedReaction: Reaction( icon: Padding( padding: const EdgeInsets.all(8.0), child: SizedBox( diff --git a/pubspec.lock b/pubspec.lock index 86b499812..4c72f5510 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -535,10 +535,10 @@ packages: dependency: "direct main" description: name: flutter_reaction_button - sha256: "087d9ec8c60e6761e93893d16b1e4b894b6766e90b001c69ce41e0a03bffdfaa" + sha256: e9ecf6ee0be8c88cfd8c06a638680aa78a359ed0c0d44b63002d7b68bdddc793 url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.0.0+2" flutter_speed_dial: dependency: "direct main" description: @@ -729,10 +729,10 @@ packages: dependency: transitive description: name: google_maps_flutter_web - sha256: f893d1542c6562bc8299ef768fbbe92ade83c220ab3209b9477ec9f81ad585e4 + sha256: "05067c5aa762ebee44b7ef4902a311ed8cf891ef655e2798bae063aa3050c8d9" url: "https://pub.dev" source: hosted - version: "0.5.4+2" + version: "0.5.4+1" googleapis: dependency: "direct main" description: @@ -1725,10 +1725,10 @@ packages: dependency: transitive description: name: video_player_avfoundation - sha256: "6387c2de77763b45104256b3b00b660089be4f909ded8631457dc11bf635e38f" + sha256: bf1a1322bf68bccd349982ba1f5a41314a3880861fb9a93d25d6d0a2345845f0 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.4.11" video_player_platform_interface: dependency: transitive description: @@ -1741,10 +1741,10 @@ packages: dependency: transitive description: name: video_player_web - sha256: "2dd24f7ba46bfb5d070e9c795001db95e0ca5f2a3d025e98f287c10c9f0fd62f" + sha256: "9c34a243785feca23148bfcd772dbb803d63c9304488177ec4f3f4463802fcb7" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.0.17" visibility_detector: dependency: "direct main" description: @@ -1797,10 +1797,10 @@ packages: dependency: transitive description: name: win32_registry - sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a" + sha256: e4506d60b7244251bc59df15656a3093501c37fb5af02105a944d73eb95be4c9 url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.1" xdg_directories: dependency: transitive description: @@ -1826,5 +1826,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0 <3.13.0" - flutter: ">=3.13.0" + dart: ">=3.1.0-185.0.dev <3.13.0" + flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index bfc7b0af4..748e8d166 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,7 +46,7 @@ dependencies: flutter_local_notifications: ^16.1.0 flutter_localizations: sdk: flutter - flutter_reaction_button: ^2.0.1+2 + flutter_reaction_button: ^3.0.0+2 flutter_speed_dial: ^7.0.0 flutter_svg: ^2.0.8 font_awesome_flutter: ^10.6.0 diff --git a/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart b/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart index 016cecb44..53d28173d 100644 --- a/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart +++ b/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart @@ -6,14 +6,11 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:hive/hive.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; import 'package:talawa/constants/constants.dart'; import 'package:talawa/constants/custom_theme.dart'; import 'package:talawa/models/language/language_model.dart'; -import 'package:talawa/models/organization/org_info.dart'; -import 'package:talawa/models/user/user_info.dart'; import 'package:talawa/router.dart' as router; import 'package:talawa/services/graphql_config.dart'; import 'package:talawa/services/navigation_service.dart'; @@ -93,14 +90,6 @@ Future main() async { TestWidgetsFlutterBinding.ensureInitialized(); locator().test(); locator().test(); - final Directory dir = Directory('temporaryPath'); - Hive - ..init(dir.path) - ..registerAdapter(UserAdapter()) - ..registerAdapter(OrgInfoAdapter()); - await Hive.openBox('currentUser'); - await Hive.openBox('currentOrg'); - await Hive.openBox('url'); group('Setting Page Screen Widget Test in dark mode', () { testWidgets("Testing if Settings Screen shows up", (tester) async { diff --git a/test/widget_tests/widgets/post_widget_test.dart b/test/widget_tests/widgets/post_widget_test.dart index b67d81ac5..15d0af208 100644 --- a/test/widget_tests/widgets/post_widget_test.dart +++ b/test/widget_tests/widgets/post_widget_test.dart @@ -16,6 +16,7 @@ import 'package:talawa/utils/app_localization.dart'; import 'package:talawa/view_model/widgets_view_models/like_button_view_model.dart'; import 'package:talawa/views/base_view.dart'; import 'package:talawa/widgets/custom_avatar.dart'; +import 'package:talawa/widgets/multi_reaction.dart'; import 'package:talawa/widgets/post_container.dart'; import 'package:talawa/widgets/post_detailed_page.dart'; import 'package:talawa/widgets/post_widget.dart'; @@ -386,6 +387,40 @@ void main() { }); group('Test props of children for baseview', () { + testWidgets( + 'Test MultiReactButton presence and onReactionChanged property in NewsPostWidget', + (WidgetTester tester) async { + await tester.runAsync(() async { + // Variable to check if onReactionChanged is called + bool reactionChangedCalled = false; + + // Build the NewsPostWidget containing the MultiReactButton + await tester.pumpWidget( + MultiReactButton( + toggle: () { + // Set the flag when onReactionChanged is called + reactionChangedCalled = true; + }, + ), + ); + + // Find the MultiReactButton widget within the NewsPostWidget + final multiReactButtonFinder = find.byType(MultiReactButton); + + // Ensure the MultiReactButton widget is present in the widget tree + expect(multiReactButtonFinder, findsOneWidget); + + // Simulate a reaction change on the MultiReactButton + await tester.tap( + multiReactButtonFinder, + ); // Replace with your actual tap action + await tester.pump(); + + // Ensure that onReactionChanged callback was triggered + expect(reactionChangedCalled, true); + }); + }); + testWidgets('Test props first padding widget', (WidgetTester tester) async { await tester.runAsync(() async {