Skip to content

Commit

Permalink
Optimize CI and update docs for context fetch
Browse files Browse the repository at this point in the history
Refined CI workflow by correcting npm cache permissions, ensuring smooth
dependency installation, and removing redundant Node.js update step to
enhance build speed and reliability. Furthermore, augmented
documentation in the UI component to clarify the retrieval and expected
presence of the Resources widget within the EthicalScannerApp context,
enforcing the widget's availability and preventing runtime errors.
  • Loading branch information
Turskyi committed Jan 5, 2024
1 parent 9fef17c commit 7cebcad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/flutter_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ jobs:
needs: [ build_apk ]
runs-on: ubuntu-latest
steps:
- name: Fix npm cache permissions
run: sudo chown -R 65534:0 "/root/.npm"

- name: Checkout Repository
uses: actions/checkout@v1

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '12'

- name: Install dependencies
run: npm install
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
Expand All @@ -63,11 +76,6 @@ jobs:
with:
name: apk-build

- name: Update Node.js
uses: actions/setup-node@v3
with:
node-version: '14'

- name: Upload APK
uses: wzieba/[email protected]
with:
Expand Down
8 changes: 7 additions & 1 deletion components/interface_adapters/lib/src/ui/res/resources.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:interface_adapters/src/ui/app/ethical_scanner_app.dart';
import 'package:interface_adapters/src/ui/res/color/gradients.dart';

class Resources extends InheritedWidget {
Expand All @@ -13,6 +14,11 @@ class Resources extends InheritedWidget {
@override
bool updateShouldNotify(covariant InheritedWidget oldWidget) => false;

/// Returns the nearest [Resources] widget in the ancestor tree of [context].
///
/// This method asserts that the result is not `null`, as we expect the
/// [Resources] widget to be always present in the [EthicalScannerApp].
/// If the [Resources] widget is not found, a runtime exception is thrown.
static Resources of(BuildContext context) =>
context.dependOnInheritedWidgetOfExactType(aspect: Resources)!;
context.dependOnInheritedWidgetOfExactType<Resources>()!;
}

0 comments on commit 7cebcad

Please sign in to comment.