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 / pane_container_widget.dart
Created May 5, 2024 17:13
pane container widget
// 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_extras/src/layout_utils.dart';
import 'package:adaptive_extras/src/new_surface_theme.dart';
import 'package:adaptive_extras/src/surface_color_enum.dart';
import 'package:adaptive_extras/src/text_direction.dart';
import 'package:flutter/material.dart';
// 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_extras/src/surface_color_enum.dart';
import 'package:flutter/material.dart';
/// Provides methods for getting the appropriate surface color based on the selected
/// [SurfaceColorEnum] and the current [Theme] in [BuildContext].
class NewSurfaceTheme {
// 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.
/// This enum represents the new surface colors introduced in Material Design 3.0.
///
/// The different colors represent different tones and can be used to convey
/// hierarchy, depth, and focus. They can be used as background colors for
/// surfaces such as cards, dialog boxes, or containers.
///
// 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_extras/src/global_context.dart';
import 'package:flutter/material.dart';
/// Usage is:
/// ```
/// isRTL() ? TextDirection.rtl: TextDirection.ltr;
// 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_extras/src/breakpoints.dart';
import 'package:flutter/material.dart';
/// LayoutUtils to assist in implementing Canonical page layouts
// 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
@fredgrott
fredgrott / app.dart
Last active May 5, 2024 16:56
my app
import 'package:adaptive_extras/src/custom_scroll_behavior.dart';
import 'package:adaptive_extras/src/global_context.dart';
import 'package:adaptive-extras/src/layout_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'sample_feature/sample_item_details_view.dart';
import 'sample_feature/sample_item_list_view.dart';
import 'settings/settings_controller.dart';
// 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';
/// [scaffoldMessengerKey] is used as a parameter in the MaterialApp
/// main construct for Nav 1.0 and in the MaterialApp.rotuer construct
/// for Nav 2.0 as a way to grab the context outside of the widgets
@fredgrott
fredgrott / custom_scroll_behavior.dart
Created May 5, 2024 16:41
custom scroll behavior
// 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/gestures.dart';
import 'package:flutter/material.dart';
/// [CustomScrollBehavior] to set web with the proper
/// scrollbar behavior as now as of Flutter 2.2 all widgets
/// that are scrollable get a scrollable configuration by
@fredgrott
fredgrott / snippet.dart
Created May 3, 2024 18:26
visualdensity
MaterialApp(
theme: ThemeData(vsiualDensity: LayoutUtils.getVisualDensity),
)