fix: replace open_file_plus with native Kotlin MethodChannel for APK install
open_file_plus 3.4.1 uses deprecated PluginRegistry.Registrar API incompatible with current Flutter. Replaced with a MethodChannel in MainActivity.kt that calls FileProvider.getUriForFile() and launches the system package installer directly. Also rework chat_input: 4px border radius on desktop, vPad 18px, 56px send button. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,11 +43,7 @@ class _ChatInputState extends State<ChatInput> {
|
||||
if (text.isEmpty) return;
|
||||
_ctrl.clear();
|
||||
setState(() => _canSend = false);
|
||||
|
||||
await widget.room.sendTextEvent(
|
||||
text,
|
||||
inReplyTo: widget.replyTo,
|
||||
);
|
||||
await widget.room.sendTextEvent(text, inReplyTo: widget.replyTo);
|
||||
widget.onClearReply?.call();
|
||||
}
|
||||
|
||||
@@ -59,21 +55,30 @@ class _ChatInputState extends State<ChatInput> {
|
||||
defaultTargetPlatform == TargetPlatform.linux ||
|
||||
defaultTargetPlatform == TargetPlatform.macOS);
|
||||
|
||||
// Desktop: taller bar, 4px square corners, bigger button
|
||||
// Mobile: compact bar, pill shape, smaller button
|
||||
final fieldRadius = isDesktop ? 4.0 : 20.0;
|
||||
final btnSize = isDesktop ? 56.0 : 44.0;
|
||||
final btnRadius = isDesktop ? 6.0 : 12.0;
|
||||
final iconSize = isDesktop ? 24.0 : 20.0;
|
||||
final fontSize = isDesktop ? 15.0 : 14.0;
|
||||
final vPad = isDesktop ? 18.0 : 10.0;
|
||||
final hPad = isDesktop ? 16.0 : 14.0;
|
||||
final outerPad = isDesktop
|
||||
? const EdgeInsets.fromLTRB(12, 10, 12, 12)
|
||||
: const EdgeInsets.fromLTRB(8, 4, 8, 8);
|
||||
|
||||
return SafeArea(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (widget.replyTo != null) _ReplyBar(
|
||||
event: widget.replyTo!,
|
||||
onClear: widget.onClearReply ?? () {},
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
isDesktop ? 12 : 8,
|
||||
isDesktop ? 10 : 4,
|
||||
isDesktop ? 12 : 8,
|
||||
isDesktop ? 14 : 8,
|
||||
if (widget.replyTo != null)
|
||||
_ReplyBar(
|
||||
event: widget.replyTo!,
|
||||
onClear: widget.onClearReply ?? () {},
|
||||
),
|
||||
Padding(
|
||||
padding: outerPad,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
@@ -83,19 +88,24 @@ class _ChatInputState extends State<ChatInput> {
|
||||
minLines: 1,
|
||||
maxLines: 6,
|
||||
textCapitalization: TextCapitalization.sentences,
|
||||
style: TextStyle(fontSize: isDesktop ? 16 : 14),
|
||||
style: TextStyle(fontSize: fontSize),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Nachricht...',
|
||||
hintStyle: TextStyle(
|
||||
fontSize: isDesktop ? 16 : 14,
|
||||
color: theme.colorScheme.onSurface.withAlpha(100),
|
||||
),
|
||||
hintStyle: TextStyle(fontSize: fontSize),
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: isDesktop ? 22 : 16,
|
||||
vertical: isDesktop ? 20 : 10,
|
||||
horizontal: hPad,
|
||||
vertical: vPad,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(isDesktop ? 16 : 24),
|
||||
borderRadius: BorderRadius.circular(fieldRadius),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(fieldRadius),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(fieldRadius),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
filled: true,
|
||||
@@ -113,18 +123,18 @@ class _ChatInputState extends State<ChatInput> {
|
||||
onTap: _canSend ? _send : null,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 150),
|
||||
width: isDesktop ? 60 : 44,
|
||||
height: isDesktop ? 60 : 44,
|
||||
width: btnSize,
|
||||
height: btnSize,
|
||||
decoration: BoxDecoration(
|
||||
color: _canSend
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.primary.withAlpha(70),
|
||||
borderRadius: BorderRadius.circular(isDesktop ? 16 : 14),
|
||||
borderRadius: BorderRadius.circular(btnRadius),
|
||||
),
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.send_rounded,
|
||||
size: isDesktop ? 26 : 20,
|
||||
size: iconSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user