Skip to content

Commit

Permalink
Revert "Changed to canvaskit web render"
Browse files Browse the repository at this point in the history
This reverts commit 27d2be4.
  • Loading branch information
reza00farjam committed Oct 3, 2023
1 parent 27d2be4 commit b5a13a2
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 190 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

# CI is set to false to prevent treating warnings as errors
- name: Build Flutter for Web
run: CI=false flutter build web --web-renderer canvaskit --release --no-tree-shake-icons
run: CI=false flutter build web --web-renderer html --release --no-tree-shake-icons

- name: Run Post-Build Script
run: |
Expand Down
64 changes: 27 additions & 37 deletions lib/app/views/professor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import 'package:cse_archive/app/widgets/header.dart';
import 'package:cse_archive/app/widgets/gap.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:image_network/image_network.dart';
import 'package:url_launcher/link.dart';

import 'loading.dart';
Expand All @@ -35,48 +34,39 @@ class ProfessorView extends GetView<ProfessorController> {
Widget build(BuildContext context) {
return controller.obx(
(_) {
const imageSize = 17 * kSizeDefault;

final imageBorderRadius = BorderRadius.circular(kSizeDefault / 2);

final noImage = DecoratedBox(
decoration: BoxDecoration(
borderRadius: imageBorderRadius,
border: Border.all(
width: 4,
color: context.primaryColor,
),
),
child: Center(
child: Icon(
ArchiveIcons.photoOff,
size: 5 * kSizeDefault,
color: context.primaryColor,
),
),
final departmentLabel = ArchiveLabel(
title: ArchiveStrings.professorDepartment,
value: controller.professor!.department.representation,
);

final image = ArchiveCard(
width: imageSize,
height: imageSize,
width: 17 * kSizeDefault,
height: 17 * kSizeDefault,
onPressed: null,
child: (controller.professor!.image != null)
? ImageNetwork(
duration: 0,
width: imageSize,
height: imageSize,
borderRadius: imageBorderRadius,
image: controller.professor!.image.toString(),
onError: noImage,
onLoading:
CircularProgressIndicator(color: context.primaryColor),
? ClipRRect(
borderRadius: BorderRadius.circular(kSizeDefault / 2),
child: Image.network(
controller.professor!.image.toString(),
fit: BoxFit.cover,
),
)
: noImage,
);

final departmentLabel = ArchiveLabel(
title: ArchiveStrings.professorDepartment,
value: controller.professor!.department.representation,
: DecoratedBox(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(kSizeDefault / 2),
border: Border.all(
width: 4,
color: context.primaryColor,
),
),
child: Center(
child: Icon(
ArchiveIcons.photoOff,
size: 5 * kSizeDefault,
color: context.primaryColor,
),
),
),
);

final nameColumn = Align(
Expand Down
59 changes: 24 additions & 35 deletions lib/app/views/reference.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import 'package:cse_archive/app/widgets/path.dart';
import 'package:cse_archive/app/widgets/web_page/web_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:image_network/image_network.dart';
import 'package:url_launcher/link.dart';

import 'loading.dart';
Expand All @@ -39,44 +38,34 @@ class ReferenceView extends GetView<ReferenceController> {
(_) {
final reference = controller.reference!;

const imageWidth = 17 * kSizeDefault;
const imageHeight = 20 * kSizeDefault;

final imageBorderRadius = BorderRadius.circular(kSizeDefault / 2);

final noImage = DecoratedBox(
decoration: BoxDecoration(
borderRadius: imageBorderRadius,
border: Border.all(
width: 4,
color: context.primaryColor,
),
),
child: Center(
child: Icon(
ArchiveIcons.photoOff,
size: 5 * kSizeDefault,
color: context.primaryColor,
),
),
);

final image = ArchiveCard(
onPressed: null,
width: imageWidth,
height: imageHeight,
width: 17 * kSizeDefault,
height: 20 * kSizeDefault,
child: (reference.image != null)
? ImageNetwork(
duration: 0,
width: imageWidth,
height: imageHeight,
borderRadius: imageBorderRadius,
image: reference.image.toString(),
onError: noImage,
onLoading:
CircularProgressIndicator(color: context.primaryColor),
? ClipRRect(
borderRadius: BorderRadius.circular(kSizeDefault / 2),
child: Image.network(
reference.image.toString(),
fit: BoxFit.cover,
),
)
: noImage,
: DecoratedBox(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(kSizeDefault / 2),
border: Border.all(
width: 4,
color: context.primaryColor,
),
),
child: Center(
child: Icon(
ArchiveIcons.photoOff,
size: 5 * kSizeDefault,
color: context.primaryColor,
),
),
),
);

final typeLabel = ArchiveLabel(
Expand Down
51 changes: 22 additions & 29 deletions lib/app/widgets/professor_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:cse_archive/app/models/professor.dart';
import 'package:cse_archive/app/routes/routes.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:image_network/image_network.dart';

import 'gap.dart';
import 'card.dart';
Expand All @@ -24,23 +23,6 @@ class ArchiveProfessorCard extends StatelessWidget {

@override
Widget build(BuildContext context) {
const imageSize = 6 * kSizeDefault;

final noImage = Container(
width: imageSize,
height: imageSize,
decoration: BoxDecoration(
border: Border.all(color: context.secondaryColor),
),
child: Center(
child: Icon(
ArchiveIcons.photoOff,
size: 2 * kSizeDefault,
color: context.secondaryColor,
),
),
);

return ArchiveCard(
width: width,
color: context.primaryColor,
Expand Down Expand Up @@ -75,17 +57,28 @@ class ArchiveProfessorCard extends StatelessWidget {
),
),
const Gap.horizontal(kSizeDefault),
(professor.image != null)
? ImageNetwork(
duration: 0,
width: imageSize,
height: imageSize,
image: professor.image.toString(),
onError: noImage,
onLoading:
CircularProgressIndicator(color: context.secondaryColor),
)
: noImage,
Container(
width: 6 * kSizeDefault,
height: 6 * kSizeDefault,
decoration: BoxDecoration(
image: (professor.image != null)
? DecorationImage(
image: NetworkImage(professor.image.toString()),
fit: BoxFit.cover,
)
: null,
border: Border.all(color: context.secondaryColor),
),
child: (professor.image != null)
? null
: Center(
child: Icon(
ArchiveIcons.photoOff,
size: 2 * kSizeDefault,
color: context.secondaryColor,
),
),
),
],
),
);
Expand Down
51 changes: 22 additions & 29 deletions lib/app/widgets/reference_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:cse_archive/app/models/reference.dart';
import 'package:cse_archive/app/routes/routes.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:image_network/image_network.dart';

import 'gap.dart';
import 'card.dart';
Expand All @@ -23,23 +22,6 @@ class ArchiveReferenceCard extends StatelessWidget {

@override
Widget build(BuildContext context) {
const imageSize = 6 * kSizeDefault;

final noImage = Container(
width: imageSize,
height: imageSize,
decoration: BoxDecoration(
border: Border.all(color: context.secondaryColor),
),
child: Center(
child: Icon(
ArchiveIcons.photoOff,
size: 2 * kSizeDefault,
color: context.secondaryColor,
),
),
);

return ArchiveCard(
width: width,
color: context.primaryColor,
Expand Down Expand Up @@ -82,17 +64,28 @@ class ArchiveReferenceCard extends StatelessWidget {
),
),
const Gap.horizontal(kSizeDefault),
(reference.image != null)
? ImageNetwork(
duration: 0,
width: imageSize,
height: imageSize,
image: reference.image.toString(),
onError: noImage,
onLoading:
CircularProgressIndicator(color: context.secondaryColor),
)
: noImage,
Container(
width: 6 * kSizeDefault,
height: 6 * kSizeDefault,
decoration: BoxDecoration(
image: (reference.image != null)
? DecorationImage(
image: NetworkImage(reference.image.toString()),
fit: BoxFit.cover,
)
: null,
border: Border.all(color: context.secondaryColor),
),
child: (reference.image != null)
? null
: Center(
child: Icon(
ArchiveIcons.photoOff,
size: 2 * kSizeDefault,
color: context.secondaryColor,
),
),
),
],
),
);
Expand Down
60 changes: 2 additions & 58 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.2"
image_network:
dependency: "direct main"
description:
name: image_network
sha256: "49198112851e48e9f38a44016df4f97a8db3fbfe9ae0c2d1aafa87ba9dcddec8"
url: "https://pub.dev"
source: hosted
version: "2.5.4+1"
intl:
dependency: "direct main"
description:
Expand Down Expand Up @@ -317,14 +309,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.5"
pointer_interceptor:
dependency: transitive
description:
name: pointer_interceptor
sha256: "7626e034489820fd599380d2bb4d3f4a0a5e3529370b62bfce53ab736b91adb2"
url: "https://pub.dev"
source: hosted
version: "0.9.3+6"
rive:
dependency: "direct main"
description:
Expand Down Expand Up @@ -586,46 +570,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
webview_flutter:
dependency: transitive
description:
name: webview_flutter
sha256: c1ab9b81090705c6069197d9fdc1625e587b52b8d70cdde2339d177ad0dbb98e
url: "https://pub.dev"
source: hosted
version: "4.4.1"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
sha256: b0cd33dd7d3dd8e5f664e11a19e17ba12c352647269921a3b568406b001f1dff
url: "https://pub.dev"
source: hosted
version: "3.12.0"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
sha256: "6d9213c65f1060116757a7c473247c60f3f7f332cac33dc417c9e362a9a13e4f"
url: "https://pub.dev"
source: hosted
version: "2.6.0"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
sha256: "30b9af6bdd457b44c08748b9190d23208b5165357cc2eb57914fee1366c42974"
url: "https://pub.dev"
source: hosted
version: "3.9.1"
webviewimage:
dependency: transitive
description:
name: webviewimage
sha256: f6da2a7bfc3e67f330e8551c13c10a16aa3100a0d46e44c5484978a63ca5d62d
url: "https://pub.dev"
source: hosted
version: "0.0.4"
win32:
dependency: transitive
description:
Expand All @@ -651,5 +595,5 @@ packages:
source: hosted
version: "6.3.0"
sdks:
dart: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.10.0"
Loading

0 comments on commit b5a13a2

Please sign in to comment.