Restrict width of chat view on desktop

This commit is contained in:
JHubi1 2024-06-21 20:23:55 +02:00
parent 36eaf42d1d
commit 443acf8a81
No known key found for this signature in database
GPG Key ID: 7BF82570CBBBD050
2 changed files with 648 additions and 582 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,28 +5,23 @@ import 'package:flutter/foundation.dart';
import 'package:bitsdojo_window/bitsdojo_window.dart';
bool desktopFeature() {
return (Platform.isWindows || Platform.isLinux || Platform.isMacOS);
bool desktopFeature({bool web = false}) {
return (Platform.isWindows ||
Platform.isLinux ||
Platform.isMacOS ||
(web ? kIsWeb : false));
}
bool desktopWebFeature() {
return (Platform.isWindows || Platform.isLinux || Platform.isMacOS || kIsWeb);
bool desktopLayout(BuildContext context,
{bool web = false, double? value, double valueCap = 1000}) {
value ??= MediaQuery.of(context).size.width;
return (desktopFeature(web: web) || value >= valueCap);
}
bool desktopLayout(BuildContext context) {
return (desktopFeature() || MediaQuery.of(context).size.width >= 1000);
}
bool desktopLayoutRequired(BuildContext context) {
return (desktopFeature() && MediaQuery.of(context).size.width >= 1000);
}
bool desktopWebLayout(BuildContext context) {
return (desktopWebFeature() || MediaQuery.of(context).size.width >= 1000);
}
bool desktopWebLayoutRequired(BuildContext context) {
return (desktopWebFeature() && MediaQuery.of(context).size.width >= 1000);
bool desktopLayoutRequired(BuildContext context,
{bool web = false, double? value, double valueCap = 1000}) {
value ??= MediaQuery.of(context).size.width;
return (desktopFeature(web: web) && value >= valueCap);
}
Widget desktopControls(BuildContext context) {