Skip to content

Commit

Permalink
Remove build_context package (#55)
Browse files Browse the repository at this point in the history
The `build_context` is the reason why our builds are failing:
https://github.com/SharezoneApp/website/actions/runs/5942916196/job/16116942873.
Because there is no new version of `build_context` I just removed the
package from our codebase.
  • Loading branch information
nilsreichardt authored Aug 23, 2023
1 parent e75d521 commit 3c6e5f1
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 24 deletions.
6 changes: 2 additions & 4 deletions website/lib/footer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import 'widgets/section.dart';
import 'widgets/section_action_button.dart';
import 'widgets/sharezone_logo.dart';

import "package:build_context/build_context.dart";

class Footer extends StatelessWidget {
const Footer({super.key});

Expand All @@ -22,7 +20,7 @@ class Footer extends StatelessWidget {
return RepaintBoundary(
key: const ValueKey('footer'),
child: Container(
color: context.primaryColor,
color: Theme.of(context).primaryColor,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 48),
child: Section(
Expand Down Expand Up @@ -341,7 +339,7 @@ class _SocialMediaButton extends StatelessWidget {
padding: const EdgeInsets.all(8),
child: SvgPicture.asset(
"assets/icons/$lowerCasePlatform.svg",
color: context.primaryColor,
color: Theme.of(context).primaryColor,
),
),
),
Expand Down
5 changes: 2 additions & 3 deletions website/lib/home/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import "package:build_context/build_context.dart";

import '../page.dart';
import 'src/all_in_one_platform.dart';
Expand All @@ -14,11 +13,11 @@ const tabHeight = 57;
const maxWidthConstraint = 1200.0;

bool isTablet(BuildContext context) {
return context.mediaQuerySize.width < 950;
return MediaQuery.of(context).size.width < 950;
}

bool isPhone(BuildContext context) {
return context.mediaQuerySize.width < 650;
return MediaQuery.of(context).size.width < 650;
}

class HomePage extends StatelessWidget {
Expand Down
3 changes: 1 addition & 2 deletions website/lib/home/src/welcome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:flutter_svg/svg.dart';
import 'package:sharezone_website/widgets/section.dart';
import "package:build_context/build_context.dart";

import '../../main.dart';
import '../home_page.dart';
Expand All @@ -13,7 +12,7 @@ class Welcome extends StatelessWidget {
@override
Widget build(BuildContext context) {
final height =
context.mediaQuerySize.height * (isTablet(context) ? 0.05 : 0.1);
MediaQuery.of(context).size.height * (isTablet(context) ? 0.05 : 0.1);
return Section(
child: Column(
children: <Widget>[
Expand Down
5 changes: 2 additions & 3 deletions website/lib/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:sharezone_website/utils.dart';
import 'package:sharezone_website/widgets/column_spacing.dart';

import 'footer.dart';
import "package:build_context/build_context.dart";
import 'home/home_page.dart';
import 'widgets/max_width_constraint_box.dart';
import 'widgets/sharezone_logo.dart';
Expand Down Expand Up @@ -105,7 +104,7 @@ class _AppBarTitle extends StatelessWidget implements PreferredSizeWidget {
if (isPhone(context))
IconButton(
icon: const Icon(Icons.menu),
onPressed: () => context.openDrawer(),
onPressed: () => Scaffold.of(context).openDrawer(),
)
else
TransparentButton(
Expand Down Expand Up @@ -164,7 +163,7 @@ class _GoWebAppButton extends StatelessWidget {
borderRadius: borderRaius,
child: Material(
borderRadius: borderRaius,
color: context.primaryColor,
color: Theme.of(context).primaryColor,
child: const Padding(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 18),
child: Align(
Expand Down
5 changes: 2 additions & 3 deletions website/lib/widgets/section_action_button.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:flutter/material.dart';
import "package:build_context/build_context.dart";

import '../utils.dart';
import '../extensions/hover_extensions.dart';
import '../utils.dart';
import 'transparent_button.dart';

class SectionActionButton extends StatelessWidget {
Expand Down Expand Up @@ -36,7 +35,7 @@ class SectionActionButton extends StatelessWidget {
child: TransparentButton(
onTap: onTap,
fontSize: fontSize ?? 22,
color: color ?? context.primaryColor,
color: color ?? Theme.of(context).primaryColor,
child: Text("—> $text"),
).moveLeftOnHover,
);
Expand Down
8 changes: 0 additions & 8 deletions website/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
build_context:
dependency: "direct main"
description:
name: build_context
sha256: "28c6580a91572f89cd9c8c80ac37102b71a4196b62759df934f1dd6ee427a377"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
characters:
dependency: transitive
description:
Expand Down
1 change: 0 additions & 1 deletion website/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ environment:

dependencies:
url_launcher: ^6.0.9
build_context: ^3.0.0
flutter_svg: ^0.22.0
flutter_markdown: ^0.6.2
flutter_staggered_animations: ^1.0.0
Expand Down

0 comments on commit 3c6e5f1

Please sign in to comment.