Skip to content

Commit

Permalink
update_17_11_2023
Browse files Browse the repository at this point in the history
  • Loading branch information
mo7amedaliEbaid committed Nov 17, 2023
1 parent eec32fe commit 27b72b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';

import 'app.dart';
import 'dart:js' as js;

void configureApp() {
setUrlStrategy(PathUrlStrategy());
}

Future<void> main() async {

js.context.callMethod('disableLandscapeMode');
await WidgetsFlutterBinding.ensureInitialized();
configureApp();

Expand Down
8 changes: 8 additions & 0 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@
<div class="loading">
<div class="loader"></div>
</div>
<script>
function disableLandscapeMode() {
var metaTag = document.createElement('meta');
metaTag.name = 'viewport';
metaTag.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';
document.getElementsByTagName('head')[0].appendChild(metaTag);
}
</script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>

0 comments on commit 27b72b0

Please sign in to comment.