Skip to content

Updated the windows resize method #20

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

Merged
merged 3 commits into from
Feb 23, 2025
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

# FVM Version Cache
.fvm/
.fvmrc
.vscode/settings.json
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"dart.lineLength": 120
}
"dart.lineLength": 120,
"dart.flutterSdkPath": ".fvm/versions/3.27.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class _DashboardViewState extends State<DashboardView> {
final size = MediaQuery.sizeOf(context);
return DefaultTabController(
length: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(height: 20),
Container(
Expand Down
14 changes: 7 additions & 7 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import 'package:socket_probe/my_app.dart';
void main() {
runApp(const MyApp());

doWhenWindowReady(() {
final win = appWindow;
win.minSize = const Size(1024, 768);
win.size = const Size(1024, 768);
win.alignment = Alignment.center;
win.show();
});
// doWhenWindowReady(() {
// final win = appWindow;
// win.minSize = const Size(1024, 768);
// win.size = const Size(1024, 768);
// win.alignment = Alignment.center;
// win.show();
// });
}
22 changes: 21 additions & 1 deletion lib/my_app.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:socket_probe/common/themes/app_theme.dart';
Expand All @@ -8,9 +9,28 @@ import 'package:socket_probe/features/event_sockets/bloc/event_sockets_bloc.dart
import 'package:socket_probe/features/navigation/bloc/navigation_cubit.dart';
import 'package:socket_probe/features/wsprotocol/bloc/wsprotocol_bloc.dart';

class MyApp extends StatelessWidget {
class MyApp extends StatefulWidget {
const MyApp({super.key});

@override
State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
doWhenWindowReady(() {
final win = appWindow;
win.minSize = const Size(1024, 768);
win.size = const Size(1024, 768);
win.alignment = Alignment.center;
win.show();
});
});
}

@override
Widget build(BuildContext context) {
return MultiBlocProvider(
Expand Down
Loading