feat(android): Add the keyboard height code

This commit is contained in:
2023-09-18 20:50:08 +02:00
parent 1852f2d198
commit f949b008b3
6 changed files with 104 additions and 2 deletions

View File

@@ -1,6 +1,5 @@
// ignore_for_file: avoid_print
import 'dart:io';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get_it/get_it.dart';
@@ -51,6 +50,19 @@ class TestEvent extends BackgroundEvent {
class MyAppState extends State<MyApp> {
String? imagePath;
@override
void initState() {
super.initState();
const EventChannel('org.moxxy.moxxyv2/notification_stream')
.receiveBroadcastStream()
.listen(
(event) {
print('Keyboard height: ${event as double}');
},
);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
@@ -221,6 +233,7 @@ class MyAppState extends State<MyApp> {
},
child: const Text('Share some text'),
),
const TextField(),
],
),
),