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'; import 'package:bitsdojo_window/bitsdojo_window.dart';
bool desktopFeature() { bool desktopFeature({bool web = false}) {
return (Platform.isWindows || Platform.isLinux || Platform.isMacOS); return (Platform.isWindows ||
Platform.isLinux ||
Platform.isMacOS ||
(web ? kIsWeb : false));
} }
bool desktopWebFeature() { bool desktopLayout(BuildContext context,
return (Platform.isWindows || Platform.isLinux || Platform.isMacOS || kIsWeb); {bool web = false, double? value, double valueCap = 1000}) {
value ??= MediaQuery.of(context).size.width;
return (desktopFeature(web: web) || value >= valueCap);
} }
bool desktopLayout(BuildContext context) { bool desktopLayoutRequired(BuildContext context,
return (desktopFeature() || MediaQuery.of(context).size.width >= 1000); {bool web = false, double? value, double valueCap = 1000}) {
} value ??= MediaQuery.of(context).size.width;
return (desktopFeature(web: web) && value >= valueCap);
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);
} }
Widget desktopControls(BuildContext context) { Widget desktopControls(BuildContext context) {