Skip to content

Instantly share code, notes, and snippets.

View fredgrott's full-sized avatar
👾
focusing on flutter cross platform mobile dev

Fred Grott fredgrott

👾
focusing on flutter cross platform mobile dev
View GitHub Profile
@fredgrott
fredgrott / design_system_color_scheme.dart
Created June 2, 2025 17:20
m3e design system enforcement of color scheme generation
// 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:flex_color_scheme/flex_color_scheme.dart';
import 'package:flutter/material.dart';
/// DesignSystemColorScheme is a way to enforce
/// Material 3 Expressive within the FlexColorScheme generation
/// via the fromSeeds constructor.
@fredgrott
fredgrott / build_color_schemes.dart
Created June 2, 2025 17:12
color scheme generation via FCS for m3e expressive
// 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_redundant_argument_values
import 'package:flex_color_scheme/flex_color_scheme.dart';
import 'package:flutter/material.dart';
/// schemeLight in conjunction with DesignSystemColorScheme enforce
@fredgrott
fredgrott / flex_pane_notifier.dart
Created May 24, 2025 23:05
flex pane notifier
// 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:userinterface/core/widgets/canonical_layout_models.dart';
/// FlexPaneNotitier is to pass the FlexPaneModel view-model
/// as an observer into the two pane canonical layout.
@fredgrott
fredgrott / canonical_models.dart
Created May 24, 2025 23:04
canonical layout models
// 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';
/// StartEndPaneEnum as we need in the FlexContentPane to
/// know whether its a start or end pane per from the parent
/// CustomTwoPane layout.
///
@fredgrott
fredgrott / two_pane.dart
Created May 24, 2025 18:11
two pane layout, part of Dual Screen package
/// Copyright (c) Microsoft Corporation.
/// Licensed under the MIT License.
import 'dart:math' as math;
import 'dart:ui' show DisplayFeature;
import 'package:flutter/widgets.dart';
/// A widget that positions two panes side by side on uninterrupted screens or
/// on either side of a separating [DisplayFeature] on screens interrupted by a
@fredgrott
fredgrott / main.dart
Created May 24, 2025 18:06
flutter box transform example
import 'package:flutter/material.dart';
import 'package:flutter_box_transform/flutter_box_transform.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// 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.
// 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
// 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
@fredgrott
fredgrott / app_lifecycle_globals.dart
Created May 4, 2025 18:14
app lifecycle globals
// 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.