Skip to content

Commit b13242d

Browse files
parloughsfshaza2
andauthored
Show full Dart SDK version for beta releases in the archive (#12604)
Includes the full Dart SDK build in the Flutter SDK archive table for beta releases. Resolves #12580 **Staged:** https://flutter-docs-prod--pr12604-fix-12580-mhna4o14.web.app/install/archive#beta-channel Co-authored-by: Shams Zakhour <[email protected]>
1 parent 8107838 commit b13242d

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

site/lib/src/components/pages/archive_table.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class _ArchiveTableState extends State<ArchiveTable> {
8686
th([text('Flutter version')]),
8787
th([text('Architecture')]),
8888
th([text('Ref')]),
89-
th(classes: 'date', [text('Release Date')]),
89+
th(classes: 'date', [text('Release date')]),
9090
th([text('Dart version')]),
9191
th([text('Provenance')]),
9292
]),

site/lib/src/models/flutter_release_model.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import 'package:universal_web/js_interop.dart';
99

1010
/// Represents a Flutter release loaded from the Flutter releases endpoint.
1111
class FlutterRelease {
12+
static final RegExp _dartSdkBuildPattern = RegExp(r'\(build\s(.*?)\)');
13+
1214
FlutterRelease({
1315
required this.url,
1416
required this.version,
@@ -20,12 +22,18 @@ class FlutterRelease {
2022
});
2123

2224
factory FlutterRelease.fromJson(Map<String, Object?> json, String baseUrl) {
25+
final dartSdkVersion = switch (json['dart_sdk_version']) {
26+
final String rawDartSdkVersion when rawDartSdkVersion.isNotEmpty =>
27+
_dartSdkBuildPattern.firstMatch(rawDartSdkVersion)?.group(1) ??
28+
rawDartSdkVersion.trim(),
29+
_ => '-',
30+
};
31+
2332
return FlutterRelease(
2433
url: '$baseUrl/${json['archive'] as String}',
2534
version: json['version'] as String,
2635
channel: json['channel'] as String,
27-
dartSdkVersion:
28-
(json['dart_sdk_version'] as String?)?.split(' ')[0] ?? '-',
36+
dartSdkVersion: dartSdkVersion,
2937
architecture: (json['dart_sdk_arch'] as String?) ?? 'x64',
3038
hash: (json['hash'] as String).substring(0, 7),
3139
releaseDate: Date(Date.parse(json['release_date'] as String)),

site/lib/src/style_hash.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// dart format off
33

44
/// The generated hash of the `main.css` file.
5-
const generatedStylesHash = 'ugxj95DjrnBJ';
5+
const generatedStylesHash = 'nvTevrLjFn98';

0 commit comments

Comments
 (0)