Browse Source

add quality.sh and run

lightFixes
Dan Ballard 2 months ago
parent
commit
03fd76c598
  1. 1
      lib/models/messages/textmessage.dart
  2. 32
      lib/widgets/messagelist.dart
  3. 8
      lib/widgets/messagerow.dart
  4. 3
      lib/widgets/quotedmessage.dart
  5. 3
      quality.sh

1
lib/models/messages/textmessage.dart

@ -6,7 +6,6 @@ import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
import '../../model.dart';
import '../../settings.dart';
class TextMessage extends Message {
final MessageMetadata metadata;

32
lib/widgets/messagelist.dart

@ -39,22 +39,22 @@ class _MessageListState extends State<MessageList> {
Visibility(
visible: showMessageWarning,
child: Container(
padding: EdgeInsets.all(5.0),
color: Provider.of<Settings>(context).theme.defaultButtonActiveColor(),
child: DefaultTextStyle(
style: TextStyle(color: Provider.of<Settings>(context).theme.defaultButtonTextColor()),
child: showSyncing
? Text(AppLocalizations.of(context)!.serverNotSynced, textAlign: TextAlign.center)
: showOfflineWarning
? Text(Provider.of<ContactInfoState>(context).isGroup ? AppLocalizations.of(context)!.serverConnectivityDisconnected : AppLocalizations.of(context)!.peerOfflineMessage,
textAlign: TextAlign.center)
// Only show the ephemeral status for peer conversations, not for groups...
: (showEphemeralWarning
? Text(AppLocalizations.of(context)!.chatHistoryDefault, textAlign: TextAlign.center)
:
// We are not allowed to put null here, so put an empty text widge
Text("")),
))),
padding: EdgeInsets.all(5.0),
color: Provider.of<Settings>(context).theme.defaultButtonActiveColor(),
child: DefaultTextStyle(
style: TextStyle(color: Provider.of<Settings>(context).theme.defaultButtonTextColor()),
child: showSyncing
? Text(AppLocalizations.of(context)!.serverNotSynced, textAlign: TextAlign.center)
: showOfflineWarning
? Text(Provider.of<ContactInfoState>(context).isGroup ? AppLocalizations.of(context)!.serverConnectivityDisconnected : AppLocalizations.of(context)!.peerOfflineMessage,
textAlign: TextAlign.center)
// Only show the ephemeral status for peer conversations, not for groups...
: (showEphemeralWarning
? Text(AppLocalizations.of(context)!.chatHistoryDefault, textAlign: TextAlign.center)
:
// We are not allowed to put null here, so put an empty text widge
Text("")),
))),
Expanded(
child: Scrollbar(
controller: ctrlr1,

8
lib/widgets/messagerow.dart

@ -146,9 +146,11 @@ class MessageRowState extends State<MessageRow> {
child: GestureDetector(
// Swipe to quote on Android
onHorizontalDragEnd: Platform.isAndroid ? (details) {
Provider.of<AppState>(context, listen: false).selectedIndex = Provider.of<MessageMetadata>(context, listen: false).messageIndex;
} : null,
onHorizontalDragEnd: Platform.isAndroid
? (details) {
Provider.of<AppState>(context, listen: false).selectedIndex = Provider.of<MessageMetadata>(context, listen: false).messageIndex;
}
: null,
child: Padding(padding: EdgeInsets.all(2), child: Row(mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start, children: widgetRow))));
}

3
lib/widgets/quotedmessage.dart

@ -54,7 +54,6 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
textWidthBasis: TextWidthBasis.longestLine,
);
var wdgQuote = FutureBuilder(
future: widget.quotedMessage,
builder: (context, snapshot) {
@ -69,7 +68,7 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
color: fromMe ? Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor() : Provider.of<Settings>(context).theme.messageFromMeBackgroundColor(),
child: Wrap(runAlignment: WrapAlignment.spaceEvenly, alignment: WrapAlignment.spaceEvenly, runSpacing: 1.0, crossAxisAlignment: WrapCrossAlignment.center, children: [
Center(widthFactor: 1, child: Padding(padding: EdgeInsets.all(10.0), child: Icon(Icons.reply, size: 32, color: qTextColor))),
Center(widthFactor: 1.0, child: DefaultTextStyle( child: qMessage.getPreviewWidget(context), style: TextStyle( color: qTextColor)))
Center(widthFactor: 1.0, child: DefaultTextStyle(child: qMessage.getPreviewWidget(context), style: TextStyle(color: qTextColor)))
]));
} catch (e) {
print(e);

3
quality.sh

@ -0,0 +1,3 @@
#!/bin/sh
flutter format -l 200 lib
Loading…
Cancel
Save