Skip to content

Commit

Permalink
feat: implemented a helper for desktop layout
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanYuuki committed Nov 25, 2024
1 parent c02db5a commit 398cf68
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 430 deletions.
25 changes: 25 additions & 0 deletions lib/components/platform_builder.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:aurora/utils/dimensions.dart';
import 'package:flutter/material.dart';

class PlatformBuilder extends StatefulWidget {
final Widget androidBuilder;
final Widget desktopBuilder;
const PlatformBuilder(
{super.key, required this.androidBuilder, required this.desktopBuilder});

@override
State<PlatformBuilder> createState() => _PlatformBuilderState();
}

class _PlatformBuilderState extends State<PlatformBuilder> {
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraints) {
if (constraints.maxWidth > maxMobileWidth) {
return widget.desktopBuilder;
} else {
return widget.androidBuilder;
}
});
}
}
80 changes: 0 additions & 80 deletions lib/components/setting/scheme_varaint_dialog.dart

This file was deleted.

Empty file.
Loading

0 comments on commit 398cf68

Please sign in to comment.