design: Adaptive switches
This commit is contained in:
parent
bc767da271
commit
956ee5bfc6
8 changed files with 17 additions and 19 deletions
|
|
@ -7,7 +7,7 @@ import 'package:fluffychat/utils/sentry_controller.dart';
|
|||
class SentrySwitchListTile extends StatefulWidget {
|
||||
final String label;
|
||||
|
||||
const SentrySwitchListTile({Key key, this.label}) : super(key: key);
|
||||
const SentrySwitchListTile.adaptive({Key key, this.label}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SentrySwitchListTileState createState() => _SentrySwitchListTileState();
|
||||
|
|
@ -22,7 +22,7 @@ class _SentrySwitchListTileState extends State<SentrySwitchListTile> {
|
|||
future: SentryController.getSentryStatus(),
|
||||
builder: (context, snapshot) {
|
||||
_enabled = snapshot.data ?? false;
|
||||
return SwitchListTile(
|
||||
return SwitchListTile.adaptive(
|
||||
title: Text(widget.label ?? L10n.of(context).sendBugReports),
|
||||
value: _enabled,
|
||||
onChanged: (b) =>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class SettingsSwitchListTile extends StatefulWidget {
|
|||
final String title;
|
||||
final Function(bool) onChanged;
|
||||
|
||||
const SettingsSwitchListTile({
|
||||
const SettingsSwitchListTile.adaptive({
|
||||
Key key,
|
||||
this.defaultValue = false,
|
||||
@required this.storeKey,
|
||||
|
|
@ -27,7 +27,7 @@ class _SettingsSwitchListTileState extends State<SettingsSwitchListTile> {
|
|||
future: Matrix.of(context)
|
||||
.store
|
||||
.getItemBool(widget.storeKey, widget.defaultValue),
|
||||
builder: (context, snapshot) => SwitchListTile(
|
||||
builder: (context, snapshot) => SwitchListTile.adaptive(
|
||||
value: snapshot.data ?? widget.defaultValue,
|
||||
title: Text(widget.title),
|
||||
onChanged: (bool newValue) async {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue