-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: completed channel point redemption event config (#222)
* Added print line to chat_history.dart Print line checks if message received is prefixed by '!'. This is done through isCommand property of TwitchMessageModel. * Update chat_history.dart * Add channel_point.dart * feat: channel point redemption event config * fix: merge conflict errors * added case for channel points in getExpiration * add selector widget for channel point redemption model and config * fix: add missing notifyListener * fix: add toJson for channel point * fix: resolve conflicts * remove pinnable switchlisttile * feat: add pin to manual clear unfulfilled rewards * style: change switchlisttile title and subtitle * style: comment unused variable * style: comment unused import * check if status is cancelled * fix: status typo changed from 'cancelled' to 'canceled' * style: remove unused import * removed manual clear function and include slider for additional duration * fix: use enums instead of string comparison * test: string to enum * fix: added string to enum parser * fix: parse correct argument type for status
- Loading branch information
Showing
9 changed files
with
210 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:rtchat/models/messages/twitch/eventsub_configuration.dart'; | ||
|
||
class ChannelPointRedemptionEventScreen extends StatelessWidget { | ||
const ChannelPointRedemptionEventScreen({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text("Channel Point Configuration"), | ||
), | ||
body: Consumer<EventSubConfigurationModel>( | ||
builder: (context, model, child) { | ||
return Column( | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.all(16), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text("Pin Duration", | ||
style: TextStyle( | ||
color: Theme.of(context).accentColor, | ||
fontWeight: FontWeight.bold, | ||
)), | ||
Slider.adaptive( | ||
value: model.channelPointRedemptionEventConfig | ||
.eventDuration.inSeconds | ||
.toDouble(), | ||
min: 0, | ||
max: 30, | ||
divisions: 15, | ||
label: | ||
"${model.channelPointRedemptionEventConfig.eventDuration.inSeconds} seconds", | ||
onChanged: (value) { | ||
model.setChannelPointRedemptionEventDuration( | ||
Duration(seconds: value.toInt())); | ||
}, | ||
), | ||
Text("Additional Pin Duration for Unfulfilled Rewards", | ||
style: TextStyle( | ||
color: Theme.of(context).accentColor, | ||
fontWeight: FontWeight.bold, | ||
)), | ||
Slider.adaptive( | ||
value: model.channelPointRedemptionEventConfig | ||
.unfulfilledAdditionalDuration.inSeconds | ||
.toDouble(), | ||
min: 0, | ||
max: 30, | ||
divisions: 15, | ||
label: | ||
"${model.channelPointRedemptionEventConfig.unfulfilledAdditionalDuration.inSeconds} seconds", | ||
onChanged: (value) { | ||
model | ||
.setChannelPointRedemptionEventUnfulfilledAdditionalDuration( | ||
Duration(seconds: value.toInt())); | ||
}, | ||
), | ||
SwitchListTile.adaptive( | ||
title: const Text('Enable event'), | ||
subtitle: const Text('Show event in chat history'), | ||
value: model.channelPointRedemptionEventConfig.showEvent, | ||
onChanged: (value) { | ||
model.setChannelPointRedemptionEventShowable(value); | ||
}, | ||
), | ||
], | ||
), | ||
) | ||
], | ||
); | ||
})); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters