Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix(web): add kIsWeb before Platform calls #359

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions app/lib/ui/about/detail/about_file_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import 'dart:convert';
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:markdown/markdown.dart' as md;
Expand Down Expand Up @@ -317,10 +318,14 @@ String convertToHtml(
var result = "<html>";
result += head;

if (Platform.isIOS) {
result += cssApple;
} else if (Platform.isAndroid) {
result += cssAndroid;
if (!kIsWeb) {
if (Platform.isIOS) {
result += cssApple;
} else {
if (Platform.isAndroid) {
result += cssAndroid;
}
}
}

result += "</head>";
Expand Down
5 changes: 3 additions & 2 deletions app/lib/ui/components/textfields/textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import 'dart:io';
import 'dart:math';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/ods_flutter_app_localizations.dart';
import 'package:ods_flutter/components/chips/ods_choice_chips.dart';
Expand Down Expand Up @@ -118,7 +119,7 @@ class _Body extends StatelessWidget {
///Keyboard action
switch (customizationState?.selectedKeyboardAction) {
case KeyboardActionEnum.none:
if (Platform.isAndroid) {
if (kIsWeb || Platform.isAndroid) {
keyboardAction = TextInputAction.none;
} else if (Platform.isIOS) {
keyboardAction = TextInputAction.unspecified;
Expand All @@ -140,7 +141,7 @@ class _Body extends StatelessWidget {
keyboardAction = TextInputAction.send;
break;
case KeyboardActionEnum.previous:
if (Platform.isAndroid) {
if (kIsWeb || Platform.isAndroid) {
keyboardAction = TextInputAction.previous;
}
break;
Expand Down
5 changes: 3 additions & 2 deletions app/lib/ui/components/textfields/textfield_password.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import 'dart:io';
import 'dart:math';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/ods_flutter_app_localizations.dart';
import 'package:ods_flutter/components/chips/ods_choice_chips.dart';
Expand Down Expand Up @@ -119,7 +120,7 @@ class _Body extends StatelessWidget {
///Keyboard action
switch (customizationState?.selectedKeyboardAction) {
case KeyboardActionEnum.none:
if (Platform.isAndroid) {
if (kIsWeb || Platform.isAndroid) {
keyboardAction = TextInputAction.none;
} else if (Platform.isIOS) {
keyboardAction = TextInputAction.unspecified;
Expand All @@ -141,7 +142,7 @@ class _Body extends StatelessWidget {
keyboardAction = TextInputAction.send;
break;
case KeyboardActionEnum.previous:
if (Platform.isAndroid) {
if (!kIsWeb && Platform.isAndroid) {
keyboardAction = TextInputAction.previous;
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/ods_flutter_app_localizations.dart';
import 'package:ods_flutter/components/divider/ods_divider.dart';
Expand Down Expand Up @@ -85,7 +86,7 @@ class GuidelineTypographyScreen extends StatelessWidget {
padding: EdgeInsets.all(spacingM),
child: Column(
children: [
Platform.isAndroid
kIsWeb || Platform.isAndroid
? Text(
AppLocalizations.of(context)!
.guidelinesTypographyAndroidDescription,
Expand Down
3 changes: 2 additions & 1 deletion library/lib/components/sheets_bottom/ods_sheets_bottom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:ods_flutter/guidelines/spacings.dart';

Expand Down Expand Up @@ -45,7 +46,7 @@ class _OdsSheetsBottomState extends State<OdsSheetsBottom> {

@override
Widget build(BuildContext context) {
double collapsedHeight = Platform.isAndroid ? 80 : 91;
double collapsedHeight = !kIsWeb && Platform.isAndroid ? 80 : 91;

return Container(
decoration: BoxDecoration(
Expand Down
Loading