These Enhancements Make Flutter Beast At Making Apps For Windows, macOS, and Linux. | by Ranjan Kumar | Jan, 2025

Flutter Newest Enhancements.

Picture by Noah Dustin von Weissenfluh on Unsplash

What it means:
You possibly can management the app window dimension, place, and whether or not it may be resized.

Instance: Setting Window Dimension

To regulate the window dimension on a desktop platform, you should utilize the window_size bundle.

import 'bundle:window_size/window_size.dart';
import 'bundle:flutter/materials.dart';

void primary() {
WidgetsFlutterBinding.ensureInitialized();
setWindowTitle("Flutter Desktop App");
setWindowMinSize(const Dimension(400, 300)); // Minimal window dimension
setWindowMaxSize(const Dimension(800, 600)); // Most window dimension
runApp(MyApp());
}

class MyApp extends StatelessWidget {
@override
Widget construct(BuildContext context) {
return MaterialApp(
dwelling: Scaffold(
appBar: AppBar(title: Textual content('Window Administration Instance')),
physique: Middle(
youngster: Textual content('This app has managed window dimension!'),
),
),
);
}
}

Key Level:

You possibly can make sure the app window isn’t too small or too massive and handle its conduct.

Sensi Tech Hub
Logo