Remove Landscape mode from flutter App

Thilina Dilshan
Oct 30, 2021

This is a way to remove landscape mode from flutter app. This can be use as a lazy way to make app responsive. Not a good way but it works.

Made this small change to the main method.

First import this.

import ‘package:flutter/services.dart’;

Then do the rest.

void main() {WidgetsFlutterBinding.ensureInitialized();SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp,DeviceOrientation.portraitDown,]);runApp(const MyApp());}

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Thilina Dilshan
Thilina Dilshan

Written by Thilina Dilshan

Software developer , love to learn

Responses (1)

Write a response

Not a good way but it works.

What better way than this?

--