Skip to content

Commit

Permalink
feat: add standard deprecation hints for all web components (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
smallTrogdor authored Jun 21, 2024
1 parent 7a5ba87 commit a4b6085
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 26 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ It is expected that you keep this format strictly, since we depend on it in our

## [Unreleased]

### Deprecated

- (#142) Deprecated Web Components:
- `SBBStatus`
- `SBBWebLogo`
- `SBBLeanTextStyles`
- `SBBWebText`
- `SBBWebTextStyles`
- `SBBBreadcrumb`

## [1.4.0] - 2024-06-07

### Added
Expand Down
4 changes: 4 additions & 0 deletions lib/src/breadcrumb/sbb_breadcrumb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import '../../design_system_flutter.dart';
/// https://digital.sbb.ch/de/webapps/components/breadcrumb
///
///
@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBBreadcrumb extends StatelessWidget {
@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBBreadcrumb({
Key? key,
this.leading,
Expand Down Expand Up @@ -112,7 +114,9 @@ class _InheritedBreadcrumbStyle extends InheritedWidget {
}
}

@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBBreadcrumbItem extends StatefulWidget {
@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBBreadcrumbItem({
Key? key,
required this.child,
Expand Down
1 change: 1 addition & 0 deletions lib/src/logo/sbb_logo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class SBBLogo extends StatelessWidget {
/// creates SBB Logo
///
/// respects parent's size and scales accordingly
@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBWebLogo extends StatelessWidget {
const SBBWebLogo({
Key? key,
Expand Down
22 changes: 13 additions & 9 deletions lib/src/notification/sbb_web_notification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const _kVerticalPadding = 12.0;
const _kHorizontalPadding = 16.0;
const _kScrollingDuration = Duration(milliseconds: 600);

@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBWebNotification extends StatefulWidget {
@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBWebNotification.confirmation(
this.text, {
Key? key,
Expand All @@ -18,7 +20,7 @@ class SBBWebNotification extends StatefulWidget {
this.jumpMarks,
this.expand = false,
}) : super(key: key);

@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBWebNotification.hint(
this.text, {
Key? key,
Expand All @@ -29,7 +31,7 @@ class SBBWebNotification extends StatefulWidget {
this.jumpMarks,
this.expand = false,
}) : super(key: key);

@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBWebNotification.warning(
this.text, {
Key? key,
Expand All @@ -40,7 +42,7 @@ class SBBWebNotification extends StatefulWidget {
this.jumpMarks,
this.expand = false,
}) : super(key: key);

@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBWebNotification.error(
this.text, {
Key? key,
Expand Down Expand Up @@ -123,6 +125,13 @@ class _SBBWebNotificationState extends State<SBBWebNotification>
axisAlignment: 1.0,
sizeFactor: animation,
child: Container(
decoration: BoxDecoration(
color: widget.backgroundColor,
borderRadius:
const BorderRadius.all(Radius.circular(_kBorderRadius)),
border: widget.borderColor != null
? Border.all(color: widget.borderColor!)
: null),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: _kHorizontalPadding, vertical: _kVerticalPadding),
Expand Down Expand Up @@ -165,17 +174,12 @@ class _SBBWebNotificationState extends State<SBBWebNotification>
],
),
),
decoration: BoxDecoration(
color: widget.backgroundColor,
borderRadius: BorderRadius.all(Radius.circular(_kBorderRadius)),
border: widget.borderColor != null
? Border.all(color: widget.borderColor!)
: null),
),
);
}
}

@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBJumpMark extends StatelessWidget {
const SBBJumpMark({Key? key, required this.text, required this.keyToScrollTo})
: super(key: key);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/status/sbb_status.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';

const _kBorderRadius = 2.0;

@Deprecated('will soon be moved to the web package')
@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBStatus extends StatelessWidget {
const SBBStatus.valid({
Key? key,
Expand Down
36 changes: 20 additions & 16 deletions lib/src/theme/sbb_typography.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,41 +99,42 @@ class SBBTextStyles {
);
}

@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBLeanTextStyles {
SBBLeanTextStyles._();

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle headerTitle = TextStyle(
fontSize: 15.0,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontFamily: SBBWebFont,
color: SBBColors.black,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle headerSubtitle = TextStyle(
fontSize: 13.0,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w300,
fontFamily: SBBWebFont,
color: SBBColors.metal,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle contextMenu = TextStyle(
fontSize: 15.0,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontFamily: SBBWebFont,
color: SBBColors.iron,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle userMenuInitials = TextStyle(
fontSize: 10.0,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w700,
fontFamily: SBBWebFont,
color: SBBColors.metal,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle breadcrumb = TextStyle(
fontSize: 13.0,
fontStyle: FontStyle.normal,
Expand All @@ -142,6 +143,7 @@ class SBBLeanTextStyles {
);
}

@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBWebTextStyles {
SBBWebTextStyles._();

Expand Down Expand Up @@ -177,7 +179,7 @@ class SBBWebTextStyles {
height: 19.0 / 16.0,
color: SBBColors.black,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle _running = TextStyle(
fontSize: 15.0,
fontStyle: FontStyle.normal,
Expand All @@ -186,43 +188,43 @@ class SBBWebTextStyles {
height: 23.0 / 15.0,
color: SBBColors.black,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle medium = TextStyle(
fontSize: 15.0,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontFamily: SBBWebFont,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle small = TextStyle(
fontSize: 13.0,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontFamily: SBBWebFont,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle extraSmallBold = TextStyle(
fontSize: 10.0,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w700,
fontFamily: SBBWebFont,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle mediumLight = TextStyle(
fontSize: 15.0,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w300,
fontFamily: SBBWebFont,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle dropdownLabel = TextStyle(
fontSize: 13.0,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontFamily: SBBWebFont,
color: SBBColors.granite,
);

@Deprecated('FlutterWeb will not be supported from the next major release.')
static const TextStyle accordionHeader = TextStyle(
fontSize: 21.0,
fontStyle: FontStyle.normal,
Expand All @@ -232,7 +234,9 @@ class SBBWebTextStyles {
);
}

@Deprecated('FlutterWeb will not be supported from the next major release.')
class SBBWebText extends StatelessWidget {
@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBWebText.headerOne(
this.data, {
Key? key,
Expand All @@ -242,7 +246,7 @@ class SBBWebText extends StatelessWidget {
top: SBBWebDivider.big, bottom: SBBWebDivider.medium),
this.selectable = false,
}) : super(key: key);

@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBWebText.headerTwo(
this.data, {
Key? key,
Expand All @@ -252,7 +256,7 @@ class SBBWebText extends StatelessWidget {
top: SBBWebDivider.medium, bottom: SBBWebDivider.small),
this.selectable = false,
}) : super(key: key);

@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBWebText.headerThree(
this.data, {
Key? key,
Expand All @@ -262,7 +266,7 @@ class SBBWebText extends StatelessWidget {
top: SBBWebDivider.small, bottom: SBBWebDivider.thin),
this.selectable = false,
}) : super(key: key);

@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBWebText.headerFour(
this.data, {
Key? key,
Expand All @@ -272,7 +276,7 @@ class SBBWebText extends StatelessWidget {
top: SBBWebDivider.small, bottom: SBBWebDivider.thin),
this.selectable = false,
}) : super(key: key);

@Deprecated('FlutterWeb will not be supported from the next major release.')
const SBBWebText.running(
this.data, {
Key? key,
Expand Down

0 comments on commit a4b6085

Please sign in to comment.