Skip to content

Commit

Permalink
Merge branch 'align'
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekAbdelouahed committed Oct 29, 2021
2 parents 7258dc2 + 4c129b3 commit 87871a7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion example/lib/items/item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class _ItemState extends State<Item> with AutomaticKeepAliveClientMixin {
width: MediaQuery.of(context).size.width * .2,
child: FittedBox(
fit: BoxFit.scaleDown,
child: FlutterReactionButtonCheck<String>(
child: ReactionButtonToggle<String>(
onReactionChanged: (String? value, bool isChecked) {
print(
'Selected value: $value, isChecked: $isChecked');
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class _MyAppState extends State<MyApp> {
actions: [
Builder(
builder: (ctx) {
return FlutterReactionButton<String>(
return ReactionButton<String>(
onReactionChanged: (String? value) {
ScaffoldMessenger.of(ctx).showSnackBar(
SnackBar(
Expand Down
4 changes: 2 additions & 2 deletions lib/flutter_reaction_button.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library flutter_reaction_button;

export 'src/models/reaction.dart';
export 'src/ui/flutter_reaction_button.dart';
export 'src/ui/flutter_reaction_button_check.dart';
export 'src/ui/reaction_button.dart';
export 'src/ui/reaction_button_toggle.dart';
export 'src/utils/reactions_position.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import '../utils/extensions.dart';
import '../utils/reactions_position.dart';
import 'reactions_box.dart';

class FlutterReactionButton<T> extends StatefulWidget {
class ReactionButton<T> extends StatefulWidget {
/// This triggers when reaction button value changed.
final void Function(T?) onReactionChanged;

Expand Down Expand Up @@ -39,7 +39,7 @@ class FlutterReactionButton<T> extends StatefulWidget {

final double itemScale;

FlutterReactionButton({
ReactionButton({
Key? key,
required this.onReactionChanged,
required this.reactions,
Expand All @@ -56,10 +56,10 @@ class FlutterReactionButton<T> extends StatefulWidget {
}) : super(key: key);

@override
_FlutterReactionButtonState createState() => _FlutterReactionButtonState<T>();
_ReactionButtonState createState() => _ReactionButtonState<T>();
}

class _FlutterReactionButtonState<T> extends State<FlutterReactionButton<T>> {
class _ReactionButtonState<T> extends State<ReactionButton<T>> {
final GlobalKey _buttonKey = GlobalKey();

Reaction? _selectedReaction;
Expand All @@ -69,7 +69,7 @@ class _FlutterReactionButtonState<T> extends State<FlutterReactionButton<T>> {
}

@override
void didUpdateWidget(FlutterReactionButton<T> oldWidget) {
void didUpdateWidget(ReactionButton<T> oldWidget) {
super.didUpdateWidget(oldWidget);
_init();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '../utils/extensions.dart';
import '../utils/reactions_position.dart';
import 'reactions_box.dart';

class FlutterReactionButtonCheck<T> extends StatefulWidget {
class ReactionButtonToggle<T> extends StatefulWidget {
/// This triggers when reaction button value changed.
final void Function(T?, bool) onReactionChanged;

Expand Down Expand Up @@ -45,7 +45,7 @@ class FlutterReactionButtonCheck<T> extends StatefulWidget {

final double itemScale;

FlutterReactionButtonCheck({
ReactionButtonToggle({
Key? key,
required this.onReactionChanged,
required this.reactions,
Expand All @@ -63,12 +63,10 @@ class FlutterReactionButtonCheck<T> extends StatefulWidget {
}) : super(key: key);

@override
_FlutterReactionButtonCheckState createState() =>
_FlutterReactionButtonCheckState<T>();
_ReactionButtonToggleState createState() => _ReactionButtonToggleState<T>();
}

class _FlutterReactionButtonCheckState<T>
extends State<FlutterReactionButtonCheck<T>> {
class _ReactionButtonToggleState<T> extends State<ReactionButtonToggle<T>> {
final GlobalKey _buttonKey = GlobalKey();

Reaction<T>? _selectedReaction;
Expand All @@ -84,7 +82,7 @@ class _FlutterReactionButtonCheckState<T>
}

@override
void didUpdateWidget(FlutterReactionButtonCheck<T> oldWidget) {
void didUpdateWidget(ReactionButtonToggle<T> oldWidget) {
super.didUpdateWidget(oldWidget);
_init();
}
Expand Down

0 comments on commit 87871a7

Please sign in to comment.