Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release college algebra with Python #1308

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'];
Loading