refactor: Switch to flutter_lints
This commit is contained in:
parent
9ceb811c76
commit
13fda9458f
101 changed files with 719 additions and 653 deletions
|
|
@ -7,6 +7,8 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
|||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
class Archive extends StatefulWidget {
|
||||
const Archive({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
ArchiveController createState() => ArchiveController();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
_wipe ??= widget.wipe;
|
||||
final buttons = <AdaptiveFlatButton>[];
|
||||
Widget body = PlatformInfos.isCupertinoStyle
|
||||
? CupertinoActivityIndicator()
|
||||
: LinearProgressIndicator();
|
||||
? const CupertinoActivityIndicator()
|
||||
: const LinearProgressIndicator();
|
||||
titleText = L10n.of(context).loadingPleaseWait;
|
||||
|
||||
if (bootstrap == null) {
|
||||
|
|
@ -96,7 +96,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
),
|
||||
title: Text(L10n.of(context).securityKey),
|
||||
|
|
@ -104,7 +104,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
body: Center(
|
||||
child: ConstrainedBox(
|
||||
constraints:
|
||||
BoxConstraints(maxWidth: FluffyThemes.columnWidth * 1.5),
|
||||
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 1.5),
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
children: [
|
||||
|
|
@ -116,7 +116,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
),
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton.icon(
|
||||
icon: Icon(Icons.copy_outlined),
|
||||
icon: const Icon(Icons.copy_outlined),
|
||||
label: Text(L10n.of(context).copyToClipboard),
|
||||
onPressed: () => Clipboard.setData(ClipboardData(text: key)),
|
||||
),
|
||||
|
|
@ -126,7 +126,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
primary: Theme.of(context).secondaryHeaderColor,
|
||||
onPrimary: Theme.of(context).primaryColor,
|
||||
),
|
||||
icon: Icon(Icons.check_outlined),
|
||||
icon: const Icon(Icons.check_outlined),
|
||||
label: Text(L10n.of(context).iWroteDownTheKey),
|
||||
onPressed: () => setState(() => _recoveryKeyStored = true),
|
||||
),
|
||||
|
|
@ -170,7 +170,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
),
|
||||
title: Text(L10n.of(context).pleaseEnterSecurityKey),
|
||||
|
|
@ -178,7 +178,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
body: Center(
|
||||
child: ConstrainedBox(
|
||||
constraints:
|
||||
BoxConstraints(maxWidth: FluffyThemes.columnWidth * 1.5),
|
||||
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 1.5),
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
children: [
|
||||
|
|
@ -199,7 +199,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
),
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton.icon(
|
||||
icon: Icon(Icons.lock_open_outlined),
|
||||
icon: const Icon(Icons.lock_open_outlined),
|
||||
label: Text(L10n.of(context).unlockChatBackup),
|
||||
onPressed: () async {
|
||||
setState(() {
|
||||
|
|
@ -222,12 +222,12 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
}),
|
||||
const SizedBox(height: 16),
|
||||
Row(children: [
|
||||
Expanded(child: Divider()),
|
||||
const Expanded(child: Divider()),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Text(L10n.of(context).or),
|
||||
),
|
||||
Expanded(child: Divider()),
|
||||
const Expanded(child: Divider()),
|
||||
]),
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton.icon(
|
||||
|
|
@ -235,7 +235,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
primary: Theme.of(context).secondaryHeaderColor,
|
||||
onPrimary: Theme.of(context).primaryColor,
|
||||
),
|
||||
icon: Icon(Icons.transfer_within_a_station_outlined),
|
||||
icon: const Icon(Icons.transfer_within_a_station_outlined),
|
||||
label: Text(L10n.of(context).transferFromAnotherDevice),
|
||||
onPressed: () async {
|
||||
final req = await showFutureLoadingDialog(
|
||||
|
|
@ -256,7 +256,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
primary: Theme.of(context).secondaryHeaderColor,
|
||||
onPrimary: Colors.red,
|
||||
),
|
||||
icon: Icon(Icons.delete_outlined),
|
||||
icon: const Icon(Icons.delete_outlined),
|
||||
label: Text(L10n.of(context).securityKeyLost),
|
||||
onPressed: () async {
|
||||
if (OkCancelResult.ok ==
|
||||
|
|
@ -305,7 +305,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||
break;
|
||||
case BootstrapState.error:
|
||||
titleText = L10n.of(context).oopsSomethingWentWrong;
|
||||
body = Icon(Icons.error_outline, color: Colors.red, size: 40);
|
||||
body = const Icon(Icons.error_outline, color: Colors.red, size: 40);
|
||||
buttons.add(AdaptiveFlatButton(
|
||||
label: L10n.of(context).close,
|
||||
onPressed: () =>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import '../utils/account_bundles.dart';
|
|||
class Chat extends StatefulWidget {
|
||||
final Widget sideView;
|
||||
|
||||
Chat({Key key, this.sideView}) : super(key: key);
|
||||
const Chat({Key key, this.sideView}) : super(key: key);
|
||||
|
||||
@override
|
||||
ChatController createState() => ChatController();
|
||||
|
|
@ -269,7 +269,7 @@ class ChatController extends State<Chat> {
|
|||
parseCommands: parseCommands);
|
||||
sendController.value = TextEditingValue(
|
||||
text: pendingText,
|
||||
selection: TextSelection.collapsed(offset: 0),
|
||||
selection: const TextSelection.collapsed(offset: 0),
|
||||
);
|
||||
|
||||
setState(() {
|
||||
|
|
@ -360,7 +360,7 @@ class ChatController extends State<Chat> {
|
|||
final result = await showDialog<String>(
|
||||
context: context,
|
||||
useRootNavigator: false,
|
||||
builder: (c) => RecordingDialog(),
|
||||
builder: (c) => const RecordingDialog(),
|
||||
);
|
||||
if (result == null) return;
|
||||
final audioFile = File(result);
|
||||
|
|
@ -705,11 +705,11 @@ class ChatController extends State<Chat> {
|
|||
|
||||
int findChildIndexCallback(Key key, Map<String, int> thisEventsKeyMap) {
|
||||
// this method is called very often. As such, it has to be optimized for speed.
|
||||
if (!(key is ValueKey)) {
|
||||
if (key is! ValueKey) {
|
||||
return null;
|
||||
}
|
||||
final eventId = (key as ValueKey).value;
|
||||
if (!(eventId is String)) {
|
||||
if (eventId is! String) {
|
||||
return null;
|
||||
}
|
||||
// first fetch the last index the event was at
|
||||
|
|
@ -764,18 +764,18 @@ class ChatController extends State<Chat> {
|
|||
}
|
||||
}
|
||||
typingCoolDown?.cancel();
|
||||
typingCoolDown = Timer(Duration(seconds: 2), () {
|
||||
typingCoolDown = Timer(const Duration(seconds: 2), () {
|
||||
typingCoolDown = null;
|
||||
currentlyTyping = false;
|
||||
room.setTyping(false);
|
||||
});
|
||||
typingTimeout ??= Timer(Duration(seconds: 30), () {
|
||||
typingTimeout ??= Timer(const Duration(seconds: 30), () {
|
||||
typingTimeout = null;
|
||||
currentlyTyping = false;
|
||||
});
|
||||
if (!currentlyTyping) {
|
||||
currentlyTyping = true;
|
||||
room.setTyping(true, timeout: Duration(seconds: 30).inMilliseconds);
|
||||
room.setTyping(true, timeout: const Duration(seconds: 30).inMilliseconds);
|
||||
}
|
||||
setState(() => inputText = text);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import 'package:vrouter/vrouter.dart';
|
|||
enum AliasActions { copy, delete, setCanonical }
|
||||
|
||||
class ChatDetails extends StatefulWidget {
|
||||
const ChatDetails();
|
||||
const ChatDetails({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
ChatDetailsController createState() => ChatDetailsController();
|
||||
|
|
@ -297,7 +297,7 @@ class ChatDetailsController extends State<ChatDetails> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
members ??= Matrix.of(context).client.getRoomById(roomId).getParticipants();
|
||||
return Container(
|
||||
return SizedBox(
|
||||
width: 360.0,
|
||||
child: ChatDetailsView(this),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -16,17 +16,19 @@ class ChatEncryptionSettings extends StatefulWidget {
|
|||
|
||||
class ChatEncryptionSettingsController extends State<ChatEncryptionSettings> {
|
||||
String get roomId => VRouter.of(context).pathParameters['roomid'];
|
||||
|
||||
Future<void> unblock(DeviceKeys key) async {
|
||||
if (key.blocked) {
|
||||
await key.setBlocked(false);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onSelected(
|
||||
BuildContext context, String action, DeviceKeys key) async {
|
||||
final room = Matrix.of(context).client.getRoomById(roomId);
|
||||
final unblock = () async {
|
||||
if (key.blocked) {
|
||||
await key.setBlocked(false);
|
||||
}
|
||||
};
|
||||
switch (action) {
|
||||
case 'verify':
|
||||
await unblock();
|
||||
await unblock(key);
|
||||
final req = key.startVerification();
|
||||
req.onUpdate = () {
|
||||
if (req.state == KeyVerificationState.done) {
|
||||
|
|
@ -36,7 +38,7 @@ class ChatEncryptionSettingsController extends State<ChatEncryptionSettings> {
|
|||
await KeyVerificationDialog(request: req).show(context);
|
||||
break;
|
||||
case 'verify_user':
|
||||
await unblock();
|
||||
await unblock(key);
|
||||
final req =
|
||||
await room.client.userDeviceKeys[key.userId].startVerification();
|
||||
req.onUpdate = () {
|
||||
|
|
@ -54,7 +56,7 @@ class ChatEncryptionSettingsController extends State<ChatEncryptionSettings> {
|
|||
setState(() => null);
|
||||
break;
|
||||
case 'unblock':
|
||||
await unblock();
|
||||
await unblock(key);
|
||||
setState(() => null);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||
import '../widgets/matrix.dart';
|
||||
|
||||
class DevicesSettings extends StatefulWidget {
|
||||
const DevicesSettings({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
DevicesSettingsController createState() => DevicesSettingsController();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ import 'package:uni_links/uni_links.dart';
|
|||
import '../main.dart';
|
||||
|
||||
class HomeserverPicker extends StatefulWidget {
|
||||
const HomeserverPicker({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
HomeserverPickerController createState() => HomeserverPickerController();
|
||||
}
|
||||
|
|
@ -37,7 +39,7 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
|||
this.domain = domain;
|
||||
_coolDown?.cancel();
|
||||
if (domain.isNotEmpty) {
|
||||
_coolDown = Timer(Duration(seconds: 1), checkHomeserverAction);
|
||||
_coolDown = Timer(const Duration(seconds: 1), checkHomeserverAction);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +135,7 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
|||
AppConfig.jitsiInstance = jitsi;
|
||||
}
|
||||
} catch (e) {
|
||||
setState(() => error = '${(e as Object).toLocalizedString(context)}');
|
||||
setState(() => error = (e as Object).toLocalizedString(context));
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() => isLoading = false);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class InvitationSelectionController extends State<InvitationSelection> {
|
|||
void searchUserWithCoolDown(String text) async {
|
||||
coolDown?.cancel();
|
||||
coolDown = Timer(
|
||||
Duration(seconds: 1),
|
||||
const Duration(seconds: 1),
|
||||
() => searchUser(context, text),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,10 @@ class KeyVerificationDialog extends StatefulWidget {
|
|||
|
||||
final KeyVerification request;
|
||||
|
||||
KeyVerificationDialog({
|
||||
const KeyVerificationDialog({
|
||||
Key key,
|
||||
this.request,
|
||||
});
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_KeyVerificationPageState createState() => _KeyVerificationPageState();
|
||||
|
|
@ -76,6 +77,33 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
|
||||
Profile profile;
|
||||
|
||||
Future<void> checkInput(String input) async {
|
||||
if (input == null || input.isEmpty) {
|
||||
return;
|
||||
}
|
||||
final valid = await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () async {
|
||||
// make sure the loading spinner shows before we test the keys
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
var valid = false;
|
||||
try {
|
||||
await widget.request.openSSSS(keyOrPassphrase: input);
|
||||
valid = true;
|
||||
} catch (_) {
|
||||
valid = false;
|
||||
}
|
||||
return valid;
|
||||
});
|
||||
if (valid.error != null) {
|
||||
await showOkAlertDialog(
|
||||
useRootNavigator: false,
|
||||
context: context,
|
||||
message: L10n.of(context).incorrectPassphraseOrKey,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
User user;
|
||||
|
|
@ -96,39 +124,13 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
// prompt the user for their ssss passphrase / key
|
||||
final textEditingController = TextEditingController();
|
||||
String input;
|
||||
final checkInput = () async {
|
||||
if (input == null || input.isEmpty) {
|
||||
return;
|
||||
}
|
||||
final valid = await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () async {
|
||||
// make sure the loading spinner shows before we test the keys
|
||||
await Future.delayed(Duration(milliseconds: 100));
|
||||
var valid = false;
|
||||
try {
|
||||
await widget.request.openSSSS(keyOrPassphrase: input);
|
||||
valid = true;
|
||||
} catch (_) {
|
||||
valid = false;
|
||||
}
|
||||
return valid;
|
||||
});
|
||||
if (valid.error != null) {
|
||||
await showOkAlertDialog(
|
||||
useRootNavigator: false,
|
||||
context: context,
|
||||
message: L10n.of(context).incorrectPassphraseOrKey,
|
||||
);
|
||||
}
|
||||
};
|
||||
body = Container(
|
||||
margin: EdgeInsets.only(left: 8.0, right: 8.0),
|
||||
margin: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(L10n.of(context).askSSSSSign,
|
||||
style: TextStyle(fontSize: 20)),
|
||||
style: const TextStyle(fontSize: 20)),
|
||||
Container(height: 10),
|
||||
TextField(
|
||||
controller: textEditingController,
|
||||
|
|
@ -136,7 +138,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
autocorrect: false,
|
||||
onSubmitted: (s) {
|
||||
input = s;
|
||||
checkInput();
|
||||
checkInput(input);
|
||||
},
|
||||
minLines: 1,
|
||||
maxLines: 1,
|
||||
|
|
@ -145,7 +147,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
hintText: L10n.of(context).passphraseOrKey,
|
||||
prefixStyle: TextStyle(color: Theme.of(context).primaryColor),
|
||||
suffixStyle: TextStyle(color: Theme.of(context).primaryColor),
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
@ -155,7 +157,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
label: L10n.of(context).submit,
|
||||
onPressed: () {
|
||||
input = textEditingController.text;
|
||||
checkInput();
|
||||
checkInput(input);
|
||||
},
|
||||
));
|
||||
buttons.add(AdaptiveFlatButton(
|
||||
|
|
@ -171,7 +173,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
Row(children: [
|
||||
if (!PlatformInfos.isCupertinoStyle)
|
||||
Avatar(user?.avatarUrl, displayName),
|
||||
SizedBox(width: 12),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
@ -181,11 +183,11 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
children: [
|
||||
Text(
|
||||
displayName,
|
||||
style: TextStyle(fontSize: 16),
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
Text(
|
||||
'${widget.request.userId} - ${widget.request.deviceId}',
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w300,
|
||||
fontSize: 14,
|
||||
),
|
||||
|
|
@ -222,7 +224,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
children: <Widget>[
|
||||
Image.asset('assets/verification.png', fit: BoxFit.contain),
|
||||
const SizedBox(height: 16),
|
||||
CircularProgressIndicator.adaptive(strokeWidth: 2),
|
||||
const CircularProgressIndicator.adaptive(strokeWidth: 2),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
L10n.of(context).waitingPartnerAcceptRequest,
|
||||
|
|
@ -269,7 +271,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
final numbers = widget.request.sasNumbers;
|
||||
final numbstr = '${numbers[0]}-${numbers[1]}-${numbers[2]}';
|
||||
compareWidget =
|
||||
TextSpan(text: numbstr, style: TextStyle(fontSize: 40));
|
||||
TextSpan(text: numbstr, style: const TextStyle(fontSize: 40));
|
||||
}
|
||||
body = Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
@ -277,11 +279,11 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
Center(
|
||||
child: Text(
|
||||
compareText,
|
||||
style: TextStyle(fontSize: 16),
|
||||
style: const TextStyle(fontSize: 16),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
const SizedBox(height: 10),
|
||||
Text.rich(
|
||||
compareWidget,
|
||||
textAlign: TextAlign.center,
|
||||
|
|
@ -305,8 +307,8 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
body = Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
CircularProgressIndicator.adaptive(strokeWidth: 2),
|
||||
SizedBox(height: 10),
|
||||
const CircularProgressIndicator.adaptive(strokeWidth: 2),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
acceptText,
|
||||
textAlign: TextAlign.center,
|
||||
|
|
@ -318,8 +320,9 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
body = Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Icon(Icons.check_circle_outlined, color: Colors.green, size: 200.0),
|
||||
SizedBox(height: 10),
|
||||
const Icon(Icons.check_circle_outlined,
|
||||
color: Colors.green, size: 200.0),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
L10n.of(context).verifySuccess,
|
||||
textAlign: TextAlign.center,
|
||||
|
|
@ -335,8 +338,8 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
body = Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Icon(Icons.cancel, color: Colors.red, size: 200.0),
|
||||
SizedBox(height: 10),
|
||||
const Icon(Icons.cancel, color: Colors.red, size: 200.0),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'Error ${widget.request.canceledCode}: ${widget.request.canceledReason}',
|
||||
textAlign: TextAlign.center,
|
||||
|
|
@ -355,7 +358,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
body,
|
||||
],
|
||||
),
|
||||
|
|
@ -379,7 +382,7 @@ class _Emoji extends StatelessWidget {
|
|||
final KeyVerificationEmoji emoji;
|
||||
final List<dynamic> sasEmoji;
|
||||
|
||||
_Emoji(this.emoji, this.sasEmoji);
|
||||
const _Emoji(this.emoji, this.sasEmoji);
|
||||
|
||||
String getLocalizedName() {
|
||||
if (sasEmoji == null) {
|
||||
|
|
@ -410,9 +413,9 @@ class _Emoji extends StatelessWidget {
|
|||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(emoji.emoji, style: TextStyle(fontSize: 50)),
|
||||
Text(emoji.emoji, style: const TextStyle(fontSize: 50)),
|
||||
Text(getLocalizedName()),
|
||||
Container(height: 10, width: 5),
|
||||
const SizedBox(height: 10, width: 5),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ import '../config/setting_keys.dart';
|
|||
import 'views/login_view.dart';
|
||||
|
||||
class Login extends StatefulWidget {
|
||||
const Login({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
LoginController createState() => LoginController();
|
||||
}
|
||||
|
|
@ -89,7 +91,7 @@ class LoginController extends State<Login> {
|
|||
void checkWellKnownWithCoolDown(String userId) async {
|
||||
_coolDown?.cancel();
|
||||
_coolDown = Timer(
|
||||
Duration(seconds: 1),
|
||||
const Duration(seconds: 1),
|
||||
() => _checkWellKnown(userId),
|
||||
);
|
||||
}
|
||||
|
|
@ -202,7 +204,7 @@ class LoginController extends State<Login> {
|
|||
okLabel: L10n.of(context).ok,
|
||||
cancelLabel: L10n.of(context).cancel,
|
||||
textFields: [
|
||||
DialogTextField(
|
||||
const DialogTextField(
|
||||
hintText: '******',
|
||||
obscureText: true,
|
||||
minLines: 1,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import 'package:flutter/material.dart';
|
|||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
class NewGroup extends StatefulWidget {
|
||||
const NewGroup({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
NewGroupController createState() => NewGroupController();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
class NewPrivateChat extends StatefulWidget {
|
||||
const NewPrivateChat({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
NewPrivateChatController createState() => NewPrivateChatController();
|
||||
}
|
||||
|
|
@ -54,7 +56,7 @@ class NewPrivateChatController extends State<NewPrivateChat> {
|
|||
context: context,
|
||||
useRootNavigator: false,
|
||||
//useSafeArea: false,
|
||||
builder: (_) => QrScannerModal(),
|
||||
builder: (_) => const QrScannerModal(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import 'package:matrix/matrix.dart';
|
|||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
class NewSpace extends StatefulWidget {
|
||||
const NewSpace({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
NewSpaceController createState() => NewSpaceController();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class _PermissionSliderDialogState extends State<PermissionSliderDialog> {
|
|||
: _permission >= 50
|
||||
? '$_permission (${L10n.of(context).moderator})'
|
||||
: _permission.toString())),
|
||||
Container(
|
||||
SizedBox(
|
||||
height: 56,
|
||||
child: slider,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class _QrScannerModalState extends State<QrScannerModal> {
|
|||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close_outlined),
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
tooltip: L10n.of(context).close,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ class _RecordingDialogState extends State<RecordingDialog> {
|
|||
setState(() => _duration = Duration.zero);
|
||||
_recorderSubscription?.cancel();
|
||||
_recorderSubscription =
|
||||
Timer.periodic(Duration(milliseconds: 100), (_) async {
|
||||
Timer.periodic(const Duration(milliseconds: 100), (_) async {
|
||||
_amplitude = await _audioRecorder.getAmplitude();
|
||||
setState(() {
|
||||
_duration += Duration(milliseconds: 100);
|
||||
_duration += const Duration(milliseconds: 100);
|
||||
});
|
||||
});
|
||||
} catch (e, s) {
|
||||
|
|
@ -92,7 +92,7 @@ class _RecordingDialogState extends State<RecordingDialog> {
|
|||
height: maxDecibalWidth,
|
||||
alignment: Alignment.center,
|
||||
child: AnimatedContainer(
|
||||
duration: Duration(milliseconds: 100),
|
||||
duration: const Duration(milliseconds: 100),
|
||||
width: decibalWidth,
|
||||
height: decibalWidth,
|
||||
decoration: BoxDecoration(
|
||||
|
|
@ -101,11 +101,11 @@ class _RecordingDialogState extends State<RecordingDialog> {
|
|||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${L10n.of(context).recording}: $time',
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
|
|
@ -163,8 +163,8 @@ class _RecordingDialogState extends State<RecordingDialog> {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(L10n.of(context).send.toUpperCase()),
|
||||
SizedBox(width: 4),
|
||||
Icon(Icons.send_outlined, size: 15),
|
||||
const SizedBox(width: 4),
|
||||
const Icon(Icons.send_outlined, size: 15),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class SearchController extends State<Search> {
|
|||
setState(() => null);
|
||||
_coolDown?.cancel();
|
||||
_coolDown = Timer(
|
||||
Duration(milliseconds: 500),
|
||||
const Duration(milliseconds: 500),
|
||||
() => setState(() {
|
||||
genericSearchTerm = query;
|
||||
publicRoomsResponse = null;
|
||||
|
|
|
|||
|
|
@ -57,12 +57,12 @@ class _SendLocationDialogState extends State<SendLocationDialog> {
|
|||
try {
|
||||
_position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.best,
|
||||
timeLimit: Duration(seconds: 30),
|
||||
timeLimit: const Duration(seconds: 30),
|
||||
);
|
||||
} on TimeoutException {
|
||||
_position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.medium,
|
||||
timeLimit: Duration(seconds: 30),
|
||||
timeLimit: const Duration(seconds: 30),
|
||||
);
|
||||
}
|
||||
setState(() => position = _position);
|
||||
|
|
@ -104,8 +104,8 @@ class _SendLocationDialogState extends State<SendLocationDialog> {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CupertinoActivityIndicator(),
|
||||
SizedBox(width: 12),
|
||||
const CupertinoActivityIndicator(),
|
||||
const SizedBox(width: 12),
|
||||
Text(L10n.of(context).obtainingLocation),
|
||||
],
|
||||
);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
|||
import '../widgets/matrix.dart';
|
||||
|
||||
class Settings extends StatefulWidget {
|
||||
const Settings({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
SettingsController createState() => SettingsController();
|
||||
}
|
||||
|
|
@ -117,7 +119,7 @@ class SettingsController extends State<Settings> {
|
|||
context: context,
|
||||
future: () async {
|
||||
// make sure the loading spinner shows before we test the keys
|
||||
await Future.delayed(Duration(milliseconds: 100));
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
var valid = false;
|
||||
try {
|
||||
await handle.unlock(recoveryKey: input.single);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import 'views/settings_3pid_view.dart';
|
|||
class Settings3Pid extends StatefulWidget {
|
||||
static int sendAttempt = 0;
|
||||
|
||||
const Settings3Pid({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Settings3PidController createState() => Settings3PidController();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class SettingsAccountController extends State<SettingsAccount> {
|
|||
okLabel: L10n.of(context).ok,
|
||||
cancelLabel: L10n.of(context).cancel,
|
||||
textFields: [
|
||||
DialogTextField(
|
||||
const DialogTextField(
|
||||
obscureText: true,
|
||||
hintText: '******',
|
||||
minLines: 1,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import '../widgets/matrix.dart';
|
|||
import '../utils/resize_image.dart';
|
||||
|
||||
class EmotesSettings extends StatefulWidget {
|
||||
EmotesSettings({Key key}) : super(key: key);
|
||||
const EmotesSettings({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
EmotesSettingsController createState() => EmotesSettingsController();
|
||||
|
|
@ -80,13 +80,13 @@ class EmotesSettingsController extends State<EmotesSettings> {
|
|||
final content = client.accountData['im.ponies.emote_rooms']?.content ??
|
||||
<String, dynamic>{};
|
||||
if (active) {
|
||||
if (!(content['rooms'] is Map)) {
|
||||
if (content['rooms'] is! Map) {
|
||||
content['rooms'] = <String, dynamic>{};
|
||||
}
|
||||
if (!(content['rooms'][room.id] is Map)) {
|
||||
if (content['rooms'][room.id] is! Map) {
|
||||
content['rooms'][room.id] = <String, dynamic>{};
|
||||
}
|
||||
if (!(content['rooms'][room.id][stateKey ?? ''] is Map)) {
|
||||
if (content['rooms'][room.id][stateKey ?? ''] is! Map) {
|
||||
content['rooms'][room.id][stateKey ?? ''] = <String, dynamic>{};
|
||||
}
|
||||
} else if (content['rooms'] is Map && content['rooms'][room.id] is Map) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import '../widgets/matrix.dart';
|
|||
class SettingsIgnoreList extends StatefulWidget {
|
||||
final String initialUserId;
|
||||
|
||||
SettingsIgnoreList({Key key, this.initialUserId}) : super(key: key);
|
||||
const SettingsIgnoreList({Key key, this.initialUserId}) : super(key: key);
|
||||
|
||||
@override
|
||||
SettingsIgnoreListController createState() => SettingsIgnoreListController();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import 'package:vrouter/vrouter.dart';
|
|||
import 'views/settings_multiple_emotes_view.dart';
|
||||
|
||||
class MultipleEmotesSettings extends StatefulWidget {
|
||||
MultipleEmotesSettings({Key key}) : super(key: key);
|
||||
const MultipleEmotesSettings({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
MultipleEmotesSettingsController createState() =>
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ class NotificationSettingsItem {
|
|||
}
|
||||
|
||||
class SettingsNotifications extends StatefulWidget {
|
||||
const SettingsNotifications({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
SettingsNotificationsController createState() =>
|
||||
SettingsNotificationsController();
|
||||
|
|
@ -57,7 +59,7 @@ class SettingsNotifications extends StatefulWidget {
|
|||
class SettingsNotificationsController extends State<SettingsNotifications> {
|
||||
void openAndroidNotificationSettingsAction() async {
|
||||
await NotificationSetting.configureChannel(
|
||||
NotificationDetails(
|
||||
const NotificationDetails(
|
||||
android: AndroidNotificationDetails(
|
||||
AppConfig.pushNotificationsChannelId,
|
||||
AppConfig.pushNotificationsChannelName,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class SettingsSecurityController extends State<SettingsSecurity> {
|
|||
|
||||
void setAppLockAction() async {
|
||||
final currentLock =
|
||||
await FlutterSecureStorage().read(key: SettingKeys.appLockKey);
|
||||
await const FlutterSecureStorage().read(key: SettingKeys.appLockKey);
|
||||
if (currentLock?.isNotEmpty ?? false) {
|
||||
await AppLock.of(context).showLockScreen();
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ class SettingsSecurityController extends State<SettingsSecurity> {
|
|||
],
|
||||
);
|
||||
if (newLock != null) {
|
||||
await FlutterSecureStorage()
|
||||
await const FlutterSecureStorage()
|
||||
.write(key: SettingKeys.appLockKey, value: newLock.single);
|
||||
if (newLock.single.isEmpty) {
|
||||
AppLock.of(context).disable();
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import 'views/settings_style_view.dart';
|
|||
import '../widgets/matrix.dart';
|
||||
|
||||
class SettingsStyle extends StatefulWidget {
|
||||
const SettingsStyle({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
SettingsStyleController createState() => SettingsStyleController();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
|||
final stickerPacks = widget.room.getImagePacks(ImagePackUsage.sticker);
|
||||
final packSlugs = stickerPacks.keys.toList();
|
||||
|
||||
// ignore: prefer_function_declarations_over_variables
|
||||
final _packBuilder = (BuildContext context, int packIndex) {
|
||||
final pack = stickerPacks[packSlugs[packIndex]];
|
||||
final filteredImagePackImageEntried = pack.images.entries.toList();
|
||||
|
|
@ -43,7 +44,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
|||
final packName = pack.pack.displayName ?? packSlugs[packIndex];
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
if (packIndex != 0) SizedBox(height: 20),
|
||||
if (packIndex != 0) const SizedBox(height: 20),
|
||||
if (packName != 'user')
|
||||
ListTile(
|
||||
leading: Avatar(
|
||||
|
|
@ -53,13 +54,13 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
|||
),
|
||||
title: Text(packName),
|
||||
),
|
||||
SizedBox(height: 6),
|
||||
const SizedBox(height: 6),
|
||||
GridView.builder(
|
||||
itemCount: imageKeys.length,
|
||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: 100),
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (BuildContext context, int imageIndex) {
|
||||
final image = pack.images[imageKeys[imageIndex]];
|
||||
final fakeEvent = Event.fromJson(<String, dynamic>{
|
||||
|
|
@ -99,7 +100,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
|||
};
|
||||
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
body: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: CustomScrollView(
|
||||
slivers: <Widget>[
|
||||
|
|
@ -110,13 +111,13 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
|||
titleSpacing: 0,
|
||||
backgroundColor: Theme.of(context).dialogBackgroundColor,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: Navigator.of(context, rootNavigator: false).pop,
|
||||
),
|
||||
title: DefaultAppBarSearchField(
|
||||
autofocus: false,
|
||||
hintText: L10n.of(context).search,
|
||||
suffix: Icon(Icons.search_outlined),
|
||||
suffix: const Icon(Icons.search_outlined),
|
||||
onChanged: (s) => setState(() => searchFilter = s),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class UserBottomSheet extends StatefulWidget {
|
|||
|
||||
class UserBottomSheetController extends State<UserBottomSheet> {
|
||||
void participantAction(String action) async {
|
||||
// ignore: prefer_function_declarations_over_variables
|
||||
final Function _askConfirmation =
|
||||
() async => (await showOkCancelAlertDialog(
|
||||
useRootNavigator: false,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class ArchiveView extends StatelessWidget {
|
|||
future: controller.getArchive(context),
|
||||
builder: (BuildContext context, snapshot) => Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).archive),
|
||||
actions: [
|
||||
if (snapshot.hasData &&
|
||||
|
|
@ -37,12 +37,12 @@ class ArchiveView extends StatelessWidget {
|
|||
));
|
||||
}
|
||||
if (!snapshot.hasData) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child: CircularProgressIndicator.adaptive(strokeWidth: 2));
|
||||
} else {
|
||||
controller.archive = snapshot.data;
|
||||
if (controller.archive.isEmpty) {
|
||||
return Center(child: Icon(Icons.archive_outlined, size: 80));
|
||||
return const Center(child: Icon(Icons.archive_outlined, size: 80));
|
||||
}
|
||||
return ListView.builder(
|
||||
itemCount: controller.archive.length,
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
(BuildContext context, bool innerBoxIsScrolled) => <Widget>[
|
||||
SliverAppBar(
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close_outlined),
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
onPressed: () =>
|
||||
VRouter.of(context).path.startsWith('/spaces/')
|
||||
? VRouter.of(context).pop()
|
||||
|
|
@ -66,7 +66,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
if (room.canonicalAlias?.isNotEmpty ?? false)
|
||||
IconButton(
|
||||
tooltip: L10n.of(context).share,
|
||||
icon: Icon(Icons.share_outlined),
|
||||
icon: const Icon(Icons.share_outlined),
|
||||
onPressed: () => FluffyShare.share(
|
||||
AppConfig.inviteLinkPrefix + room.canonicalAlias,
|
||||
context),
|
||||
|
|
@ -107,7 +107,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
.scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
radius: Avatar.defaultSize / 2,
|
||||
child: Icon(Icons.edit_outlined),
|
||||
child: const Icon(Icons.edit_outlined),
|
||||
)
|
||||
: null,
|
||||
title: Text(
|
||||
|
|
@ -121,7 +121,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
text: room.topic?.isEmpty ?? true
|
||||
? L10n.of(context).addGroupDescription
|
||||
: room.topic,
|
||||
linkStyle: TextStyle(color: Colors.blueAccent),
|
||||
linkStyle: const TextStyle(color: Colors.blueAccent),
|
||||
textStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context)
|
||||
|
|
@ -136,7 +136,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
? controller.setTopicAction
|
||||
: null,
|
||||
),
|
||||
Divider(thickness: 1),
|
||||
const Divider(thickness: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).settings,
|
||||
|
|
@ -153,7 +153,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.people_outlined),
|
||||
child: const Icon(Icons.people_outlined),
|
||||
),
|
||||
title: Text(
|
||||
L10n.of(context).changeTheNameOfTheGroup),
|
||||
|
|
@ -167,7 +167,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.link_outlined),
|
||||
child: const Icon(Icons.link_outlined),
|
||||
),
|
||||
onTap: controller.editAliases,
|
||||
title: Text(L10n.of(context).editRoomAliases),
|
||||
|
|
@ -181,7 +181,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.insert_emoticon_outlined),
|
||||
child: const Icon(Icons.insert_emoticon_outlined),
|
||||
),
|
||||
title: Text(L10n.of(context).emoteSettings),
|
||||
subtitle: Text(L10n.of(context).setCustomEmotes),
|
||||
|
|
@ -211,7 +211,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
backgroundColor: Theme.of(context)
|
||||
.scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.public_outlined)),
|
||||
child: const Icon(Icons.public_outlined)),
|
||||
title: Text(L10n.of(context)
|
||||
.whoIsAllowedToJoinThisGroup),
|
||||
subtitle: Text(
|
||||
|
|
@ -258,7 +258,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.visibility_outlined),
|
||||
child: const Icon(Icons.visibility_outlined),
|
||||
),
|
||||
title: Text(L10n.of(context)
|
||||
.visibilityOfTheChatHistory),
|
||||
|
|
@ -297,7 +297,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
backgroundColor: Theme.of(context)
|
||||
.scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.info_outline),
|
||||
child: const Icon(Icons.info_outline),
|
||||
),
|
||||
title: Text(
|
||||
L10n.of(context).areGuestsAllowedToJoin),
|
||||
|
|
@ -315,12 +315,12 @@ class ChatDetailsView extends StatelessWidget {
|
|||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.edit_attributes_outlined),
|
||||
child: const Icon(Icons.edit_attributes_outlined),
|
||||
),
|
||||
onTap: () =>
|
||||
VRouter.of(context).to('permissions'),
|
||||
),
|
||||
Divider(thickness: 1),
|
||||
const Divider(thickness: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
actualMembersCount > 1
|
||||
|
|
@ -342,7 +342,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
Theme.of(context).primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
radius: Avatar.defaultSize / 2,
|
||||
child: Icon(Icons.add_outlined),
|
||||
child: const Icon(Icons.add_outlined),
|
||||
),
|
||||
onTap: () =>
|
||||
VRouter.of(context).to('invite'),
|
||||
|
|
@ -361,7 +361,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
leading: CircleAvatar(
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.refresh,
|
||||
color: Colors.grey,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -21,19 +21,19 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close_outlined),
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
onPressed: () =>
|
||||
VRouter.of(context).toSegments(['rooms', controller.roomId]),
|
||||
),
|
||||
title: Text(L10n.of(context).tapOnDeviceToVerify),
|
||||
bottom: PreferredSize(
|
||||
preferredSize: Size.fromHeight(56),
|
||||
preferredSize: const Size.fromHeight(56),
|
||||
child: ListTile(
|
||||
title: Text(L10n.of(context).deviceVerifyDescription),
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Theme.of(context).secondaryHeaderColor,
|
||||
foregroundColor: Theme.of(context).colorScheme.secondary,
|
||||
child: Icon(Icons.lock),
|
||||
child: const Icon(Icons.lock),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -54,14 +54,14 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
if (!snapshot.hasData) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child:
|
||||
CircularProgressIndicator.adaptive(strokeWidth: 2));
|
||||
}
|
||||
final deviceKeys = snapshot.data;
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: deviceKeys.length,
|
||||
itemBuilder: (BuildContext context, int i) => Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
@ -69,7 +69,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
if (i == 0 ||
|
||||
deviceKeys[i].userId !=
|
||||
deviceKeys[i - 1].userId) ...{
|
||||
Divider(height: 1, thickness: 1),
|
||||
const Divider(height: 1, thickness: 1),
|
||||
PopupMenuButton(
|
||||
onSelected: (action) => controller.onSelected(
|
||||
context, action, deviceKeys[i]),
|
||||
|
|
@ -103,7 +103,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
),
|
||||
subtitle: Text(
|
||||
deviceKeys[i].userId,
|
||||
style: TextStyle(fontWeight: FontWeight.w300),
|
||||
style: const TextStyle(fontWeight: FontWeight.w300),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -152,9 +152,9 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
children: [
|
||||
Text(
|
||||
deviceKeys[i].deviceId,
|
||||
style: TextStyle(fontWeight: FontWeight.w300),
|
||||
style: const TextStyle(fontWeight: FontWeight.w300),
|
||||
),
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
Text(
|
||||
deviceKeys[i].blocked
|
||||
? L10n.of(context).blocked
|
||||
|
|
|
|||
|
|
@ -101,12 +101,12 @@ class ChatListView extends StatelessWidget {
|
|||
? null
|
||||
: Builder(
|
||||
builder: (context) => IconButton(
|
||||
icon: Icon(Icons.group_work_outlined),
|
||||
icon: const Icon(Icons.group_work_outlined),
|
||||
onPressed: Scaffold.of(context).openDrawer,
|
||||
))
|
||||
: IconButton(
|
||||
tooltip: L10n.of(context).cancel,
|
||||
icon: Icon(Icons.close_outlined),
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
onPressed: controller.cancelAction,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
|
|
@ -125,7 +125,7 @@ class ChatListView extends StatelessWidget {
|
|||
.isDirectChat)
|
||||
IconButton(
|
||||
tooltip: L10n.of(context).addToSpace,
|
||||
icon: Icon(Icons.group_work_outlined),
|
||||
icon: const Icon(Icons.group_work_outlined),
|
||||
onPressed: controller.addOrRemoveToSpace,
|
||||
),
|
||||
if (controller.selectedRoomIds.length == 1)
|
||||
|
|
@ -143,7 +143,7 @@ class ChatListView extends StatelessWidget {
|
|||
if (controller.selectedRoomIds.length == 1)
|
||||
IconButton(
|
||||
tooltip: L10n.of(context).toggleFavorite,
|
||||
icon: Icon(Icons.push_pin_outlined),
|
||||
icon: const Icon(Icons.push_pin_outlined),
|
||||
onPressed: controller.toggleFavouriteRoom,
|
||||
),
|
||||
if (controller.selectedRoomIds.length == 1)
|
||||
|
|
@ -160,14 +160,14 @@ class ChatListView extends StatelessWidget {
|
|||
onPressed: controller.toggleMuted,
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.delete_outlined),
|
||||
icon: const Icon(Icons.delete_outlined),
|
||||
tooltip: L10n.of(context).archive,
|
||||
onPressed: controller.archiveAction,
|
||||
),
|
||||
]
|
||||
: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.search_outlined),
|
||||
icon: const Icon(Icons.search_outlined),
|
||||
tooltip: L10n.of(context).search,
|
||||
onPressed: () =>
|
||||
VRouter.of(context).to('/search'),
|
||||
|
|
@ -180,8 +180,8 @@ class ChatListView extends StatelessWidget {
|
|||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.edit_outlined),
|
||||
SizedBox(width: 12),
|
||||
const Icon(Icons.edit_outlined),
|
||||
const SizedBox(width: 12),
|
||||
Text(L10n.of(context).setStatus),
|
||||
],
|
||||
),
|
||||
|
|
@ -191,8 +191,8 @@ class ChatListView extends StatelessWidget {
|
|||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.group_add_outlined),
|
||||
SizedBox(width: 12),
|
||||
const Icon(Icons.group_add_outlined),
|
||||
const SizedBox(width: 12),
|
||||
Text(L10n.of(context).createNewGroup),
|
||||
],
|
||||
),
|
||||
|
|
@ -202,8 +202,8 @@ class ChatListView extends StatelessWidget {
|
|||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.group_work_outlined),
|
||||
SizedBox(width: 12),
|
||||
const Icon(Icons.group_work_outlined),
|
||||
const SizedBox(width: 12),
|
||||
Text(L10n.of(context).createNewSpace),
|
||||
],
|
||||
),
|
||||
|
|
@ -213,8 +213,8 @@ class ChatListView extends StatelessWidget {
|
|||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.share_outlined),
|
||||
SizedBox(width: 12),
|
||||
const Icon(Icons.share_outlined),
|
||||
const SizedBox(width: 12),
|
||||
Text(L10n.of(context).inviteContact),
|
||||
],
|
||||
),
|
||||
|
|
@ -224,8 +224,8 @@ class ChatListView extends StatelessWidget {
|
|||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.archive_outlined),
|
||||
SizedBox(width: 12),
|
||||
const Icon(Icons.archive_outlined),
|
||||
const SizedBox(width: 12),
|
||||
Text(L10n.of(context).archive),
|
||||
],
|
||||
),
|
||||
|
|
@ -235,8 +235,8 @@ class ChatListView extends StatelessWidget {
|
|||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.settings_outlined),
|
||||
SizedBox(width: 12),
|
||||
const Icon(Icons.settings_outlined),
|
||||
const SizedBox(width: 12),
|
||||
Text(L10n.of(context).settings),
|
||||
],
|
||||
),
|
||||
|
|
@ -256,7 +256,7 @@ class ChatListView extends StatelessWidget {
|
|||
.displayname),
|
||||
),
|
||||
body: Column(children: [
|
||||
ConnectionStatusHeader(),
|
||||
const ConnectionStatusHeader(),
|
||||
Expanded(child: _ChatListViewBody(controller)),
|
||||
]),
|
||||
floatingActionButton: selectMode == SelectMode.normal
|
||||
|
|
@ -265,14 +265,14 @@ class ChatListView extends StatelessWidget {
|
|||
heroTag: 'main_fab',
|
||||
onPressed: () =>
|
||||
VRouter.of(context).to('/newprivatechat'),
|
||||
icon: Icon(CupertinoIcons.chat_bubble),
|
||||
icon: const Icon(CupertinoIcons.chat_bubble),
|
||||
label: Text(L10n.of(context).newChat),
|
||||
)
|
||||
: FloatingActionButton(
|
||||
heroTag: 'main_fab',
|
||||
onPressed: () =>
|
||||
VRouter.of(context).to('/newprivatechat'),
|
||||
child: Icon(CupertinoIcons.chat_bubble),
|
||||
child: const Icon(CupertinoIcons.chat_bubble),
|
||||
)
|
||||
: null,
|
||||
bottomNavigationBar: Matrix.of(context).isMultiAccount
|
||||
|
|
@ -291,7 +291,7 @@ class ChatListView extends StatelessWidget {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
Builder(builder: (context) {
|
||||
final items = getBottomBarItems(context);
|
||||
if (items.length == 1) {
|
||||
|
|
@ -378,7 +378,7 @@ class ChatListView extends StatelessWidget {
|
|||
backgroundColor:
|
||||
Theme.of(context).primaryColor,
|
||||
radius: Avatar.defaultSize / 2,
|
||||
child: Icon(Icons.home_outlined),
|
||||
child: const Icon(Icons.home_outlined),
|
||||
),
|
||||
title: Text(L10n.of(context).allChats),
|
||||
onTap: () =>
|
||||
|
|
@ -399,7 +399,7 @@ class ChatListView extends StatelessWidget {
|
|||
onTap: () => controller.setActiveSpaceId(
|
||||
context, space.id),
|
||||
trailing: IconButton(
|
||||
icon: Icon(Icons.edit_outlined),
|
||||
icon: const Icon(Icons.edit_outlined),
|
||||
onPressed: () =>
|
||||
controller.editSpace(context, space.id),
|
||||
),
|
||||
|
|
@ -425,7 +425,7 @@ class _ChatListViewBody extends StatelessWidget {
|
|||
.onSync
|
||||
.stream
|
||||
.where((s) => s.hasRoomUpdate)
|
||||
.rateLimit(Duration(seconds: 1)),
|
||||
.rateLimit(const Duration(seconds: 1)),
|
||||
builder: (context, snapshot) {
|
||||
return FutureBuilder<void>(
|
||||
future: controller.waitForFirstSync(),
|
||||
|
|
@ -441,7 +441,7 @@ class _ChatListViewBody extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
const Icon(
|
||||
Icons.maps_ugc_outlined,
|
||||
size: 80,
|
||||
color: Colors.grey,
|
||||
|
|
@ -450,7 +450,7 @@ class _ChatListViewBody extends StatelessWidget {
|
|||
child: Text(
|
||||
L10n.of(context).startYourFirstChat,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 16,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
|||
leading: VRouter.of(context).path.startsWith('/spaces/')
|
||||
? null
|
||||
: IconButton(
|
||||
icon: Icon(Icons.close_outlined),
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
onPressed: () => VRouter.of(context)
|
||||
.toSegments(['rooms', controller.roomId]),
|
||||
),
|
||||
|
|
@ -37,10 +37,10 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
|||
final powerLevelsContent = Map<String, dynamic>.from(
|
||||
room.getState(EventTypes.RoomPowerLevels).content);
|
||||
final powerLevels = Map<String, dynamic>.from(powerLevelsContent)
|
||||
..removeWhere((k, v) => !(v is int));
|
||||
..removeWhere((k, v) => v is! int);
|
||||
final eventsPowerLevels =
|
||||
Map<String, dynamic>.from(powerLevelsContent['events'] ?? {})
|
||||
..removeWhere((k, v) => !(v is int));
|
||||
..removeWhere((k, v) => v is! int);
|
||||
return Column(
|
||||
children: [
|
||||
Column(
|
||||
|
|
@ -53,7 +53,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
|||
onTap: () => controller.editPowerLevel(
|
||||
context, entry.key, entry.value),
|
||||
),
|
||||
Divider(thickness: 1),
|
||||
const Divider(thickness: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).notifications,
|
||||
|
|
@ -64,7 +64,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
Builder(builder: (context) {
|
||||
final key = 'rooms';
|
||||
const key = 'rooms';
|
||||
final int value = powerLevelsContent
|
||||
.containsKey('notifications')
|
||||
? powerLevelsContent['notifications']['rooms'] ?? 0
|
||||
|
|
@ -78,7 +78,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
|||
category: 'notifications'),
|
||||
);
|
||||
}),
|
||||
Divider(thickness: 1),
|
||||
const Divider(thickness: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).configureChat,
|
||||
|
|
@ -99,12 +99,12 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
|||
category: 'events'),
|
||||
),
|
||||
if (room.canSendEvent(EventTypes.RoomTombstone)) ...{
|
||||
Divider(thickness: 1),
|
||||
const Divider(thickness: 1),
|
||||
FutureBuilder<Capabilities>(
|
||||
future: room.client.getCapabilities(),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child: CircularProgressIndicator.adaptive(
|
||||
strokeWidth: 2));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class ChatView extends StatelessWidget {
|
|||
},
|
||||
child: StreamBuilder(
|
||||
stream: controller.room.onUpdate.stream
|
||||
.rateLimit(Duration(milliseconds: 250)),
|
||||
.rateLimit(const Duration(milliseconds: 250)),
|
||||
builder: (context, snapshot) => Scaffold(
|
||||
appBar: AppBar(
|
||||
actionsIconTheme: IconThemeData(
|
||||
|
|
@ -76,7 +76,7 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
leading: controller.selectMode
|
||||
? IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: controller.clearSelectedEvents,
|
||||
tooltip: L10n.of(context).close,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
|
|
@ -117,7 +117,7 @@ class ChatView extends StatelessWidget {
|
|||
.where((p) =>
|
||||
p.senderId ==
|
||||
controller.room.directChatMatrixID)
|
||||
.rateLimit(Duration(seconds: 1)),
|
||||
.rateLimit(const Duration(seconds: 1)),
|
||||
builder: (context, snapshot) => Text(
|
||||
controller.room.getLocalizedStatus(context),
|
||||
maxLines: 1,
|
||||
|
|
@ -129,7 +129,7 @@ class ChatView extends StatelessWidget {
|
|||
color:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
size: 13),
|
||||
SizedBox(width: 4),
|
||||
const SizedBox(width: 4),
|
||||
Expanded(
|
||||
child: Text(
|
||||
controller.room
|
||||
|
|
@ -150,24 +150,24 @@ class ChatView extends StatelessWidget {
|
|||
? <Widget>[
|
||||
if (controller.canEditSelectedEvents)
|
||||
IconButton(
|
||||
icon: Icon(Icons.edit_outlined),
|
||||
icon: const Icon(Icons.edit_outlined),
|
||||
tooltip: L10n.of(context).edit,
|
||||
onPressed: controller.editSelectedEventAction,
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.copy_outlined),
|
||||
icon: const Icon(Icons.copy_outlined),
|
||||
tooltip: L10n.of(context).copy,
|
||||
onPressed: controller.copyEventsAction,
|
||||
),
|
||||
if (controller.selectedEvents.length == 1)
|
||||
IconButton(
|
||||
icon: Icon(Icons.report_outlined),
|
||||
icon: const Icon(Icons.report_outlined),
|
||||
tooltip: L10n.of(context).reportMessage,
|
||||
onPressed: controller.reportEventAction,
|
||||
),
|
||||
if (controller.canRedactSelectedEvents)
|
||||
IconButton(
|
||||
icon: Icon(Icons.delete_outlined),
|
||||
icon: const Icon(Icons.delete_outlined),
|
||||
tooltip: L10n.of(context).redactMessage,
|
||||
onPressed: controller.redactEventsAction,
|
||||
),
|
||||
|
|
@ -176,7 +176,7 @@ class ChatView extends StatelessWidget {
|
|||
if (controller.room.canSendDefaultStates)
|
||||
IconButton(
|
||||
tooltip: L10n.of(context).videoCall,
|
||||
icon: Icon(Icons.video_call_outlined),
|
||||
icon: const Icon(Icons.video_call_outlined),
|
||||
onPressed: controller.startCallAction,
|
||||
),
|
||||
ChatSettingsPopupMenu(
|
||||
|
|
@ -211,7 +211,7 @@ class ChatView extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
if (controller.room.getState(EventTypes.RoomTombstone) !=
|
||||
null)
|
||||
Container(
|
||||
SizedBox(
|
||||
height: 72,
|
||||
child: Material(
|
||||
color: Theme.of(context).secondaryHeaderColor,
|
||||
|
|
@ -222,7 +222,7 @@ class ChatView extends StatelessWidget {
|
|||
Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor:
|
||||
Theme.of(context).backgroundColor,
|
||||
child: Icon(Icons.upgrade_outlined),
|
||||
child: const Icon(Icons.upgrade_outlined),
|
||||
),
|
||||
title: Text(
|
||||
controller.room
|
||||
|
|
@ -242,7 +242,7 @@ class ChatView extends StatelessWidget {
|
|||
future: controller.getTimeline(),
|
||||
builder: (BuildContext context, snapshot) {
|
||||
if (controller.timeline == null) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child: CircularProgressIndicator.adaptive(
|
||||
strokeWidth: 2),
|
||||
);
|
||||
|
|
@ -266,7 +266,7 @@ class ChatView extends StatelessWidget {
|
|||
);
|
||||
|
||||
return ListView.custom(
|
||||
padding: EdgeInsets.only(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 16,
|
||||
bottom: 4,
|
||||
),
|
||||
|
|
@ -279,7 +279,7 @@ class ChatView extends StatelessWidget {
|
|||
(BuildContext context, int i) {
|
||||
return i == controller.filteredEvents.length + 1
|
||||
? controller.timeline.isRequestingHistory
|
||||
? Center(
|
||||
? const Center(
|
||||
child: CircularProgressIndicator
|
||||
.adaptive(strokeWidth: 2),
|
||||
)
|
||||
|
|
@ -303,8 +303,8 @@ class ChatView extends StatelessWidget {
|
|||
? AnimatedContainer(
|
||||
height: seenByText.isEmpty ? 0 : 24,
|
||||
duration: seenByText.isEmpty
|
||||
? Duration(milliseconds: 0)
|
||||
: Duration(milliseconds: 300),
|
||||
? const Duration(milliseconds: 0)
|
||||
: const Duration(milliseconds: 300),
|
||||
alignment: controller.filteredEvents
|
||||
.isNotEmpty &&
|
||||
controller.filteredEvents
|
||||
|
|
@ -312,13 +312,13 @@ class ChatView extends StatelessWidget {
|
|||
client.userID
|
||||
? Alignment.topRight
|
||||
: Alignment.topLeft,
|
||||
padding: EdgeInsets.only(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 8,
|
||||
right: 8,
|
||||
bottom: 8,
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
|
|
@ -349,7 +349,7 @@ class ChatView extends StatelessWidget {
|
|||
key: ValueKey(controller
|
||||
.filteredEvents[i - 1]
|
||||
.eventId),
|
||||
background: Padding(
|
||||
background: const Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.0),
|
||||
child: Center(
|
||||
|
|
@ -409,10 +409,10 @@ class ChatView extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
),
|
||||
ConnectionStatusHeader(),
|
||||
const ConnectionStatusHeader(),
|
||||
if (!controller.showEmojiPicker)
|
||||
AnimatedContainer(
|
||||
duration: Duration(milliseconds: 300),
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: (controller.editEvent == null &&
|
||||
controller.replyEvent == null &&
|
||||
controller.room.canSendDefaultMessages &&
|
||||
|
|
@ -437,12 +437,12 @@ class ChatView extends StatelessWidget {
|
|||
event.room.client.userID &&
|
||||
event.type == 'm.reaction');
|
||||
|
||||
allReactionEvents.forEach((event) {
|
||||
for (final event in allReactionEvents) {
|
||||
try {
|
||||
emojis.remove(
|
||||
event.content['m.relates_to']['key']);
|
||||
} catch (_) {}
|
||||
});
|
||||
}
|
||||
return ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: emojis.length + 1,
|
||||
|
|
@ -455,7 +455,7 @@ class ChatView extends StatelessWidget {
|
|||
width: 56,
|
||||
height: 56,
|
||||
alignment: Alignment.center,
|
||||
child: Icon(Icons.add_outlined),
|
||||
child: const Icon(Icons.add_outlined),
|
||||
),
|
||||
)
|
||||
: InkWell(
|
||||
|
|
@ -468,7 +468,7 @@ class ChatView extends StatelessWidget {
|
|||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
emojis[i],
|
||||
style: TextStyle(fontSize: 30),
|
||||
style: const TextStyle(fontSize: 30),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -477,7 +477,7 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: Duration(milliseconds: 300),
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: controller.editEvent != null ||
|
||||
controller.replyEvent != null
|
||||
? 56
|
||||
|
|
@ -488,7 +488,7 @@ class ChatView extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
IconButton(
|
||||
tooltip: L10n.of(context).close,
|
||||
icon: Icon(Icons.close),
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: controller.cancelReplyEventAction,
|
||||
),
|
||||
Expanded(
|
||||
|
|
@ -502,7 +502,7 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
if (controller.room.canSendDefaultMessages &&
|
||||
controller.room.membership == Membership.join &&
|
||||
!controller.showEmojiPicker)
|
||||
|
|
@ -515,13 +515,13 @@ class ChatView extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: controller.selectMode
|
||||
? <Widget>[
|
||||
Container(
|
||||
SizedBox(
|
||||
height: 56,
|
||||
child: TextButton(
|
||||
onPressed: controller.forwardEventsAction,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(Icons
|
||||
const Icon(Icons
|
||||
.keyboard_arrow_left_outlined),
|
||||
Text(L10n.of(context).forward),
|
||||
],
|
||||
|
|
@ -534,7 +534,7 @@ class ChatView extends StatelessWidget {
|
|||
controller.timeline)
|
||||
.status >
|
||||
0
|
||||
? Container(
|
||||
? SizedBox(
|
||||
height: 56,
|
||||
child: TextButton(
|
||||
onPressed:
|
||||
|
|
@ -543,13 +543,13 @@ class ChatView extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Text(
|
||||
L10n.of(context).reply),
|
||||
Icon(Icons
|
||||
const Icon(Icons
|
||||
.keyboard_arrow_right),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
: SizedBox(
|
||||
height: 56,
|
||||
child: TextButton(
|
||||
onPressed:
|
||||
|
|
@ -558,8 +558,8 @@ class ChatView extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Text(L10n.of(context)
|
||||
.tryToSendAgain),
|
||||
SizedBox(width: 4),
|
||||
Icon(Icons.send_outlined,
|
||||
const SizedBox(width: 4),
|
||||
const Icon(Icons.send_outlined,
|
||||
size: 16),
|
||||
],
|
||||
),
|
||||
|
|
@ -569,15 +569,15 @@ class ChatView extends StatelessWidget {
|
|||
]
|
||||
: <Widget>[
|
||||
AnimatedContainer(
|
||||
duration: Duration(milliseconds: 200),
|
||||
duration: const Duration(milliseconds: 200),
|
||||
height: 56,
|
||||
width:
|
||||
controller.inputText.isEmpty ? 56 : 0,
|
||||
alignment: Alignment.center,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(),
|
||||
decoration: const BoxDecoration(),
|
||||
child: PopupMenuButton<String>(
|
||||
icon: Icon(Icons.add_outlined),
|
||||
icon: const Icon(Icons.add_outlined),
|
||||
onSelected: controller
|
||||
.onAddPopupMenuButtonSelected,
|
||||
itemBuilder: (BuildContext context) =>
|
||||
|
|
@ -585,7 +585,7 @@ class ChatView extends StatelessWidget {
|
|||
PopupMenuItem<String>(
|
||||
value: 'file',
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
leading: const CircleAvatar(
|
||||
backgroundColor: Colors.green,
|
||||
foregroundColor: Colors.white,
|
||||
child: Icon(
|
||||
|
|
@ -593,27 +593,27 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
title:
|
||||
Text(L10n.of(context).sendFile),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
contentPadding: const EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
PopupMenuItem<String>(
|
||||
value: 'image',
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
leading: const CircleAvatar(
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
child: Icon(Icons.image_outlined),
|
||||
),
|
||||
title: Text(
|
||||
L10n.of(context).sendImage),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
contentPadding: const EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
if (PlatformInfos.isMobile)
|
||||
PopupMenuItem<String>(
|
||||
value: 'camera',
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
leading: const CircleAvatar(
|
||||
backgroundColor: Colors.purple,
|
||||
foregroundColor: Colors.white,
|
||||
child: Icon(
|
||||
|
|
@ -621,7 +621,7 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
title: Text(
|
||||
L10n.of(context).openCamera),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
contentPadding: const EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
if (controller.room
|
||||
|
|
@ -631,7 +631,7 @@ class ChatView extends StatelessWidget {
|
|||
PopupMenuItem<String>(
|
||||
value: 'sticker',
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
leading: const CircleAvatar(
|
||||
backgroundColor: Colors.orange,
|
||||
foregroundColor: Colors.white,
|
||||
child: Icon(Icons
|
||||
|
|
@ -639,14 +639,14 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
title: Text(
|
||||
L10n.of(context).sendSticker),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
contentPadding: const EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
if (PlatformInfos.isMobile)
|
||||
PopupMenuItem<String>(
|
||||
value: 'voice',
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
leading: const CircleAvatar(
|
||||
backgroundColor: Colors.red,
|
||||
foregroundColor: Colors.white,
|
||||
child: Icon(
|
||||
|
|
@ -654,14 +654,14 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
title: Text(L10n.of(context)
|
||||
.voiceMessage),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
contentPadding: const EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
if (PlatformInfos.isMobile)
|
||||
PopupMenuItem<String>(
|
||||
value: 'location',
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
leading: const CircleAvatar(
|
||||
backgroundColor: Colors.brown,
|
||||
foregroundColor: Colors.white,
|
||||
child: Icon(
|
||||
|
|
@ -669,7 +669,7 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
title: Text(L10n.of(context)
|
||||
.shareLocation),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
contentPadding: const EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
@ -725,7 +725,7 @@ class ChatView extends StatelessWidget {
|
|||
alignment: Alignment.center,
|
||||
child: IconButton(
|
||||
tooltip: L10n.of(context).voiceMessage,
|
||||
icon: Icon(Icons.mic_none_outlined),
|
||||
icon: const Icon(Icons.mic_none_outlined),
|
||||
onPressed:
|
||||
controller.voiceMessageAction,
|
||||
),
|
||||
|
|
@ -736,7 +736,7 @@ class ChatView extends StatelessWidget {
|
|||
height: 56,
|
||||
alignment: Alignment.center,
|
||||
child: IconButton(
|
||||
icon: Icon(Icons.send_outlined),
|
||||
icon: const Icon(Icons.send_outlined),
|
||||
onPressed: controller.send,
|
||||
tooltip: L10n.of(context).send,
|
||||
),
|
||||
|
|
@ -745,7 +745,7 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: Duration(milliseconds: 300),
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: controller.showEmojiPicker
|
||||
? MediaQuery.of(context).size.height / 2
|
||||
: 0,
|
||||
|
|
@ -770,7 +770,7 @@ class ChatView extends StatelessWidget {
|
|||
class _EditContent extends StatelessWidget {
|
||||
final Event event;
|
||||
|
||||
_EditContent(this.event);
|
||||
const _EditContent(this.event);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -840,7 +840,7 @@ class _ChatAccountPicker extends StatelessWidget {
|
|||
),
|
||||
title:
|
||||
Text(snapshot.data?.displayName ?? client.userID),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
contentPadding: const EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
))
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class DevicesSettingsView extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).devices),
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
|
|
@ -26,14 +26,14 @@ class DevicesSettingsView extends StatelessWidget {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Icon(Icons.error_outlined),
|
||||
const Icon(Icons.error_outlined),
|
||||
Text(snapshot.error.toString()),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
if (!snapshot.hasData || controller.devices == null) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child: CircularProgressIndicator.adaptive(strokeWidth: 2));
|
||||
}
|
||||
return Column(
|
||||
|
|
@ -47,23 +47,23 @@ class DevicesSettingsView extends StatelessWidget {
|
|||
block: controller.blockDeviceAction,
|
||||
unblock: controller.unblockDeviceAction,
|
||||
),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
if (controller.notThisDevice.isNotEmpty)
|
||||
ListTile(
|
||||
title: Text(
|
||||
controller.errorDeletingDevices ??
|
||||
L10n.of(context).removeAllOtherDevices,
|
||||
style: TextStyle(color: Colors.red),
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
trailing: controller.loadingDeletingDevices
|
||||
? CircularProgressIndicator.adaptive(strokeWidth: 2)
|
||||
: Icon(Icons.delete_outline),
|
||||
? const CircularProgressIndicator.adaptive(strokeWidth: 2)
|
||||
: const Icon(Icons.delete_outline),
|
||||
onTap: controller.loadingDeletingDevices
|
||||
? null
|
||||
: () => controller
|
||||
.removeDevicesAction(controller.notThisDevice),
|
||||
),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
Expanded(
|
||||
child: controller.notThisDevice.isEmpty
|
||||
? Center(
|
||||
|
|
@ -75,7 +75,7 @@ class DevicesSettingsView extends StatelessWidget {
|
|||
)
|
||||
: ListView.separated(
|
||||
separatorBuilder: (BuildContext context, int i) =>
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
itemCount: controller.notThisDevice.length,
|
||||
itemBuilder: (BuildContext context, int i) =>
|
||||
UserDeviceListItem(
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class EmptyPage extends StatelessWidget {
|
|||
Center(
|
||||
child: SizedBox(
|
||||
width: _width,
|
||||
child: LinearProgressIndicator(),
|
||||
child: const LinearProgressIndicator(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
prefixText: 'https://',
|
||||
hintText: L10n.of(context).enterYourHomeserver,
|
||||
searchController: controller.homeserverController,
|
||||
suffix: Icon(Icons.edit_outlined),
|
||||
suffix: const Icon(Icons.edit_outlined),
|
||||
padding: EdgeInsets.zero,
|
||||
onChanged: controller.setDomain,
|
||||
readOnly: !AppConfig.allowOtherHomeservers,
|
||||
|
|
@ -44,12 +44,12 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
elevation: 0,
|
||||
),
|
||||
body: ListView(children: [
|
||||
Hero(
|
||||
const Hero(
|
||||
tag: 'loginBanner',
|
||||
child: FluffyBanner(),
|
||||
),
|
||||
controller.isLoading
|
||||
? Center(
|
||||
? const Center(
|
||||
child: CircularProgressIndicator.adaptive(strokeWidth: 2))
|
||||
: controller.error != null
|
||||
? Center(
|
||||
|
|
@ -77,7 +77,7 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
if (!snapshot.hasData) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child: CircularProgressIndicator.adaptive(
|
||||
strokeWidth: 2));
|
||||
}
|
||||
|
|
@ -98,7 +98,7 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
onPressed: () => controller
|
||||
.ssoLoginAction(identityProvider.id),
|
||||
icon: identityProvider.icon == null
|
||||
? Icon(Icons.web_outlined)
|
||||
? const Icon(Icons.web_outlined)
|
||||
: CachedNetworkImage(
|
||||
imageUrl: Uri.parse(
|
||||
identityProvider.icon)
|
||||
|
|
@ -118,12 +118,12 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
if (controller.registrationSupported ||
|
||||
controller.passwordLoginSupported)
|
||||
Row(children: [
|
||||
Expanded(child: Divider()),
|
||||
const Expanded(child: Divider()),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Text(L10n.of(context).or),
|
||||
),
|
||||
Expanded(child: Divider()),
|
||||
const Expanded(child: Divider()),
|
||||
]),
|
||||
},
|
||||
Row(
|
||||
|
|
@ -133,13 +133,13 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
child: _LoginButton(
|
||||
onPressed: () =>
|
||||
VRouter.of(context).to('login'),
|
||||
icon: Icon(Icons.login_outlined),
|
||||
icon: const Icon(Icons.login_outlined),
|
||||
labelText: L10n.of(context).login,
|
||||
),
|
||||
),
|
||||
if (controller.registrationSupported &&
|
||||
controller.passwordLoginSupported)
|
||||
SizedBox(width: 12),
|
||||
const SizedBox(width: 12),
|
||||
if (controller.registrationSupported &&
|
||||
// Registration is broken on matrix.org
|
||||
Matrix.of(context)
|
||||
|
|
@ -150,7 +150,8 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
Expanded(
|
||||
child: _LoginButton(
|
||||
onPressed: controller.signUpAction,
|
||||
icon: Icon(Icons.add_box_outlined),
|
||||
icon:
|
||||
const Icon(Icons.add_box_outlined),
|
||||
labelText: L10n.of(context).register,
|
||||
),
|
||||
),
|
||||
|
|
@ -160,7 +161,8 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
.map(
|
||||
(widget) => Container(
|
||||
height: 64,
|
||||
padding: EdgeInsets.only(bottom: 12),
|
||||
padding:
|
||||
const EdgeInsets.only(bottom: 12),
|
||||
child: widget),
|
||||
)
|
||||
.toList(),
|
||||
|
|
@ -174,7 +176,7 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
onPressed: () => launch(AppConfig.privacyUrl),
|
||||
child: Text(
|
||||
L10n.of(context).privacy,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
color: Colors.blueGrey,
|
||||
),
|
||||
|
|
@ -184,7 +186,7 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
onPressed: () => PlatformInfos.showDialog(context),
|
||||
child: Text(
|
||||
L10n.of(context).about,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
color: Colors.blueGrey,
|
||||
),
|
||||
|
|
@ -213,7 +215,7 @@ class _LoginButton extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return OutlinedButton.icon(
|
||||
style: OutlinedButton.styleFrom(
|
||||
minimumSize: Size(256, 56),
|
||||
minimumSize: const Size(256, 56),
|
||||
side: BorderSide(
|
||||
color: Theme.of(context).textTheme.bodyText1.color,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -16,21 +16,21 @@ class ImageViewerView extends StatelessWidget {
|
|||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
color: Colors.white,
|
||||
tooltip: L10n.of(context).close,
|
||||
),
|
||||
backgroundColor: Color(0x44000000),
|
||||
backgroundColor: const Color(0x44000000),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.reply_outlined),
|
||||
icon: const Icon(Icons.reply_outlined),
|
||||
onPressed: controller.forwardAction,
|
||||
color: Colors.white,
|
||||
tooltip: L10n.of(context).share,
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.download_outlined),
|
||||
icon: const Icon(Icons.download_outlined),
|
||||
onPressed: controller.saveFileAction,
|
||||
color: Colors.white,
|
||||
tooltip: L10n.of(context).downloadFile,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class InvitationSelectionView extends StatelessWidget {
|
|||
leading: VRouter.of(context).path.startsWith('/spaces/')
|
||||
? null
|
||||
: IconButton(
|
||||
icon: Icon(Icons.close_outlined),
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
onPressed: () => VRouter.of(context)
|
||||
.toSegments(['rooms', controller.roomId]),
|
||||
),
|
||||
|
|
@ -39,7 +39,7 @@ class InvitationSelectionView extends StatelessWidget {
|
|||
withScrolling: true,
|
||||
child: controller.foundProfiles.isNotEmpty
|
||||
? ListView.builder(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: controller.foundProfiles.length,
|
||||
itemBuilder: (BuildContext context, int i) => ListTile(
|
||||
|
|
@ -61,13 +61,13 @@ class InvitationSelectionView extends StatelessWidget {
|
|||
future: controller.getContacts(context),
|
||||
builder: (BuildContext context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child: CircularProgressIndicator.adaptive(strokeWidth: 2),
|
||||
);
|
||||
}
|
||||
final contacts = snapshot.data;
|
||||
return ListView.builder(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: contacts.length,
|
||||
itemBuilder: (BuildContext context, int i) => ListTile(
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class LoginView extends StatelessWidget {
|
|||
return OnePageCard(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: controller.loading ? Container() : BackButton(),
|
||||
leading: controller.loading ? Container() : const BackButton(),
|
||||
elevation: 0,
|
||||
title: Text(
|
||||
L10n.of(context).logInTo(Matrix.of(context)
|
||||
|
|
@ -40,7 +40,7 @@ class LoginView extends StatelessWidget {
|
|||
autofillHints:
|
||||
controller.loading ? null : [AutofillHints.username],
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Icon(Icons.account_box_outlined),
|
||||
prefixIcon: const Icon(Icons.account_box_outlined),
|
||||
hintText: L10n.of(context).username,
|
||||
errorText: controller.usernameError,
|
||||
labelText: L10n.of(context).username),
|
||||
|
|
@ -57,7 +57,7 @@ class LoginView extends StatelessWidget {
|
|||
obscureText: !controller.showPassword,
|
||||
onSubmitted: controller.login,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Icon(Icons.lock_outlined),
|
||||
prefixIcon: const Icon(Icons.lock_outlined),
|
||||
hintText: '****',
|
||||
errorText: controller.passwordError,
|
||||
suffixIcon: IconButton(
|
||||
|
|
@ -71,17 +71,17 @@ class LoginView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
Hero(
|
||||
tag: 'loginButton',
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: ElevatedButton(
|
||||
onPressed: controller.loading
|
||||
? null
|
||||
: () => controller.login(context),
|
||||
child: controller.loading
|
||||
? LinearProgressIndicator()
|
||||
? const LinearProgressIndicator()
|
||||
: Text(L10n.of(context).login),
|
||||
),
|
||||
),
|
||||
|
|
@ -91,7 +91,7 @@ class LoginView extends StatelessWidget {
|
|||
onPressed: controller.passwordForgotten,
|
||||
child: Text(
|
||||
L10n.of(context).passwordForgotten,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Colors.blue,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class NewGroupView extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).createNewGroup),
|
||||
elevation: 0,
|
||||
),
|
||||
|
|
@ -30,7 +30,7 @@ class NewGroupView extends StatelessWidget {
|
|||
onSubmitted: controller.submitAction,
|
||||
decoration: InputDecoration(
|
||||
labelText: L10n.of(context).optionalGroupName,
|
||||
prefixIcon: Icon(Icons.people_outlined),
|
||||
prefixIcon: const Icon(Icons.people_outlined),
|
||||
hintText: L10n.of(context).enterAGroupName),
|
||||
),
|
||||
),
|
||||
|
|
@ -47,7 +47,7 @@ class NewGroupView extends StatelessWidget {
|
|||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: controller.submitAction,
|
||||
child: Icon(Icons.arrow_forward_outlined),
|
||||
child: const Icon(Icons.arrow_forward_outlined),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).newChat),
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
elevation: 0,
|
||||
|
|
@ -39,9 +39,9 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
child: ListView(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(_qrCodePadding),
|
||||
margin: const EdgeInsets.all(_qrCodePadding),
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.all(_qrCodePadding * 2),
|
||||
padding: const EdgeInsets.all(_qrCodePadding * 2),
|
||||
child: InkWell(
|
||||
onTap: controller.inviteAction,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
|
|
@ -54,25 +54,25 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
'https://matrix.to/#/${Matrix.of(context).client.userID}',
|
||||
version: QrVersions.auto,
|
||||
size: min(MediaQuery.of(context).size.width - 16, 200),
|
||||
embeddedImage: AssetImage('assets/share.png'),
|
||||
embeddedImage: const AssetImage('assets/share.png'),
|
||||
embeddedImageStyle: QrEmbeddedImageStyle(
|
||||
size: Size(48, 48),
|
||||
size: const Size(48, 48),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(),
|
||||
const Divider(),
|
||||
ListTile(
|
||||
subtitle: Text(L10n.of(context).createNewChatExplaination),
|
||||
trailing: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
trailing: const Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Icon(Icons.info_outline_rounded),
|
||||
),
|
||||
),
|
||||
Divider(),
|
||||
const Divider(),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
child: TextFormField(
|
||||
|
|
@ -86,7 +86,7 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
hintText: '@username',
|
||||
prefixText: 'https://matrix.to/#/',
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(Icons.send_outlined),
|
||||
icon: const Icon(Icons.send_outlined),
|
||||
onPressed: controller.submitAction,
|
||||
),
|
||||
),
|
||||
|
|
@ -107,7 +107,7 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
? FloatingActionButton.extended(
|
||||
onPressed: controller.openScannerAction,
|
||||
label: Text(L10n.of(context).scanQrCode),
|
||||
icon: Icon(Icons.camera_alt_outlined),
|
||||
icon: const Icon(Icons.camera_alt_outlined),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class NewSpaceView extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).createNewSpace),
|
||||
elevation: 0,
|
||||
),
|
||||
|
|
@ -31,7 +31,7 @@ class NewSpaceView extends StatelessWidget {
|
|||
onSubmitted: controller.submitAction,
|
||||
decoration: InputDecoration(
|
||||
labelText: L10n.of(context).spaceName,
|
||||
prefixIcon: Icon(Icons.people_outlined),
|
||||
prefixIcon: const Icon(Icons.people_outlined),
|
||||
hintText: L10n.of(context).enterASpacepName),
|
||||
),
|
||||
),
|
||||
|
|
@ -48,7 +48,7 @@ class NewSpaceView extends StatelessWidget {
|
|||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: controller.submitAction,
|
||||
child: Icon(Icons.arrow_forward_outlined),
|
||||
child: const Icon(Icons.arrow_forward_outlined),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,21 +69,21 @@ class SearchView extends StatelessWidget {
|
|||
controller.controller.text?.startsWith('#') ?? false ? 0 : 1,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
titleSpacing: 0,
|
||||
title: DefaultAppBarSearchField(
|
||||
autofocus: true,
|
||||
hintText: L10n.of(context).search,
|
||||
searchController: controller.controller,
|
||||
suffix: Icon(Icons.search_outlined),
|
||||
suffix: const Icon(Icons.search_outlined),
|
||||
onChanged: controller.search,
|
||||
),
|
||||
bottom: TabBar(
|
||||
indicatorColor: Theme.of(context).colorScheme.secondary,
|
||||
labelColor: Theme.of(context).colorScheme.secondary,
|
||||
unselectedLabelColor: Theme.of(context).textTheme.bodyText1.color,
|
||||
labelStyle: TextStyle(fontSize: 16),
|
||||
labelPadding: EdgeInsets.symmetric(
|
||||
labelStyle: const TextStyle(fontSize: 16),
|
||||
labelPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 0,
|
||||
),
|
||||
|
|
@ -101,12 +101,12 @@ class SearchView extends StatelessWidget {
|
|||
? ScrollViewKeyboardDismissBehavior.onDrag
|
||||
: ScrollViewKeyboardDismissBehavior.manual,
|
||||
children: [
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
foregroundColor: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor: Theme.of(context).secondaryHeaderColor,
|
||||
child: Icon(Icons.edit_outlined),
|
||||
child: const Icon(Icons.edit_outlined),
|
||||
),
|
||||
title: Text(L10n.of(context).changeTheServer),
|
||||
onTap: controller.setServer,
|
||||
|
|
@ -119,8 +119,8 @@ class SearchView extends StatelessWidget {
|
|||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(height: 32),
|
||||
Icon(
|
||||
const SizedBox(height: 32),
|
||||
const Icon(
|
||||
Icons.error_outlined,
|
||||
size: 80,
|
||||
color: Colors.grey,
|
||||
|
|
@ -129,7 +129,7 @@ class SearchView extends StatelessWidget {
|
|||
child: Text(
|
||||
snapshot.error.toLocalizedString(context),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 16,
|
||||
),
|
||||
|
|
@ -139,7 +139,7 @@ class SearchView extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
if (snapshot.connectionState != ConnectionState.done) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child: CircularProgressIndicator.adaptive(
|
||||
strokeWidth: 2));
|
||||
}
|
||||
|
|
@ -148,8 +148,8 @@ class SearchView extends StatelessWidget {
|
|||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(height: 32),
|
||||
Icon(
|
||||
const SizedBox(height: 32),
|
||||
const Icon(
|
||||
Icons.search_outlined,
|
||||
size: 80,
|
||||
color: Colors.grey,
|
||||
|
|
@ -158,7 +158,7 @@ class SearchView extends StatelessWidget {
|
|||
child: Text(
|
||||
L10n.of(context).noPublicRoomsFound,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 16,
|
||||
),
|
||||
|
|
@ -169,9 +169,9 @@ class SearchView extends StatelessWidget {
|
|||
}
|
||||
return GridView.builder(
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.all(12),
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
padding: const EdgeInsets.all(12),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
childAspectRatio: 1,
|
||||
crossAxisSpacing: 16,
|
||||
|
|
@ -195,7 +195,7 @@ class SearchView extends StatelessWidget {
|
|||
publicRoomsResponse.chunk[i].name),
|
||||
Text(
|
||||
publicRoomsResponse.chunk[i].name,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
|
@ -207,7 +207,7 @@ class SearchView extends StatelessWidget {
|
|||
publicRoomsResponse
|
||||
.chunk[i].numJoinedMembers ??
|
||||
0),
|
||||
style: TextStyle(fontSize: 10.5),
|
||||
style: const TextStyle(fontSize: 10.5),
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
|
|
@ -262,13 +262,13 @@ class SearchView extends StatelessWidget {
|
|||
title: Text(
|
||||
foundProfile.displayName ??
|
||||
foundProfile.userId.localpart,
|
||||
style: TextStyle(),
|
||||
style: const TextStyle(),
|
||||
maxLines: 1,
|
||||
),
|
||||
subtitle: Text(
|
||||
foundProfile.userId,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ class Settings3PidView extends StatelessWidget {
|
|||
controller.request ??= Matrix.of(context).client.getAccount3PIDs();
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).passwordRecovery),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.add_outlined),
|
||||
icon: const Icon(Icons.add_outlined),
|
||||
onPressed: controller.add3PidAction,
|
||||
tooltip: L10n.of(context).addEmail,
|
||||
)
|
||||
|
|
@ -39,7 +39,7 @@ class Settings3PidView extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
if (!snapshot.hasData) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child: CircularProgressIndicator.adaptive(strokeWidth: 2));
|
||||
}
|
||||
final identifier = snapshot.data;
|
||||
|
|
@ -63,7 +63,7 @@ class Settings3PidView extends StatelessWidget {
|
|||
.withTheseAddressesRecoveryDescription,
|
||||
),
|
||||
),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: identifier.length,
|
||||
|
|
@ -76,7 +76,7 @@ class Settings3PidView extends StatelessWidget {
|
|||
title: Text(identifier[i].address),
|
||||
trailing: IconButton(
|
||||
tooltip: L10n.of(context).delete,
|
||||
icon: Icon(Icons.delete_forever_outlined),
|
||||
icon: const Icon(Icons.delete_forever_outlined),
|
||||
color: Colors.red,
|
||||
onPressed: () => controller.delete3Pid(identifier[i]),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -22,51 +22,51 @@ class SettingsAccountView extends StatelessWidget {
|
|||
child: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
trailing: Icon(Icons.add_box_outlined),
|
||||
trailing: const Icon(Icons.add_box_outlined),
|
||||
title: Text(L10n.of(context).addAccount),
|
||||
subtitle: Text(L10n.of(context).enableMultiAccounts),
|
||||
onTap: controller.addAccountAction,
|
||||
),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(L10n.of(context).yourUserId),
|
||||
subtitle: Text(Matrix.of(context).client.userID),
|
||||
trailing: Icon(Icons.copy_outlined),
|
||||
trailing: const Icon(Icons.copy_outlined),
|
||||
onTap: () => FluffyShare.share(
|
||||
Matrix.of(context).client.userID,
|
||||
context,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
trailing: Icon(Icons.edit_outlined),
|
||||
trailing: const Icon(Icons.edit_outlined),
|
||||
title: Text(L10n.of(context).editDisplayname),
|
||||
subtitle: Text(controller.profile?.displayName ??
|
||||
Matrix.of(context).client.userID.localpart),
|
||||
onTap: controller.setDisplaynameAction,
|
||||
),
|
||||
ListTile(
|
||||
trailing: Icon(Icons.phone_outlined),
|
||||
trailing: const Icon(Icons.phone_outlined),
|
||||
title: Text(L10n.of(context).editJitsiInstance),
|
||||
subtitle: Text(AppConfig.jitsiInstance),
|
||||
onTap: controller.setJitsiInstanceAction,
|
||||
),
|
||||
ListTile(
|
||||
trailing: Icon(Icons.devices_other_outlined),
|
||||
trailing: const Icon(Icons.devices_other_outlined),
|
||||
title: Text(L10n.of(context).devices),
|
||||
onTap: () => VRouter.of(context).to('devices'),
|
||||
),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
trailing: Icon(Icons.exit_to_app_outlined),
|
||||
trailing: const Icon(Icons.exit_to_app_outlined),
|
||||
title: Text(L10n.of(context).logout),
|
||||
onTap: controller.logoutAction,
|
||||
),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
trailing: Icon(Icons.delete_forever_outlined),
|
||||
trailing: const Icon(Icons.delete_forever_outlined),
|
||||
title: Text(
|
||||
L10n.of(context).deleteAccount,
|
||||
style: TextStyle(color: Colors.red),
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
onTap: controller.deleteAccountAction,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -24,14 +24,14 @@ class SettingsChatView extends StatelessWidget {
|
|||
ListTile(
|
||||
title: Text(L10n.of(context).changeTheme),
|
||||
onTap: () => VRouter.of(context).to('style'),
|
||||
trailing: Icon(Icons.style_outlined),
|
||||
trailing: const Icon(Icons.style_outlined),
|
||||
),
|
||||
ListTile(
|
||||
title: Text(L10n.of(context).emoteSettings),
|
||||
onTap: () => VRouter.of(context).to('emotes'),
|
||||
trailing: Icon(Icons.insert_emoticon_outlined),
|
||||
trailing: const Icon(Icons.insert_emoticon_outlined),
|
||||
),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
SettingsSwitchListTile(
|
||||
title: L10n.of(context).renderRichContent,
|
||||
onChanged: (b) => AppConfig.renderHtml = b,
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@ class EmotesSettingsView extends StatelessWidget {
|
|||
final imageKeys = controller.pack.images.keys.toList();
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).emoteSettings),
|
||||
),
|
||||
floatingActionButton: controller.showSave
|
||||
? FloatingActionButton(
|
||||
onPressed: controller.saveAction,
|
||||
child: Icon(Icons.save_outlined, color: Colors.white),
|
||||
child: const Icon(Icons.save_outlined, color: Colors.white),
|
||||
)
|
||||
: null,
|
||||
body: MaxWidthBody(
|
||||
|
|
@ -34,16 +34,16 @@ class EmotesSettingsView extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
if (!controller.readonly)
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 8.0,
|
||||
),
|
||||
child: ListTile(
|
||||
leading: Container(
|
||||
width: 180.0,
|
||||
height: 38,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||
color: Theme.of(context).secondaryHeaderColor,
|
||||
),
|
||||
child: TextField(
|
||||
|
|
@ -73,7 +73,7 @@ class EmotesSettingsView extends StatelessWidget {
|
|||
),
|
||||
trailing: InkWell(
|
||||
onTap: controller.addImageAction,
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.add_outlined,
|
||||
color: Colors.green,
|
||||
size: 32.0,
|
||||
|
|
@ -99,10 +99,10 @@ class EmotesSettingsView extends StatelessWidget {
|
|||
child: imageKeys.isEmpty
|
||||
? Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Text(
|
||||
L10n.of(context).noEmotesFound,
|
||||
style: TextStyle(fontSize: 20),
|
||||
style: const TextStyle(fontSize: 20),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
@ -124,10 +124,10 @@ class EmotesSettingsView extends StatelessWidget {
|
|||
leading: Container(
|
||||
width: 180.0,
|
||||
height: 38,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(10)),
|
||||
const BorderRadius.all(Radius.circular(10)),
|
||||
color: Theme.of(context).secondaryHeaderColor,
|
||||
),
|
||||
child: Shortcuts(
|
||||
|
|
@ -193,7 +193,7 @@ class EmotesSettingsView extends StatelessWidget {
|
|||
: InkWell(
|
||||
onTap: () =>
|
||||
controller.removeImageAction(imageCode),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.delete_forever_outlined,
|
||||
color: Colors.red,
|
||||
size: 32.0,
|
||||
|
|
@ -212,11 +212,11 @@ class EmotesSettingsView extends StatelessWidget {
|
|||
|
||||
class _EmoteImage extends StatelessWidget {
|
||||
final Uri mxc;
|
||||
_EmoteImage(this.mxc);
|
||||
const _EmoteImage(this.mxc);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final size = 38.0;
|
||||
const size = 38.0;
|
||||
final devicePixelRatio = MediaQuery.of(context).devicePixelRatio;
|
||||
final url = mxc?.getThumbnail(
|
||||
Matrix.of(context).client,
|
||||
|
|
@ -238,7 +238,7 @@ class _ImagePicker extends StatefulWidget {
|
|||
|
||||
final void Function(ValueNotifier<ImagePackImageContent>) onPressed;
|
||||
|
||||
_ImagePicker({@required this.controller, @required this.onPressed});
|
||||
const _ImagePicker({@required this.controller, @required this.onPressed});
|
||||
|
||||
@override
|
||||
_ImagePickerState createState() => _ImagePickerState();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class SettingsIgnoreListView extends StatelessWidget {
|
|||
final client = Matrix.of(context).client;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).ignoredUsers),
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
|
|
@ -35,26 +35,26 @@ class SettingsIgnoreListView extends StatelessWidget {
|
|||
textInputAction: TextInputAction.done,
|
||||
onSubmitted: (_) => controller.ignoreUser(context),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
border: const OutlineInputBorder(),
|
||||
hintText: 'bad_guy:domain.abc',
|
||||
prefixText: '@',
|
||||
labelText: L10n.of(context).ignoreUsername,
|
||||
suffixIcon: IconButton(
|
||||
tooltip: L10n.of(context).ignore,
|
||||
icon: Icon(Icons.done_outlined),
|
||||
icon: const Icon(Icons.done_outlined),
|
||||
onPressed: () => controller.ignoreUser(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
L10n.of(context).ignoreListDescription,
|
||||
style: TextStyle(color: Colors.orange),
|
||||
style: const TextStyle(color: Colors.orange),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
Expanded(
|
||||
child: StreamBuilder<Object>(
|
||||
stream: client.onAccountData.stream
|
||||
|
|
@ -74,7 +74,7 @@ class SettingsIgnoreListView extends StatelessWidget {
|
|||
s.data?.displayName ?? client.ignoredUsers[i]),
|
||||
trailing: IconButton(
|
||||
tooltip: L10n.of(context).delete,
|
||||
icon: Icon(Icons.delete_forever_outlined),
|
||||
icon: const Icon(Icons.delete_forever_outlined),
|
||||
onPressed: () => showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () =>
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@ import 'package:vrouter/vrouter.dart';
|
|||
class MultipleEmotesSettingsView extends StatelessWidget {
|
||||
final MultipleEmotesSettingsController controller;
|
||||
|
||||
MultipleEmotesSettingsView(this.controller, {Key key}) : super(key: key);
|
||||
const MultipleEmotesSettingsView(this.controller, {Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final room = Matrix.of(context).client.getRoomById(controller.roomId);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).emotePacks),
|
||||
),
|
||||
body: StreamBuilder(
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).notifications),
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
|
|
@ -56,11 +56,11 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.edit_outlined),
|
||||
child: const Icon(Icons.edit_outlined),
|
||||
),
|
||||
onTap: controller.openAndroidNotificationSettingsAction,
|
||||
),
|
||||
Divider(thickness: 1),
|
||||
const Divider(thickness: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).pushRules,
|
||||
|
|
@ -78,7 +78,7 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
controller.setNotificationSetting(item, enabled),
|
||||
),
|
||||
},
|
||||
Divider(thickness: 1),
|
||||
const Divider(thickness: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).devices,
|
||||
|
|
@ -99,13 +99,13 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
if (snapshot.connectionState != ConnectionState.done) {
|
||||
Center(
|
||||
const Center(
|
||||
child: CircularProgressIndicator.adaptive(
|
||||
strokeWidth: 2));
|
||||
}
|
||||
final pushers = snapshot.data ?? [];
|
||||
return ListView.builder(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: pushers.length,
|
||||
itemBuilder: (_, i) => ListTile(
|
||||
|
|
|
|||
|
|
@ -22,27 +22,27 @@ class SettingsSecurityView extends StatelessWidget {
|
|||
child: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
trailing: Icon(Icons.block_outlined),
|
||||
trailing: const Icon(Icons.block_outlined),
|
||||
title: Text(L10n.of(context).ignoredUsers),
|
||||
onTap: () => VRouter.of(context).to('ignorelist'),
|
||||
),
|
||||
ListTile(
|
||||
trailing: Icon(Icons.security_outlined),
|
||||
trailing: const Icon(Icons.security_outlined),
|
||||
title: Text(
|
||||
L10n.of(context).changePassword,
|
||||
),
|
||||
onTap: controller.changePasswordAccountAction,
|
||||
),
|
||||
ListTile(
|
||||
trailing: Icon(Icons.email_outlined),
|
||||
trailing: const Icon(Icons.email_outlined),
|
||||
title: Text(L10n.of(context).passwordRecovery),
|
||||
onTap: () => VRouter.of(context).to('3pid'),
|
||||
),
|
||||
if (Matrix.of(context).client.encryption != null) ...{
|
||||
Divider(thickness: 1),
|
||||
const Divider(thickness: 1),
|
||||
if (PlatformInfos.isMobile)
|
||||
ListTile(
|
||||
trailing: Icon(Icons.lock_outlined),
|
||||
trailing: const Icon(Icons.lock_outlined),
|
||||
title: Text(L10n.of(context).appLock),
|
||||
onTap: controller.setAppLockAction,
|
||||
),
|
||||
|
|
@ -55,11 +55,11 @@ class SettingsSecurityView extends StatelessWidget {
|
|||
message: Matrix.of(context).client.fingerprintKey.beautified,
|
||||
okLabel: L10n.of(context).ok,
|
||||
),
|
||||
trailing: Icon(Icons.vpn_key_outlined),
|
||||
trailing: const Icon(Icons.vpn_key_outlined),
|
||||
),
|
||||
ListTile(
|
||||
title: Text(L10n.of(context).cachedKeys),
|
||||
trailing: Icon(Icons.wb_cloudy_outlined),
|
||||
trailing: const Icon(Icons.wb_cloudy_outlined),
|
||||
subtitle: Text(
|
||||
'${Matrix.of(context).client.encryption.keyManager.enabled ? L10n.of(context).onlineKeyBackupEnabled : L10n.of(context).onlineKeyBackupDisabled}\n${Matrix.of(context).client.encryption.crossSigning.enabled ? L10n.of(context).crossSigningEnabled : L10n.of(context).crossSigningDisabled}'),
|
||||
onTap: controller.bootstrapSettingsAction,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
controller.currentTheme ??= AdaptiveTheme.of(context).mode;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
leading: const BackButton(),
|
||||
title: Text(L10n.of(context).changeTheme),
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
|
|
@ -42,7 +42,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
title: Text(L10n.of(context).darkTheme),
|
||||
onChanged: controller.switchTheme,
|
||||
),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).wallpaper,
|
||||
|
|
@ -59,7 +59,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
height: 38,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
trailing: Icon(
|
||||
trailing: const Icon(
|
||||
Icons.delete_forever_outlined,
|
||||
color: Colors.red,
|
||||
),
|
||||
|
|
@ -68,11 +68,11 @@ class SettingsStyleView extends StatelessWidget {
|
|||
Builder(builder: (context) {
|
||||
return ListTile(
|
||||
title: Text(L10n.of(context).changeWallpaper),
|
||||
trailing: Icon(Icons.wallpaper_outlined),
|
||||
trailing: const Icon(Icons.wallpaper_outlined),
|
||||
onTap: controller.setWallpaperAction,
|
||||
);
|
||||
}),
|
||||
Divider(height: 1),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).fontSize,
|
||||
|
|
|
|||
|
|
@ -38,38 +38,38 @@ class SettingsView extends StatelessWidget {
|
|||
body: ListView(
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
leading: Icon(Icons.notifications_outlined),
|
||||
leading: const Icon(Icons.notifications_outlined),
|
||||
title: Text(L10n.of(context).notifications),
|
||||
onTap: () => VRouter.of(context).to('/settings/notifications'),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.chat_bubble_outline),
|
||||
leading: const Icon(Icons.chat_bubble_outline),
|
||||
title: Text(L10n.of(context).chat),
|
||||
onTap: () => VRouter.of(context).to('/settings/chat'),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.account_box_outlined),
|
||||
leading: const Icon(Icons.account_box_outlined),
|
||||
title: Text(L10n.of(context).account),
|
||||
onTap: () => VRouter.of(context).to('/settings/account'),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.security_outlined),
|
||||
leading: const Icon(Icons.security_outlined),
|
||||
title: Text(L10n.of(context).security),
|
||||
onTap: () => VRouter.of(context).to('/settings/security'),
|
||||
),
|
||||
Divider(thickness: 1),
|
||||
const Divider(thickness: 1),
|
||||
ListTile(
|
||||
leading: Icon(Icons.help_outlined),
|
||||
leading: const Icon(Icons.help_outlined),
|
||||
title: Text(L10n.of(context).help),
|
||||
onTap: () => launch(AppConfig.supportUrl),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.privacy_tip_outlined),
|
||||
leading: const Icon(Icons.privacy_tip_outlined),
|
||||
title: Text(L10n.of(context).privacy),
|
||||
onTap: () => launch(AppConfig.privacyUrl),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.link_outlined),
|
||||
leading: const Icon(Icons.link_outlined),
|
||||
title: Text(L10n.of(context).about),
|
||||
onTap: () => PlatformInfos.showDialog(context),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class SignupPageView extends StatelessWidget {
|
|||
autofillHints:
|
||||
controller.loading ? null : [AutofillHints.username],
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Icon(Icons.account_box_outlined),
|
||||
prefixIcon: const Icon(Icons.account_box_outlined),
|
||||
hintText: L10n.of(context).username,
|
||||
errorText: controller.usernameError,
|
||||
labelText: L10n.of(context).username,
|
||||
|
|
@ -41,7 +41,7 @@ class SignupPageView extends StatelessWidget {
|
|||
':${Matrix.of(context).getLoginClient().homeserver.host}'),
|
||||
),
|
||||
),
|
||||
Divider(),
|
||||
const Divider(),
|
||||
ListTile(
|
||||
title: Text(L10n.of(context).chooseAStrongPassword),
|
||||
subtitle: Text(L10n.of(context).newPasswordDescription),
|
||||
|
|
@ -57,7 +57,7 @@ class SignupPageView extends StatelessWidget {
|
|||
obscureText: !controller.showPassword,
|
||||
onSubmitted: controller.signup,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Icon(Icons.lock_outlined),
|
||||
prefixIcon: const Icon(Icons.lock_outlined),
|
||||
hintText: '****',
|
||||
errorText: controller.passwordError,
|
||||
suffixIcon: IconButton(
|
||||
|
|
@ -71,16 +71,16 @@ class SignupPageView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
Divider(),
|
||||
SizedBox(height: 12),
|
||||
const Divider(),
|
||||
const SizedBox(height: 12),
|
||||
Hero(
|
||||
tag: 'loginButton',
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: ElevatedButton(
|
||||
onPressed: controller.loading ? null : controller.signup,
|
||||
child: controller.loading
|
||||
? LinearProgressIndicator()
|
||||
? const LinearProgressIndicator()
|
||||
: Text(L10n.of(context).signUp),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class UserBottomSheetView extends StatelessWidget {
|
|||
final client = Matrix.of(context).client;
|
||||
final presence = client.presences[user.id];
|
||||
return Center(
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: min(
|
||||
MediaQuery.of(context).size.width, FluffyThemes.columnWidth * 1.5),
|
||||
child: Material(
|
||||
|
|
@ -34,7 +34,7 @@ class UserBottomSheetView extends StatelessWidget {
|
|||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor.withOpacity(0.5),
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_downward_outlined),
|
||||
icon: const Icon(Icons.arrow_downward_outlined),
|
||||
onPressed: Navigator.of(context, rootNavigator: false).pop,
|
||||
tooltip: L10n.of(context).close,
|
||||
),
|
||||
|
|
@ -109,7 +109,7 @@ class UserBottomSheetView extends StatelessWidget {
|
|||
ListTile(
|
||||
title: Text(L10n.of(context).username),
|
||||
subtitle: Text(user.id),
|
||||
trailing: Icon(Icons.share_outlined),
|
||||
trailing: const Icon(Icons.share_outlined),
|
||||
onTap: () => FluffyShare.share(
|
||||
user.id, controller.widget.outerContext),
|
||||
),
|
||||
|
|
@ -149,7 +149,7 @@ class _TextWithIcon extends StatelessWidget {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(iconData),
|
||||
SizedBox(width: 16),
|
||||
const SizedBox(width: 16),
|
||||
Text(text),
|
||||
],
|
||||
);
|
||||
|
|
|
|||
|
|
@ -16,21 +16,21 @@ class VideoViewerView extends StatelessWidget {
|
|||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
color: Colors.white,
|
||||
tooltip: L10n.of(context).close,
|
||||
),
|
||||
backgroundColor: Color(0x44000000),
|
||||
backgroundColor: const Color(0x44000000),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.reply_outlined),
|
||||
icon: const Icon(Icons.reply_outlined),
|
||||
onPressed: controller.forwardAction,
|
||||
color: Colors.white,
|
||||
tooltip: L10n.of(context).share,
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.download_outlined),
|
||||
icon: const Icon(Icons.download_outlined),
|
||||
onPressed: controller.saveFileAction,
|
||||
color: Colors.white,
|
||||
tooltip: L10n.of(context).downloadFile,
|
||||
|
|
@ -41,7 +41,7 @@ class VideoViewerView extends StatelessWidget {
|
|||
child: controller.error != null
|
||||
? Text(controller.error.toString())
|
||||
: (controller.chewieController == null
|
||||
? CircularProgressIndicator.adaptive(strokeWidth: 2)
|
||||
? const CircularProgressIndicator.adaptive(strokeWidth: 2)
|
||||
: Chewie(
|
||||
controller: controller.chewieController,
|
||||
)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue