Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Remove deprecated course module #149

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
32 changes: 23 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ on:
push:
pull_request:
schedule:
- cron: "0 8 * * *"
- cron: "0 4 * * *"

env:
JAVA_VERSION: 12.x
FLUTTER_CHANNEL: stable
FLUTTER_VERSION: 1.17.x

jobs:
install:
Expand All @@ -17,11 +22,12 @@ jobs:
- name: Install Java
uses: actions/setup-java@v1
with:
java-version: "12.x"
- name: Install Flutter (beta)
java-version: ${{ env.JAVA_VERSION }}
- name: Install Flutter (stable)
uses: subosito/flutter-action@v1
with:
flutter-version: 1.12.13+hotfix.9
channel: ${{ env.FLUTTER_CHANNEL }}
version: ${{ env.FLUTTER_VERSION }}

- name: Install dependencies
run: flutter pub get
Expand Down Expand Up @@ -62,18 +68,22 @@ jobs:
- name: Install Java
uses: actions/setup-java@v1
with:
java-version: "12.x"
java-version: ${{ env.JAVA_VERSION }}
- name: Install Flutter (stable)
uses: subosito/flutter-action@v1
with:
flutter-version: 1.12.13+hotfix.9
channel: ${{ env.FLUTTER_CHANNEL }}
version: ${{ env.FLUTTER_VERSION }}

- name: Checkout source
uses: actions/download-artifact@v1
with:
name: source
path: .

- name: Install dependencies
run: flutter pub get

- name: Run linter
run: flutter analyze > flutter_analyze_report.txt
continue-on-error: true
Expand Down Expand Up @@ -105,22 +115,26 @@ jobs:
- name: Install Java
uses: actions/setup-java@v1
with:
java-version: "12.x"
java-version: ${{ env.JAVA_VERSION }}
- name: Install Flutter (stable)
uses: subosito/flutter-action@v1
with:
flutter-version: 1.12.13+hotfix.9
channel: ${{ env.FLUTTER_CHANNEL }}
version: ${{ env.FLUTTER_VERSION }}

- name: Checkout source
uses: actions/download-artifact@v1
with:
name: source
path: .

- name: Install dependencies
run: flutter pub get

- run: flutter build apk --release

