This file contains 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
MediaQuery.withClapedTextScaling( | |
maxScaleFactor: MediaQuery.texdtScalerOf(context), | |
child: ScaffoldWidget(), | |
) |
This file contains 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
// Copyright 2024 Fredrick Allan Grott. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
import 'package:adaptive_constraints/src/breakpoints.dart'; | |
import 'package:flutter/material.dart'; | |
/// LayoutUtils to assist in implementing Canonical page layouts | |
/// to serves as content for an adaptive scaffold. | |
/// |
This file contains 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
// Copyright 2024 Fredrick Allan Grott. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
// Note: Generally when we implement models required in | |
// implementing the adaptive scaffold and canonical | |
// layout patterns we do not stick models or entities | |
// in the domain layer but keep them together with |
This file contains 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
static WindowSizeEnum getWindowSize(BuildContext context) { | |
if (isCompact(context)) { | |
return WindowSizeEnum.compact; | |
} else if (isMedium(context)) { | |
return WindowSizeEnum.medium; | |
} else if (isExpanded(context)) { | |
return WindowSizeEnum.expanded; | |
} else if (isLarge(context)) { | |
return WindowSizeEnum.large; | |
} else if (isExtra(context)) { |
This file contains 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
/// Determines if the screen is in the compact window size. | |
/// | |
/// Returns `true` if the screen width is less than 600 pixels, `false` otherwise. | |
static bool isCompact(BuildContext context) { | |
return MediaQuery.of(context).size.width < WindowSizeEnum.medium.begin ? true : false; | |
} | |
/// Determines if the screen is in the medium window size. | |
/// | |
/// Returns `true` if the screen width is less than 840 pixels, `false` otherwise. |
This file contains 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
/// Model for Adaptive Scaffold implementations accoding | |
/// to Dart enumerated types. See Canonical Layouts for | |
/// Window Size class numbers at: | |
/// https://m3.material.io/foundations/layout/canonical-layouts/list-detail | |
/// | |
/// @author Fredrick Allan Grott | |
enum WindowSizeEnum { | |
/// The compact window size | |
compact(0, 599), |
This file contains 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
package com.microsoft.device.dualscreen.twopanelayout | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.material.MaterialTheme | |
import androidx.compose.material.Surface | |
import androidx.compose.material.Text | |
import androidx.compose.material.TopAppBar | |
import androidx.compose.runtime.Composable |
This file contains 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
package com.microsoft.device.dualscreen.twopanelayout | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.clickable | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Row | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.padding |
This file contains 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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
// per dart-flutter extensions directions at: https://dartcode.org/docs/launch-configuration/ | |
// | |
// although one can, NEVER EVER put any define args in these launch configs as it's | |
// too easy to by mistake include private keys and have them end up in the | |
// git repo. | |
// |