mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-15 12:19:40 +08:00
* Adding a proposal for new tutorials * fixing and improving the text a little bit * formating and lints * copy button and few improvements * adding super.render on position component * fixing dashbook dependency * Apply suggestions from code review Co-authored-by: Luan Nico <luanpotter27@gmail.com> * pr suggestions * Apply suggestions from code review Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com> * suggestions * fixing wrong merge * reverting analysis options * Update tutorials/space_shooter/lib/steps/1_getting_started/1_flame_game/code.dart Co-authored-by: Luan Nico <luanpotter27@gmail.com> * Update tutorials/space_shooter/lib/steps/1_getting_started/1_flame_game/step.dart * Update tutorials/space_shooter/README.md * Update tutorials/space_shooter/lib/steps/1_getting_started/2_input_and_graphics/tutorial.dart * Update tutorials/space_shooter/lib/steps/1_getting_started/2_input_and_graphics/tutorial.dart * Update tutorials/space_shooter/lib/steps/1_getting_started/2_input_and_graphics/tutorial.dart * Update tutorials/space_shooter/lib/widgets/step_scaffold.dart Co-authored-by: Luan Nico <luanpotter27@gmail.com> * Update tutorials/space_shooter/lib/steps/1_getting_started/1_flame_game/step.dart * Fix formatting * Update to 0.1.5 dashbook * Fix wrong class name RunningFlameStep * Use magic flame_lint * Fix paint and rect in player class description Co-authored-by: Luan Nico <luanpotter27@gmail.com> Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com> Co-authored-by: Lukas Klingsbo (spydon) <me@lukas.fyi>
69 lines
1.9 KiB
Dart
69 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
|
import 'package:markdown/markdown.dart' as md;
|
|
|
|
import 'code_block.dart';
|
|
|
|
class StepScaffold extends StatelessWidget {
|
|
final List<String> tutorial;
|
|
final Widget game;
|
|
|
|
const StepScaffold({
|
|
Key? key,
|
|
required this.tutorial,
|
|
required this.game,
|
|
}) : super(key: key);
|
|
|
|
@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,
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|