- name: Upload APK as artifact
uses: actions/upload-artifact@v2-preview
uses: actions/upload-artifact@v2
with:
name: apk
path: build/app/outputs/apk/release/app-release.apk
2 changes: 0 additions & 2 deletions lib/app/routing.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter_deep_linking/flutter_deep_linking.dart';
import 'package:hpi_flutter/course/course.dart';
import 'package:hpi_flutter/food/food.dart';
import 'package:hpi_flutter/myhpi/myhpi.dart';
import 'package:hpi_flutter/news/news.dart';
Expand Down Expand Up @@ -28,7 +27,6 @@ final router = Router(
Route(
matcher: Matcher.webHost(mdHost, isOptional: true),
routes: [
courseRoutes,
Route(
matcher: Matcher.path('dashboard'),
materialBuilder: (_, __) => DashboardPage(),
Expand Down
42 changes: 23 additions & 19 deletions lib/app/widgets/app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,11 @@ class _HpiFlexibleSpaceBarState extends State<HpiFlexibleSpaceBar> {
switch (theme.platform) {
case TargetPlatform.android:
case TargetPlatform.fuchsia:
case TargetPlatform.linux:
case TargetPlatform.windows:
return false;
case TargetPlatform.iOS:
case TargetPlatform.macOS:
return true;
}
// ignore: avoid_returning_null
Expand All @@ -284,7 +287,7 @@ class _HpiFlexibleSpaceBarState extends State<HpiFlexibleSpaceBar> {
if (effectiveCenterTitle) {
return Alignment.bottomCenter;
}
final TextDirection textDirection = context.directionality;
final textDirection = context.directionality;
assert(textDirection != null);
switch (textDirection) {
case TextDirection.rtl:
Expand All @@ -302,7 +305,7 @@ class _HpiFlexibleSpaceBarState extends State<HpiFlexibleSpaceBar> {
case CollapseMode.none:
return 0;
case CollapseMode.parallax:
final double deltaExtent = settings.maxExtent - settings.minExtent;
final deltaExtent = settings.maxExtent - settings.minExtent;
return -Tween<double>(begin: 0, end: deltaExtent / 4.0).transform(t);
}
// ignore: avoid_returning_null
Expand All @@ -311,14 +314,14 @@ class _HpiFlexibleSpaceBarState extends State<HpiFlexibleSpaceBar> {

@override
Widget build(BuildContext context) {
final FlexibleSpaceBarSettings settings =
final settings =
context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
assert(settings != null,
'A HpiFlexibleSpaceBar must be wrapped in the widget returned by HpiFlexibleSpaceBar.createSettings().');

final List<Widget> children = <Widget>[];
final children = <Widget>[];

final double deltaExtent = settings.maxExtent - settings.minExtent;
final deltaExtent = settings.maxExtent - settings.minExtent;

// 0.0 -> Expanded
// 1.0 -> Collapsed to toolbar
Expand All @@ -329,10 +332,10 @@ class _HpiFlexibleSpaceBarState extends State<HpiFlexibleSpaceBar> {

// background image
if (widget.background != null) {
final double fadeStart = math.max(0, 1.0 - kToolbarHeight / deltaExtent);
const double fadeEnd = 1;
final fadeStart = math.max(0, 1.0 - kToolbarHeight / deltaExtent);
const fadeEnd = 1.0;
assert(fadeStart <= fadeEnd);
final double opacity = 1.0 - Interval(fadeStart, fadeEnd).transform(t);
final opacity = 1.0 - Interval(fadeStart, fadeEnd).transform(t);
if (opacity > 0.0) {
children.add(Positioned(
top: _getCollapsePadding(t, settings),
Expand All @@ -348,41 +351,42 @@ class _HpiFlexibleSpaceBarState extends State<HpiFlexibleSpaceBar> {
}

if (widget.title != null) {
final ThemeData theme = context.theme;
final theme = context.theme;

Widget title;
switch (theme.platform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
title = widget.title;
break;
case TargetPlatform.fuchsia:
case TargetPlatform.android:
case TargetPlatform.fuchsia:
case TargetPlatform.linux:
case TargetPlatform.windows:
title = Semantics(
namesRoute: true,
child: widget.title,
);
}

final double opacity = settings.toolbarOpacity;
final opacity = settings.toolbarOpacity;
if (opacity > 0.0) {
TextStyle titleStyle = theme.primaryTextTheme.title;
var titleStyle = theme.primaryTextTheme.headline6;
titleStyle =
titleStyle.copyWith(color: titleStyle.color.withOpacity(opacity));
final bool effectiveCenterTitle = _getEffectiveCenterTitle(theme);
final EdgeInsetsGeometry padding = widget.titlePadding ??
final effectiveCenterTitle = _getEffectiveCenterTitle(theme);
final padding = widget.titlePadding ??
EdgeInsetsDirectional.only(
start: effectiveCenterTitle
? 0.0
: Tween<double>(begin: 16, end: 72).transform(t),
end: 32,
bottom: Tween<double>(begin: 16, end: 0).transform(t),
);
final double scaleValue =
Tween<double>(begin: 1.5, end: 1).transform(t);
final Matrix4 scaleTransform = Matrix4.identity()
final scaleValue = Tween<double>(begin: 1.5, end: 1).transform(t);
final scaleTransform = Matrix4.identity()
..scale(scaleValue, scaleValue, 1);
final Alignment titleAlignment =
_getTitleAlignment(t, effectiveCenterTitle);
final titleAlignment = _getTitleAlignment(t, effectiveCenterTitle);
children.add(
SafeArea(
child: Container(
Expand Down
2 changes: 1 addition & 1 deletion lib/app/widgets/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class DashboardFragment extends StatelessWidget {
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
child: DefaultTextStyle(
style: context.textTheme.title,
style: context.textTheme.headline6,
child: title,
),
),
Expand Down
23 changes: 12 additions & 11 deletions lib/app/widgets/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const _brandColorYellow = 0xFFF6A804;
ThemeData buildTheme(Brightness brightness) {
final isDark = brightness == Brightness.dark;

ThemeData theme = ThemeData(
var theme = ThemeData(
brightness: brightness,
applyElevationOverlayColor: isDark,
primarySwatch: _brandColorRedSwatch,
Expand All @@ -54,16 +54,17 @@ ThemeData buildTheme(Brightness brightness) {
);
theme = theme.copyWith(
textTheme: theme.textTheme.copyWith(
overline: theme.textTheme.overline.copyWith(
color: isDark ? Colors.white60 : Colors.black.withOpacity(0.6),
fontWeight: FontWeight.w500,
fontSize: 10,
letterSpacing: 1.5,
height: 1.6,
),
headline: theme.textTheme.headline.copyWith(
fontFamily: 'Neo Sans',
)),
headline5: theme.textTheme.headline5.copyWith(
fontFamily: 'Neo Sans',
),
overline: theme.textTheme.overline.copyWith(
color: isDark ? Colors.white60 : Colors.black.withOpacity(0.6),
fontWeight: FontWeight.w500,
fontSize: 10,
letterSpacing: 1.5,
height: 1.6,
),
),
);
var localizedTheme = ThemeData.localize(
theme,
Expand Down
4 changes: 2 additions & 2 deletions lib/app/widgets/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ Widget buildAppBarTitle({
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DefaultTextStyle(
style: context.textTheme.title.copyWith(
style: context.textTheme.headline6.copyWith(
color: Colors.black87,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
child: title,
),
DefaultTextStyle(
style: context.textTheme.subhead,
style: context.textTheme.subtitle1,
maxLines: 1,
overflow: TextOverflow.ellipsis,
child: subtitle,
Expand Down
2 changes: 1 addition & 1 deletion lib/core/widgets/preview_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PreviewBox extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
DefaultTextStyle(
style: context.textTheme.body1.copyWith(color: Colors.white),
style: context.textTheme.bodyText2.copyWith(color: Colors.white),
maxLines: 3,
overflow: TextOverflow.ellipsis,
child: title,
Expand Down
78 changes: 0 additions & 78 deletions lib/course/bloc.dart

This file was deleted.

2 changes: 0 additions & 2 deletions lib/course/course.dart

This file was deleted.

Loading