Skip to content

Commit

Permalink
feat: release college algebra with Python (#1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sembauke authored Dec 23, 2024
1 parent 3b260c4 commit ae7d012
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
19 changes: 9 additions & 10 deletions mobile-app/lib/ui/views/learn/block/block_view.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import 'package:flutter/material.dart';
import 'package:freecodecamp/extensions/i18n_extension.dart';
import 'package:freecodecamp/models/learn/curriculum_model.dart';

import 'package:freecodecamp/service/learn/learn_service.dart';
import 'package:freecodecamp/ui/views/learn/block/block_viewmodel.dart';
import 'package:freecodecamp/ui/views/learn/utils/learn_globals.dart';
import 'package:freecodecamp/ui/views/learn/widgets/download_button_widget.dart';
import 'package:freecodecamp/ui/views/learn/widgets/open_close_icon_widget.dart';
import 'package:freecodecamp/ui/views/learn/widgets/progressbar_widget.dart';
import 'package:freecodecamp/ui/widgets/drawer_widget/drawer_widget_view.dart';

import 'package:stacked/stacked.dart';

class BlockView extends StatelessWidget {
Expand Down Expand Up @@ -38,8 +37,8 @@ class BlockView extends StatelessWidget {
model,
child,
) {
bool isCertification = block.challenges.length == 1 &&
block.superBlock.dashedName != 'the-odin-project';
bool isCert = block.challenges.length == 1 &&
!hasNoCert.contains(block.superBlock.dashedName);

bool isDialogue =
block.superBlock.dashedName == 'a2-english-for-developers';
Expand All @@ -52,7 +51,7 @@ class BlockView extends StatelessWidget {
return Column(
children: [
BlockHeader(
isCertification: isCertification,
isCertification: isCert,
block: block,
model: model,
),
Expand All @@ -61,11 +60,11 @@ class BlockView extends StatelessWidget {
block: block,
model: model,
),
if (model.isOpen || isCertification)
if (model.isOpen || isCert)
Container(
color: const Color(0xFF0a0a23),
child: InkWell(
onTap: isCertification
onTap: isCert
? () async {
model.routeToCertification(block);
}
Expand All @@ -89,7 +88,7 @@ class BlockView extends StatelessWidget {
),
),
),
if (model.isDev && !isCertification)
if (model.isDev && !isCert)
DownloadButton(
model: model,
block: block,
Expand All @@ -102,11 +101,11 @@ class BlockView extends StatelessWidget {
model,
)
],
if (!isCertification && isStepBased && !isDialogue) ...[
if (!isCert && isStepBased && !isDialogue) ...[
buildDivider(),
gridWidget(context, model)
],
if (!isStepBased && !isCertification) ...[
if (!isStepBased && !isCert) ...[
buildDivider(),
listWidget(context, model)
],
Expand Down
5 changes: 5 additions & 0 deletions mobile-app/lib/ui/views/learn/utils/learn_globals.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
library global_learn;

// Changing values in this file will require a hot restart to take effect

List<String> hasNoCert = ['the-odin-project', 'college-algebra-with-python'];

0 comments on commit ae7d012

Please sign in to comment.