Ver código fonte

Add option to choose layout

vishnukvmd 2 anos atrás
pai
commit
acbd396e23
1 arquivos alterados com 32 adições e 1 exclusões
  1. 32 1
      lib/ui/tools/create_collage_page.dart

+ 32 - 1
lib/ui/tools/create_collage_page.dart

@@ -16,6 +16,7 @@ class CreateCollagePage extends StatefulWidget {
 
 class _CreateCollagePageState extends State<CreateCollagePage> {
   final _logger = Logger("CreateCollagePage");
+  bool _isLayoutVertical = false;
 
   @override
   Widget build(BuildContext context) {
@@ -32,7 +33,37 @@ class _CreateCollagePageState extends State<CreateCollagePage> {
   }
 
   Widget _getBody() {
-    return VerticalSplit(widget.files[0], widget.files[1]);
+    return Column(
+      children: [
+        _isLayoutVertical
+            ? VerticalSplit(widget.files[0], widget.files[1])
+            : HorizontalSplit(widget.files[0], widget.files[1]),
+        const SizedBox(
+          height: 24,
+        ),
+        const Text("Choose layout"),
+        Row(
+          children: [
+            TextButton(
+              child: const Icon(Icons.border_vertical_rounded),
+              onPressed: () {
+                setState(() {
+                  _isLayoutVertical = true;
+                });
+              },
+            ),
+            TextButton(
+              child: const Icon(Icons.splitscreen),
+              onPressed: () {
+                setState(() {
+                  _isLayoutVertical = false;
+                });
+              },
+            )
+          ],
+        )
+      ],
+    );
   }
 
   Widget _getGrid() {