Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bumped up flutter_reaction_button from 2.0.2 to 3.0.0+2. #2079

Merged
merged 15 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext.kotlin_version = '1.8.0'
repositories {
jcenter()
google()
mavenCentral()
}

dependencies {
Expand Down
5 changes: 3 additions & 2 deletions lib/widgets/multi_reaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ class _MultiReactionButtonState extends State<MultiReactButton> {
@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(
Expand Down
24 changes: 12 additions & 12 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Ayush0Chaudhary marked this conversation as resolved.
Show resolved Hide resolved
googleapis:
dependency: "direct main"
description:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -93,14 +90,6 @@ Future<void> main() async {
TestWidgetsFlutterBinding.ensureInitialized();
locator<GraphqlConfig>().test();
locator<SizeConfig>().test();
final Directory dir = Directory('temporaryPath');
Hive
..init(dir.path)
..registerAdapter(UserAdapter())
..registerAdapter(OrgInfoAdapter());
await Hive.openBox<User>('currentUser');
await Hive.openBox<OrgInfo>('currentOrg');
await Hive.openBox('url');

group('Setting Page Screen Widget Test in dark mode', () {
testWidgets("Testing if Settings Screen shows up", (tester) async {
Expand Down
35 changes: 35 additions & 0 deletions test/widget_tests/widgets/post_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 {
Expand Down
Loading