Skip to content

Commit

Permalink
feat: deprecate remaining web widgets (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
smallTrogdor authored Sep 2, 2024
1 parent 3e67964 commit 1ed7a98
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ It is expected that you keep this format strictly, since we depend on it in our

## [Unreleased]

### Deprecated

- (#162) Deprecated Web Widgets:
- `SBBResponsive`
- `SBBWebHeader`
- `SBBMenu`
- `SBBUserMenu`
- `SBBCard`
- `SBBSidebar`


## [1.5.0] - 2024-08-15

### Added
Expand Down
1 change: 1 addition & 0 deletions lib/src/card/sbb_card.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '../../design_system_flutter.dart';
import 'package:flutter/material.dart';

@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBCard extends StatefulWidget {
const SBBCard(
{Key? key,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/header/sbb_web_header.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '../../design_system_flutter.dart';
import 'package:flutter/material.dart';

@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBWebHeader extends StatelessWidget implements PreferredSizeWidget {
const SBBWebHeader({
Key? key,
Expand Down Expand Up @@ -112,6 +113,7 @@ class SBBWebHeader extends StatelessWidget implements PreferredSizeWidget {
);
}

@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBWebHeaderNavItem extends StatefulWidget {
const SBBWebHeaderNavItem({
Key? key,
Expand Down
6 changes: 6 additions & 0 deletions lib/src/menu/sbb_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const double _kMenuScreenPadding = 8.0;
///
/// See also
/// * [PopupMenuEntry], on which this class is based.
@Deprecated('FlutterWeb will not be supported from the next major release.')
abstract class SBBMenuEntry<T> extends StatefulWidget {
/// Abstract const constructor. This constructor enables subclasses to provide
/// const constructors so that they can be used in const expressions.
Expand Down Expand Up @@ -49,6 +50,7 @@ abstract class SBBMenuEntry<T> extends StatefulWidget {
///
/// see also:
/// * [PopupMenuDivider] on which this class is based.
@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBMenuDivider extends SBBMenuEntry<Never> {
/// Creates a horizontal divider for a sbb menu.
///
Expand Down Expand Up @@ -95,6 +97,7 @@ class _SBBMenuDividerState extends State<SBBMenuDivider> {
/// A text entry to mark groupings in SBB menus
///
/// Adapts SizedBox to work in SBB menus
@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBMenuText extends SBBMenuEntry<Never> {
/// Creates a horizontal text entry for a sbb menu.
///
Expand Down Expand Up @@ -193,6 +196,7 @@ class _RenderMenuItem extends RenderShiftedBox {
/// * [showSBBMenu], a method to dynamically show a SBB menu at a given location.
/// * [SBBMenuButton], an [IconButton] that automatically shows a menu when
/// it is tapped.
@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBMenuItem<T> extends SBBMenuEntry<T> {
/// Creates an item for a SBB menu.
///
Expand Down Expand Up @@ -719,6 +723,7 @@ class _PopupMenuRoute<T> extends PopupRoute<T> {
/// calling this method automatically.
/// * [SemanticsConfiguration.namesRoute], for a description of edge triggered
/// semantics.
@Deprecated('FlutterWeb will not be supported from the next major release.')
Future<T?> showSBBMenu<T>({
required BuildContext context,
required RelativeRect position,
Expand Down Expand Up @@ -791,6 +796,7 @@ typedef SBBMenuItemBuilder<T> = List<SBBMenuEntry<T>> Function(
/// * [SBBMenuDivider], a popup menu entry that is just a horizontal line.
/// * [showSBBMenu], a method to dynamically show a popup menu at a given location.
/// * [PopupMenuButton], on which this widget is based
@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBMenuButton<T> extends StatefulWidget {
/// Creates a button that shows a popup menu.
///
Expand Down
7 changes: 5 additions & 2 deletions lib/src/menu/sbb_user_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const double _kHorizontalSpacing = 8.0;
///
/// If a [displayName] is given, the itemBuilder is called to create a SBB menu.
/// The header is added to the itemBuilder at the top.
@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBUserMenu<T> extends StatelessWidget {
/// Creates an SBBUserMenu with loggedIn = [displayName] != null.
///
Expand All @@ -21,6 +22,7 @@ class SBBUserMenu<T> extends StatelessWidget {
/// the specified value as a return.
///
/// To act upon a login request, use [onLoginRequest].
@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBUserMenu({
required this.itemBuilder,
this.initialValue,
Expand Down Expand Up @@ -98,7 +100,7 @@ class SBBUserMenu<T> extends StatelessWidget {
leading != null
? leading!
: Icon(
SBBIcons.user_small,
SBBIcons.user_small,
),
SizedBox(width: _kHorizontalSpacing),
Text(loginTitle, maxLines: 1),
Expand Down Expand Up @@ -139,7 +141,8 @@ class SBBUserMenu<T> extends StatelessWidget {
? name.trim().split(' ').map((l) => l[0].toUpperCase()).take(2).join()
: '';

ButtonStyle _getThemedUserMenuButtonStyle(SBBControlStyles style) => ButtonStyle(
ButtonStyle _getThemedUserMenuButtonStyle(SBBControlStyles style) =>
ButtonStyle(
textStyle: SBBTheme.allStates(
style.userMenuTextStyle,
),
Expand Down
1 change: 1 addition & 0 deletions lib/src/responsive/sbb_responsive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
///
/// may be used for static bool usage or as a layout builder
/// with mobile, tablet and desktop option
@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBResponsive extends StatelessWidget {
const SBBResponsive({
Key? key,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/sidebar/sbb_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import '../../design_system_flutter.dart';
/// The SBB Sidebar. Use according to documentation.
///
/// See: https://digital.sbb.ch/de/webapps/modules/sidebar
@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBSidebar extends StatelessWidget {
const SBBSidebar({
Key? key,
Expand Down Expand Up @@ -75,6 +76,7 @@ class SBBSidebar extends StatelessWidget {
}
}

@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBSidebarItem extends StatefulWidget {
const SBBSidebarItem({
required this.title,
Expand Down

0 comments on commit 1ed7a98

Please sign in to comment.