Restrict width of chat view on desktop
This commit is contained in:
parent
36eaf42d1d
commit
443acf8a81
1199
lib/main.dart
1199
lib/main.dart
File diff suppressed because it is too large
Load Diff
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue