This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension View { | |
func present<Content: View>(_ isPresented: Binding<Bool>, content: () -> Content) -> some View { | |
Group { | |
if isPresented.wrappedValue { | |
ZStack { | |
self | |
content() | |
} | |
.frame(maxWidth: .infinity, maxHeight: .infinity) | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class ResponsiveLayout extends StatelessWidget { | |
final Widget mobileBody; | |
final Widget tabletBody; | |
final Widget desktopBody; | |
ResponsiveLayout({ | |
required this.mobileBody, | |
required this.tabletBody, |