mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 20:13:50 +08:00
This upgrades all packages to Flutter 3.0.0 and fixes all analyze issues that came from that.
69 lines
2.0 KiB
Dart
69 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
|
import 'package:markdown/markdown.dart' as md;
|
|
|
|
import 'package:tutorials_space_shooter/widgets/code_block.dart';
|
|
|
|
class StepScaffold extends StatelessWidget {
|
|
final List<String> tutorial;
|
|
final Widget game;
|
|
|
|
const StepScaffold({
|
|
super.key,
|
|
required this.tutorial,
|
|
required this.game,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return DefaultTabController(
|
|
length: 2,
|
|
child: Scaffold(
|
|
appBar: AppBar(
|
|
bottom: const TabBar(
|
|
tabs: [
|
|
Tab(text: 'Tutorial'),
|
|
Tab(text: 'Running example'),
|
|
],
|
|
),
|
|
),
|
|
body: TabBarView(
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(22.0),
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
children: tutorial.map(
|
|
(text) {
|
|
if (text.startsWith('```')) {
|
|
return CodeBlock(value: text);
|
|
} else {
|
|
return Align(
|
|
alignment: Alignment.topLeft,
|
|
child: MarkdownBody(
|
|
data: text,
|
|
selectable: true,
|
|
extensionSet: md.ExtensionSet(
|
|
md.ExtensionSet.gitHubFlavored.blockSyntaxes,
|
|
[
|
|
md.EmojiSyntax(),
|
|
...md
|
|
.ExtensionSet.gitHubFlavored.inlineSyntaxes,
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
},
|
|
).toList(),
|
|
),
|
|
),
|
|
),
|
|
game,
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|