-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now displaying "All" group options on the Feed screen (#274).
This makes the settings for the "All" group more discoverable when it's being displayed on the Feed tab/screen.
- Loading branch information
1 parent
24cf473
commit 0443027
Showing
4 changed files
with
83 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Now displaying "All" group options on the Feed screen (#274) |
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,75 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:fritter/database/entities.dart'; | ||
import 'package:fritter/generated/l10n.dart'; | ||
import 'package:fritter/group/group_model.dart'; | ||
import 'package:fritter/ui/errors.dart'; | ||
import 'package:fritter/ui/futures.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
void showFeedSettings(BuildContext context, String group) { | ||
showModalBottomSheet( | ||
context: context, | ||
builder: (context) { | ||
var theme = Theme.of(context); | ||
|
||
return SizedBox( | ||
height: 220, | ||
child: Container( | ||
decoration: const BoxDecoration( | ||
borderRadius: BorderRadius.only( | ||
topLeft: Radius.circular(25), | ||
topRight: Radius.circular(25), | ||
), | ||
), | ||
child: Column( | ||
children: [ | ||
ListTile( | ||
leading: IconButton( | ||
icon: const Icon(Icons.arrow_back), | ||
onPressed: () { | ||
Navigator.of(context).pop(); | ||
}), | ||
title: Text(L10n.of(context).filters), | ||
tileColor: theme.colorScheme.primary, | ||
), | ||
Container( | ||
alignment: Alignment.centerLeft, | ||
margin: const EdgeInsets.only(bottom: 8, top: 16, left: 16, right: 16), | ||
child: Text( | ||
L10n.of(context).note_due_to_a_twitter_limitation_not_all_tweets_may_be_included, | ||
style: TextStyle( | ||
color: Theme.of(context).disabledColor, | ||
), | ||
)), | ||
Consumer<GroupModel>(builder: (context, model, child) { | ||
return FutureBuilderWrapper<SubscriptionGroupSettings>( | ||
future: model.loadSubscriptionGroupSettings(group), | ||
onError: (error, stackTrace) => InlineErrorWidget(error: error), | ||
onReady: (settings) => Column( | ||
children: [ | ||
CheckboxListTile( | ||
title: Text( | ||
L10n.of(context).include_replies, | ||
), | ||
value: settings.includeReplies, | ||
onChanged: (value) async { | ||
await model.toggleSubscriptionGroupIncludeReplies(group, value ?? false); | ||
}), | ||
CheckboxListTile( | ||
title: Text( | ||
L10n.of(context).include_retweets, | ||
), | ||
value: settings.includeRetweets, | ||
onChanged: (value) async { | ||
await model.toggleSubscriptionGroupIncludeRetweets(group, value ?? false); | ||
}), | ||
], | ||
), | ||
); | ||
}) | ||
], | ||
), | ||
), | ||
); | ||
}); | ||
} |
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