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
// Copyright 2025 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. | |
// ignore_for_file: avoid_classes_with_only_static_members, avoid_bool_literals_in_conditional_expressions | |
import 'package:flutter/material.dart'; | |
import 'package:userinterface/core/utils/window_size_enum.dart'; | |
/// Helper class for defining breakpoints in a responsive UI design. |
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
// Copyright 2025 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. | |
/// WindowSizeEnum per WindowSize class docs, see | |
/// https://m3.material.io/foundations/layout/applying-layout/window-size-classes | |
/// | |
/// Vertical Paddinhg is at | |
/// https://m3.material.io/foundations/layout/understanding-layout/spacing | |
/// @author Fredrick Allan Grott |
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
// Copyright 2025 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'; | |
import 'package:lifecycle/lifecycle.dart'; | |
import 'package:userinterface/core/lifecycle/app_lifecycle_globals.dart'; | |
/// Subscribes lifecycle events for normal widgets. | |
/// This is used to wrap the scaffold of the app so that |
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
// Copyright 2025 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 'dart:ui'; | |
/// Used with the AppLifecycleMixin scaffold wrapper | |
/// and in MediaQuery extensions I use this to get the devicePixelRatio | |
/// and size as the size will represent the physical size in foldables and | |
/// big screens where multiple windows may exist. |
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
// Data class to hold current FlexScaffold destination route for top level and | |
// top level destination pushed on top in small device navigation. | |
import 'package:app_scaffold/flex/flex_target.dart'; | |
import 'package:flutter/foundation.dart'; | |
@immutable | |
class CurrentRoute { | |
const CurrentRoute({ | |
this.usePush = false, | |
required this.destination, |
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:app_scaffold/flex/flex_target.dart'; | |
import 'package:state_notifier/state_notifier.dart'; | |
import 'package:userinterface/core/navigation/models/current_route.dart'; | |
/// StateNotifier for the immutable AppNavigation data. | |
/// For Service Locator injection, this class is registered | |
/// With GetIt. In Provider type ionjectors, we make | |
/// A separate NotifierProvider class. | |
/// | |
/// Many people mistakenly label this as a controller, its |
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/widgets.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:state_notifier/state_notifier.dart'; | |
/// Subscribes to a [StateNotifier] and mark the widget as needing build | |
/// whenever the state is changed. | |
T useStateNotifier<T>(StateNotifier<T> stateNotifier) { | |
return use(_StateNotifierHook<T>(stateNotifier)); | |
} |
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/widgets.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:state_notifier/state_notifier.dart'; | |
typedef CreateStateNotifier<T extends StateNotifier> = T Function(); | |
/// Creates a memoized [StateNotifier] instance via [create], dispose it when | |
/// the widget disposes. | |
T useCreateStateNotifier<T extends StateNotifier>( | |
CreateStateNotifier<T> create) { |
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
// Copyright 2025 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 'dart:math'; | |
import 'package:dual_screen/dual_screen.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:universal_platform/universal_platform.dart'; | |
import 'package:userinterface/core/lifecycle/app_lifecycle_globals.dart'; |
NewerOlder