chore: Redesign homeserver picker page
This commit is contained in:
parent
71ec663c67
commit
c6f79ce573
5 changed files with 142 additions and 121 deletions
29
lib/components/sentry_switch_list_tile.dart
Normal file
29
lib/components/sentry_switch_list_tile.dart
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import 'package:fluffychat/utils/sentry_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
class SentrySwitchListTile extends StatefulWidget {
|
||||
@override
|
||||
_SentrySwitchListTileState createState() => _SentrySwitchListTileState();
|
||||
}
|
||||
|
||||
class _SentrySwitchListTileState extends State<SentrySwitchListTile> {
|
||||
bool _enabled = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FutureBuilder<bool>(
|
||||
future: SentryController.getSentryStatus(),
|
||||
builder: (context, snapshot) {
|
||||
_enabled = snapshot.data ?? false;
|
||||
return SwitchListTile(
|
||||
title: Text(L10n.of(context).sendBugReports),
|
||||
value: _enabled,
|
||||
onChanged: (b) =>
|
||||
SentryController.toggleSentryAction(context, b).then(
|
||||
(_) => setState(() => null),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue