fluffychat merge
This commit is contained in:
commit
5db8527ba5
33 changed files with 190 additions and 169 deletions
21
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
vendored
Normal file
21
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
*Thank you so much for your contribution to FluffyChat ❤️❤️❤️*
|
||||
|
||||
Please make sure that your Pull Request meet the following **acceptance criteria**:
|
||||
|
||||
- [ ] Code formatting and import sorting has been done with `dart format lib/ test/` and `dart run import_sorter:main --no-comments`
|
||||
- [ ] The commit message uses the format of [Conventional Commits](https://www.conventionalcommits.org)
|
||||
- [ ] The commit message describes what has been changed, why it has been changed and how it has been changed
|
||||
- [ ] Every new feature or change of the design/GUI is linked to an approved design proposal in an issue
|
||||
- [ ] Every new feature in the app or the build system has a strategy how this will be tested and maintained from now on for every release, e.g. a volunteer who takes over maintainership
|
||||
|
||||
|
||||
### Pull Request has been tested on:
|
||||
|
||||
- [ ] Android
|
||||
- [ ] iOS
|
||||
- [ ] Browser (Chromium based)
|
||||
- [ ] Browser (Firefox based)
|
||||
- [ ] Browser (WebKit based)
|
||||
- [ ] Desktop Linux
|
||||
- [ ] Desktop Windows
|
||||
- [ ] Desktop macOS
|
||||
1
.github/workflows/integrate.yaml
vendored
1
.github/workflows/integrate.yaml
vendored
|
|
@ -15,6 +15,7 @@ jobs:
|
|||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
cache: true
|
||||
- run: flutter pub get
|
||||
- run: flutter gen-l10n
|
||||
- name: Check formatting
|
||||
run: dart format lib/ test/ --set-exit-if-changed
|
||||
- name: Check import formatting
|
||||
|
|
|
|||
2
.github/workflows/versions.env
vendored
2
.github/workflows/versions.env
vendored
|
|
@ -1,2 +1,2 @@
|
|||
FLUTTER_VERSION=3.19.6
|
||||
FLUTTER_VERSION=3.22.1
|
||||
JAVA_VERSION=17
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ abstract class FluffyThemes {
|
|||
),
|
||||
),
|
||||
textSelectionTheme: TextSelectionThemeData(
|
||||
selectionColor: colorScheme.onBackground.withAlpha(128),
|
||||
selectionColor: colorScheme.onSurface.withAlpha(128),
|
||||
selectionHandleColor: colorScheme.secondary,
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
|
|
@ -107,13 +107,15 @@ abstract class FluffyThemes {
|
|||
? Colors.grey.withAlpha(64)
|
||||
: null,
|
||||
surfaceTintColor:
|
||||
FluffyThemes.isColumnMode(context) ? colorScheme.background : null,
|
||||
FluffyThemes.isColumnMode(context) ? colorScheme.surface : null,
|
||||
backgroundColor:
|
||||
FluffyThemes.isColumnMode(context) ? colorScheme.surface : null,
|
||||
systemOverlayStyle: SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: brightness.reversed,
|
||||
statusBarBrightness: brightness,
|
||||
systemNavigationBarIconBrightness: brightness.reversed,
|
||||
systemNavigationBarColor: colorScheme.background,
|
||||
systemNavigationBarColor: colorScheme.surface,
|
||||
),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
|
|
|
|||
|
|
@ -58,11 +58,11 @@ class ChatEmojiPicker extends StatelessWidget {
|
|||
),
|
||||
skinToneConfig: SkinToneConfig(
|
||||
dialogBackgroundColor: Color.lerp(
|
||||
theme.colorScheme.background,
|
||||
theme.colorScheme.surface,
|
||||
theme.colorScheme.primaryContainer,
|
||||
0.75,
|
||||
)!,
|
||||
indicatorColor: theme.colorScheme.onBackground,
|
||||
indicatorColor: theme.colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -128,7 +128,6 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
];
|
||||
}
|
||||
|
||||
// else if (!controller.room.isArchived) {
|
||||
// return [
|
||||
// if (Matrix.of(context).voipPlugin != null &&
|
||||
|
|
@ -213,7 +212,7 @@ class ChatView extends StatelessWidget {
|
|||
// #Pangea
|
||||
&&
|
||||
!r.isAnalyticsRoom,
|
||||
// Pangea#,
|
||||
// Pangea#
|
||||
badgePosition: BadgePosition.topEnd(end: 8, top: 4),
|
||||
child: const Center(child: BackButton()),
|
||||
),
|
||||
|
|
@ -365,6 +364,7 @@ class ChatView extends StatelessWidget {
|
|||
clipBehavior: Clip.hardEdge,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
// ignore: deprecated_member_use
|
||||
.surfaceVariant,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(24),
|
||||
|
|
@ -457,8 +457,8 @@ class ChatView extends StatelessWidget {
|
|||
// #Pangea
|
||||
// if (controller.dragging)
|
||||
// Container(
|
||||
// color: Theme.of(context)
|
||||
// .scaffoldBackgroundColor
|
||||
// color: Theme.of(context)
|
||||
// .scaffoldBackgroundColor
|
||||
// .withOpacity(0.9),
|
||||
// alignment: Alignment.center,
|
||||
// child: const Icon(
|
||||
|
|
@ -512,4 +512,4 @@ class ConditionalScroll extends StatelessWidget {
|
|||
return child;
|
||||
}
|
||||
}
|
||||
// #Pangea
|
||||
// Pangea#
|
||||
|
|
|
|||
|
|
@ -107,8 +107,7 @@ class Message extends StatelessWidget {
|
|||
final client = Matrix.of(context).client;
|
||||
final ownMessage = event.senderId == client.userID;
|
||||
final alignment = ownMessage ? Alignment.topRight : Alignment.topLeft;
|
||||
// ignore: deprecated_member_use
|
||||
var color = Theme.of(context).colorScheme.surfaceVariant;
|
||||
var color = Theme.of(context).colorScheme.surfaceContainerHighest;
|
||||
final displayTime = event.type == EventTypes.RoomCreate ||
|
||||
nextEvent == null ||
|
||||
!event.originServerTs.sameEnvironment(nextEvent!.originServerTs);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class _Reaction extends StatelessWidget {
|
|||
final textColor = Theme.of(context).brightness == Brightness.dark
|
||||
? Colors.white
|
||||
: Colors.black;
|
||||
final color = Theme.of(context).colorScheme.background;
|
||||
final color = Theme.of(context).colorScheme.surface;
|
||||
Widget content;
|
||||
if (reactionKey.startsWith('mxc://')) {
|
||||
content = Row(
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class ReplyContent extends StatelessWidget {
|
|||
color: backgroundColor ??
|
||||
Theme.of(context)
|
||||
.colorScheme
|
||||
.background
|
||||
.surface
|
||||
.withOpacity(ownMessage ? 0.2 : 0.33),
|
||||
borderRadius: borderRadius,
|
||||
child: Row(
|
||||
|
|
@ -82,7 +82,7 @@ class ReplyContent extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
color: ownMessage
|
||||
? Theme.of(context).colorScheme.onPrimary
|
||||
: Theme.of(context).colorScheme.onBackground,
|
||||
: Theme.of(context).colorScheme.onSurface,
|
||||
fontSize: fontSize,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class StateMessage extends StatelessWidget {
|
|||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
||||
),
|
||||
child: Text(
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class VerificationRequestContent extends StatelessWidget {
|
|||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
|
|||
|
|
@ -123,8 +123,7 @@ class EventVideoPlayerState extends State<EventVideoPlayer> {
|
|||
Center(
|
||||
child: IconButton(
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.background,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
icon: _isDownloading
|
||||
? const SizedBox(
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/pages/chat/chat.dart';
|
||||
import 'package:fluffychat/utils/room_status_extension.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SeenByRow extends StatelessWidget {
|
||||
final ChatController controller;
|
||||
|
|
@ -42,7 +41,6 @@ class SeenByRow extends StatelessWidget {
|
|||
mxContent: user.avatarUrl,
|
||||
name: user.calcDisplayname(),
|
||||
size: 16,
|
||||
fontSize: 9,
|
||||
),
|
||||
),
|
||||
if (seenByUsers.length > maxAvatars)
|
||||
|
|
@ -50,7 +48,7 @@ class SeenByRow extends StatelessWidget {
|
|||
width: 16,
|
||||
height: 16,
|
||||
child: Material(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
child: Center(
|
||||
child: Text(
|
||||
|
|
|
|||
|
|
@ -14,80 +14,91 @@ class TypingIndicators extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final typingUsers = controller.room.typingUsers
|
||||
..removeWhere((u) => u.stateKey == Matrix.of(context).client.userID);
|
||||
const topPadding = 20.0;
|
||||
const bottomPadding = 4.0;
|
||||
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
alignment: Alignment.center,
|
||||
child: AnimatedContainer(
|
||||
constraints:
|
||||
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5),
|
||||
height: typingUsers.isEmpty ? 0 : Avatar.defaultSize + bottomPadding,
|
||||
duration: FluffyThemes.animationDuration,
|
||||
curve: FluffyThemes.animationCurve,
|
||||
alignment: controller.timeline!.events.isNotEmpty &&
|
||||
controller.timeline!.events.first.senderId ==
|
||||
Matrix.of(context).client.userID
|
||||
? Alignment.topRight
|
||||
: Alignment.topLeft,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: const BoxDecoration(),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 8.0,
|
||||
bottom: bottomPadding,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: Avatar.defaultSize,
|
||||
width: typingUsers.length < 2
|
||||
? Avatar.defaultSize
|
||||
: Avatar.defaultSize + 16,
|
||||
child: Stack(
|
||||
children: [
|
||||
if (typingUsers.isNotEmpty)
|
||||
Avatar(
|
||||
mxContent: typingUsers.first.avatarUrl,
|
||||
name: typingUsers.first.calcDisplayname(),
|
||||
),
|
||||
if (typingUsers.length == 2)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 16),
|
||||
child: Avatar(
|
||||
mxContent: typingUsers.length == 2
|
||||
? typingUsers.last.avatarUrl
|
||||
: null,
|
||||
name: typingUsers.length == 2
|
||||
? typingUsers.last.calcDisplayname()
|
||||
: '+${typingUsers.length - 1}',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: topPadding),
|
||||
child: Material(
|
||||
color: Theme.of(context).colorScheme.surfaceVariant,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(2),
|
||||
topRight: Radius.circular(AppConfig.borderRadius),
|
||||
bottomLeft: Radius.circular(AppConfig.borderRadius),
|
||||
bottomRight: Radius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: typingUsers.isEmpty ? null : const _TypingDots(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
return StreamBuilder<Object>(
|
||||
stream: controller.room.client.onSync.stream.where(
|
||||
(syncUpdate) =>
|
||||
syncUpdate.rooms?.join?[controller.room.id]?.ephemeral
|
||||
?.any((ephemeral) => ephemeral.type == 'm.typing') ??
|
||||
false,
|
||||
),
|
||||
builder: (context, _) {
|
||||
final typingUsers = controller.room.typingUsers
|
||||
..removeWhere((u) => u.stateKey == Matrix.of(context).client.userID);
|
||||
const topPadding = 20.0;
|
||||
const bottomPadding = 4.0;
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
alignment: Alignment.center,
|
||||
child: AnimatedContainer(
|
||||
constraints:
|
||||
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5),
|
||||
height:
|
||||
typingUsers.isEmpty ? 0 : Avatar.defaultSize + bottomPadding,
|
||||
duration: FluffyThemes.animationDuration,
|
||||
curve: FluffyThemes.animationCurve,
|
||||
alignment: controller.timeline!.events.isNotEmpty &&
|
||||
controller.timeline!.events.first.senderId ==
|
||||
Matrix.of(context).client.userID
|
||||
? Alignment.topRight
|
||||
: Alignment.topLeft,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: const BoxDecoration(),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 8.0,
|
||||
bottom: bottomPadding,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: Avatar.defaultSize,
|
||||
width: typingUsers.length < 2
|
||||
? Avatar.defaultSize
|
||||
: Avatar.defaultSize + 16,
|
||||
child: Stack(
|
||||
children: [
|
||||
if (typingUsers.isNotEmpty)
|
||||
Avatar(
|
||||
mxContent: typingUsers.first.avatarUrl,
|
||||
name: typingUsers.first.calcDisplayname(),
|
||||
),
|
||||
if (typingUsers.length == 2)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 16),
|
||||
child: Avatar(
|
||||
mxContent: typingUsers.length == 2
|
||||
? typingUsers.last.avatarUrl
|
||||
: null,
|
||||
name: typingUsers.length == 2
|
||||
? typingUsers.last.calcDisplayname()
|
||||
: '+${typingUsers.length - 1}',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: topPadding),
|
||||
child: Material(
|
||||
color:
|
||||
Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(2),
|
||||
topRight: Radius.circular(AppConfig.borderRadius),
|
||||
bottomLeft: Radius.circular(AppConfig.borderRadius),
|
||||
bottomRight: Radius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: typingUsers.isEmpty ? null : const _TypingDots(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,7 +195,6 @@ class ChatListView extends StatelessWidget {
|
|||
MatrixLocals(L10n.of(context)!),
|
||||
),
|
||||
size: 32,
|
||||
fontSize: 12,
|
||||
// #Pangea
|
||||
littleIcon: room?.roomTypeIcon,
|
||||
// Pangea#
|
||||
|
|
@ -225,6 +224,8 @@ class ChatListView extends StatelessWidget {
|
|||
NavigationDestinationLabelBehavior.alwaysShow,
|
||||
shadowColor:
|
||||
Theme.of(context).colorScheme.onSurface,
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.surface,
|
||||
surfaceTintColor:
|
||||
Theme.of(context).colorScheme.surface,
|
||||
selectedIndex: controller.selectedIndex,
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class _NaviRailItemState extends State<NaviRailItem> {
|
|||
borderRadius: borderRadius,
|
||||
color: widget.isSelected
|
||||
? Theme.of(context).colorScheme.primaryContainer
|
||||
: Theme.of(context).colorScheme.background,
|
||||
: Theme.of(context).colorScheme.surface,
|
||||
child: Tooltip(
|
||||
message: widget.toolTip,
|
||||
child: InkWell(
|
||||
|
|
|
|||
|
|
@ -824,7 +824,6 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
size: 24,
|
||||
mxContent: spaceChild.avatarUrl,
|
||||
name: spaceChild.name,
|
||||
fontSize: 9,
|
||||
),
|
||||
),
|
||||
color: Theme.of(context)
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class PresenceAvatar extends StatelessWidget {
|
|||
final statusMsgBubbleElevation =
|
||||
Theme.of(context).appBarTheme.scrolledUnderElevation ?? 4;
|
||||
final statusMsgBubbleShadowColor =
|
||||
Theme.of(context).colorScheme.onBackground;
|
||||
Theme.of(context).colorScheme.onSurface;
|
||||
final statusMsgBubbleColor = Colors.white.withAlpha(245);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ class HomeserverAppBar extends StatelessWidget {
|
|||
)
|
||||
: null,
|
||||
fillColor: FluffyThemes.isColumnMode(context)
|
||||
? Theme.of(context).colorScheme.background
|
||||
: Theme.of(context).colorScheme.surfaceVariant,
|
||||
? Theme.of(context).colorScheme.surface
|
||||
: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
prefixText: '${L10n.of(context)!.homeserver}: ',
|
||||
hintText: L10n.of(context)!.enterYourHomeserver,
|
||||
suffixIcon: const Icon(Icons.search),
|
||||
|
|
|
|||
|
|
@ -39,14 +39,11 @@ class LoginView extends StatelessWidget {
|
|||
child: ElevatedButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor: MaterialStateProperty.all<Color>(
|
||||
Theme.of(context)
|
||||
.colorScheme
|
||||
.background
|
||||
.withOpacity(0.75),
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor: WidgetStateProperty.all<Color>(
|
||||
Theme.of(context).colorScheme.surface.withOpacity(0.75),
|
||||
),
|
||||
shape: MaterialStateProperty.all<OutlinedBorder>(
|
||||
shape: WidgetStateProperty.all<OutlinedBorder>(
|
||||
const CircleBorder(),
|
||||
),
|
||||
),
|
||||
|
|
@ -112,7 +109,7 @@ class LoginView extends StatelessWidget {
|
|||
// fillColor: textFieldFillColor,
|
||||
fillColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.background
|
||||
.surface
|
||||
.withOpacity(0.75),
|
||||
// Pangea#
|
||||
),
|
||||
|
|
@ -168,7 +165,7 @@ class LoginView extends StatelessWidget {
|
|||
// #Pangea
|
||||
fillColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.background
|
||||
.surface
|
||||
.withOpacity(0.75),
|
||||
// Pangea#
|
||||
),
|
||||
|
|
|
|||
|
|
@ -125,12 +125,12 @@ class NewGroupView extends StatelessWidget {
|
|||
// SwitchListTile.adaptive(
|
||||
// secondary: Icon(
|
||||
// Icons.lock_outlined,
|
||||
// color: Theme.of(context).colorScheme.onBackground,
|
||||
// color: Theme.of(context).colorScheme.onSurface,
|
||||
// ),
|
||||
// title: Text(
|
||||
// L10n.of(context)!.enableEncryption,
|
||||
// style: TextStyle(
|
||||
// color: Theme.of(context).colorScheme.onBackground,
|
||||
// color: Theme.of(context).colorScheme.onSurface,
|
||||
// ),
|
||||
// ),
|
||||
// value: !controller.publicGroup,
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ class SettingsView extends StatelessWidget {
|
|||
mxContent: profile?.avatarUrl,
|
||||
name: displayname,
|
||||
size: Avatar.defaultSize * 2.5,
|
||||
fontSize: 18 * 2.5,
|
||||
),
|
||||
),
|
||||
if (profile != null)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class SettingsPasswordView extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
body: ListTileTheme(
|
||||
iconColor: Theme.of(context).colorScheme.onBackground,
|
||||
iconColor: Theme.of(context).colorScheme.onSurface,
|
||||
child: MaxWidthBody(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class SettingsSecurityView extends StatelessWidget {
|
|||
return Scaffold(
|
||||
appBar: AppBar(title: Text(L10n.of(context)!.security)),
|
||||
body: ListTileTheme(
|
||||
iconColor: Theme.of(context).colorScheme.onBackground,
|
||||
iconColor: Theme.of(context).colorScheme.onSurface,
|
||||
child: MaxWidthBody(
|
||||
child: FutureBuilder(
|
||||
future: Matrix.of(context)
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
size: 16,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onBackground,
|
||||
.onSurface,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
|
|
@ -99,7 +99,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onBackground,
|
||||
.onSurface,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:flutter_linkify/flutter_linkify.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/utils/date_time_extension.dart';
|
||||
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||
import 'package:fluffychat/utils/url_launcher.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
import 'package:fluffychat/widgets/presence_builder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:flutter_linkify/flutter_linkify.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import '../../widgets/matrix.dart';
|
||||
import 'user_bottom_sheet.dart';
|
||||
|
||||
|
|
@ -119,7 +118,8 @@ class UserBottomSheetView extends StatelessWidget {
|
|||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Material(
|
||||
color: Theme.of(context).colorScheme.surfaceVariant,
|
||||
color:
|
||||
Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
borderRadius:
|
||||
BorderRadius.circular(AppConfig.borderRadius),
|
||||
child: ListTile(
|
||||
|
|
@ -136,7 +136,7 @@ class UserBottomSheetView extends StatelessWidget {
|
|||
TextButton.icon(
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.background,
|
||||
Theme.of(context).colorScheme.surface,
|
||||
foregroundColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
|
|
@ -185,7 +185,6 @@ class UserBottomSheetView extends StatelessWidget {
|
|||
mxContent: avatarUrl,
|
||||
name: displayname,
|
||||
size: Avatar.defaultSize * 2.5,
|
||||
fontSize: 18 * 2.5,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -205,7 +204,7 @@ class UserBottomSheetView extends StatelessWidget {
|
|||
),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor:
|
||||
Theme.of(context).colorScheme.onBackground,
|
||||
Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
label: Text(
|
||||
displayname,
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ abstract class ClientManager {
|
|||
},
|
||||
nativeImplementations: nativeImplementations,
|
||||
customImageResizer: PlatformInfos.isMobile ? customImageResizer : null,
|
||||
defaultNetworkRequestTimeout: const Duration(minutes: 5),
|
||||
defaultNetworkRequestTimeout: const Duration(minutes: 30),
|
||||
enableDehydratedDevices: true,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,12 @@ Future<DatabaseApi> flutterMatrixSdkDatabaseBuilder(Client client) async {
|
|||
// Pangea#
|
||||
);
|
||||
|
||||
// Delete database file:
|
||||
if (database == null && !kIsWeb) {
|
||||
final dbFile = File(await _getDatabasePath(client.clientName));
|
||||
if (await dbFile.exists()) await dbFile.delete();
|
||||
}
|
||||
|
||||
try {
|
||||
// Send error notification:
|
||||
// #Pangea
|
||||
|
|
@ -75,9 +81,6 @@ Future<MatrixSdkDatabase> _constructDatabase(Client client) async {
|
|||
|
||||
final cipher = await getDatabaseCipher();
|
||||
|
||||
final databaseDirectory = PlatformInfos.isIOS || PlatformInfos.isMacOS
|
||||
? await getLibraryDirectory()
|
||||
: await getApplicationSupportDirectory();
|
||||
Directory? fileStorageLocation;
|
||||
try {
|
||||
fileStorageLocation = await getTemporaryDirectory();
|
||||
|
|
@ -87,7 +90,7 @@ Future<MatrixSdkDatabase> _constructDatabase(Client client) async {
|
|||
);
|
||||
}
|
||||
|
||||
final path = join(databaseDirectory.path, '${client.clientName}.sqlite');
|
||||
final path = await _getDatabasePath(client.clientName);
|
||||
|
||||
// fix dlopen for old Android
|
||||
await applyWorkaroundToOpenSqlCipherOnOldAndroidVersions();
|
||||
|
|
@ -132,6 +135,14 @@ Future<MatrixSdkDatabase> _constructDatabase(Client client) async {
|
|||
);
|
||||
}
|
||||
|
||||
Future<String> _getDatabasePath(String clientName) async {
|
||||
final databaseDirectory = PlatformInfos.isIOS || PlatformInfos.isMacOS
|
||||
? await getLibraryDirectory()
|
||||
: await getApplicationSupportDirectory();
|
||||
|
||||
return join(databaseDirectory.path, '$clientName.sqlite');
|
||||
}
|
||||
|
||||
Future<void> _migrateLegacyLocation(
|
||||
String sqlFilePath,
|
||||
String clientName,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ class Avatar extends StatelessWidget {
|
|||
final void Function()? onTap;
|
||||
static const double defaultSize = 44;
|
||||
final Client? client;
|
||||
final double fontSize;
|
||||
final String? presenceUserId;
|
||||
final Color? presenceBackgroundColor;
|
||||
//#Pangea
|
||||
|
|
@ -23,7 +22,6 @@ class Avatar extends StatelessWidget {
|
|||
this.size = defaultSize,
|
||||
this.onTap,
|
||||
this.client,
|
||||
this.fontSize = 18,
|
||||
this.presenceUserId,
|
||||
this.presenceBackgroundColor,
|
||||
//#Pangea
|
||||
|
|
@ -51,16 +49,14 @@ class Avatar extends StatelessWidget {
|
|||
fallbackLetters,
|
||||
style: TextStyle(
|
||||
color: noPic ? Colors.white : null,
|
||||
fontSize: fontSize,
|
||||
fontSize: (size / 2.5).roundToDouble(),
|
||||
),
|
||||
),
|
||||
);
|
||||
final borderRadius = BorderRadius.circular(size / 2);
|
||||
// #Pangea
|
||||
// final presenceUserId = this.presenceUserId;
|
||||
// final color =
|
||||
// noPic ? name?.lightColorAvatar : Theme.of(context).secondaryHeaderColor;
|
||||
// Pangea#
|
||||
final presenceUserId = this.presenceUserId;
|
||||
final color =
|
||||
noPic ? name?.lightColorAvatar : Theme.of(context).secondaryHeaderColor;
|
||||
final container = Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
|
|
@ -68,9 +64,7 @@ class Avatar extends StatelessWidget {
|
|||
child: Container(
|
||||
width: size,
|
||||
height: size,
|
||||
color: noPic
|
||||
? name?.lightColorAvatar
|
||||
: Theme.of(context).secondaryHeaderColor,
|
||||
color: color,
|
||||
child: noPic
|
||||
? textWidget
|
||||
: MxcImage(
|
||||
|
|
@ -105,6 +99,7 @@ class Avatar extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
// #Pangea
|
||||
// PresenceBuilder(
|
||||
// client: client,
|
||||
// userId: presenceUserId,
|
||||
|
|
@ -120,23 +115,27 @@ class Avatar extends StatelessWidget {
|
|||
// ? Colors.orange
|
||||
// : Colors.grey;
|
||||
// return Positioned(
|
||||
// bottom: -4,
|
||||
// right: -4,
|
||||
// bottom: -3,
|
||||
// right: -3,
|
||||
// child: Container(
|
||||
// width: 16,
|
||||
// height: 16,
|
||||
// decoration: BoxDecoration(
|
||||
// color: presenceBackgroundColor ??
|
||||
// Theme.of(context).colorScheme.background,
|
||||
// Theme.of(context).colorScheme.surface,
|
||||
// borderRadius: BorderRadius.circular(32),
|
||||
// ),
|
||||
// alignment: Alignment.center,
|
||||
// child: Container(
|
||||
// width: 8,
|
||||
// height: 8,
|
||||
// width: 10,
|
||||
// height: 10,
|
||||
// decoration: BoxDecoration(
|
||||
// color: dotColor,
|
||||
// borderRadius: BorderRadius.circular(16),
|
||||
// border: Border.all(
|
||||
// width: 1,
|
||||
// color: Theme.of(context).colorScheme.surface,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
|
|
|
|||
|
|
@ -40,29 +40,16 @@ class LoginScaffold extends StatelessWidget {
|
|||
backgroundColor: Colors.transparent,
|
||||
// Pangea#
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
// #Pangea
|
||||
extendBodyBehindAppBar: true,
|
||||
// body: body,
|
||||
body: Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.cover,
|
||||
image: AssetImage('assets/login_wallpaper.png'),
|
||||
),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 480),
|
||||
child: body,
|
||||
),
|
||||
),
|
||||
// backgroundColor: isMobileMode
|
||||
// ? null
|
||||
// : Theme.of(context).colorScheme.background.withOpacity(0.8),
|
||||
// : Theme.of(context).colorScheme.surface.withOpacity(0.8),
|
||||
// bottomNavigationBar: isMobileMode
|
||||
// ? Material(
|
||||
// elevation: 4,
|
||||
// shadowColor: Theme.of(context).colorScheme.onBackground,
|
||||
// shadowColor: Theme.of(context).colorScheme.onSurface,
|
||||
// child: const _PrivacyButtons(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// ),
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ class ProfileBottomSheet extends StatelessWidget {
|
|||
mxContent: profile?.avatarUrl,
|
||||
name: profile?.displayName ?? userId,
|
||||
size: Avatar.defaultSize * 3,
|
||||
fontSize: 36,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -139,7 +139,6 @@ class PublicRoomBottomSheet extends StatelessWidget {
|
|||
mxContent: profile.avatarUrl,
|
||||
name: profile.name ?? roomAlias,
|
||||
size: Avatar.defaultSize * 3,
|
||||
fontSize: 36,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class UnreadRoomsBadge extends StatelessWidget {
|
|||
badgeColor: Theme.of(context).colorScheme.primary,
|
||||
elevation: 4,
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue