Skip to content

Commit

Permalink
chore: add labels sync action (#69)
Browse files Browse the repository at this point in the history
* chore: add labels sync action

* fix example issues

* kicking the CI

* fix: tom shouldn't copy paste code from me when I am tired

---------

Co-authored-by: Jochum van der Ploeg <[email protected]>
  • Loading branch information
tomarra and wolfenrain authored Mar 26, 2024
1 parent 827a911 commit 61ef81f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 20 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/sync_labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: ♻️ Sync Labels

on:
push:
paths:
- .github/labels.yml
branches:
- main
workflow_dispatch:

jobs:
labels:
name: ♻️ Sync labels
runs-on: ubuntu-20.04
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4

- name: 🚀 Run Label Sync
uses: srealmoreno/label-sync-action@v1
with:
config-file: https://raw.githubusercontent.com/VeryGoodOpenSource/.github/main/.github/labels.yml
46 changes: 26 additions & 20 deletions example/lib/ui/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ class HomeScreen extends StatefulWidget {

class _HomeScreenState extends State<HomeScreen> {
Future<void> _showPincodeScreen(BuildContext context) async {
final scaffoldMessenger = ScaffoldMessenger.of(context);
final result = await Navigator.of(context).push(PincodeScreen.route());

if (!mounted) {
return;
}

late final String snackBarContent;

if (result == null) {
Expand All @@ -21,21 +26,24 @@ class _HomeScreenState extends State<HomeScreen> {
snackBarContent = 'Pincode is "$result" 🔒';
}

if (mounted) {
ScaffoldMessenger.of(context)
..removeCurrentSnackBar()
..showSnackBar(
SnackBar(
behavior: SnackBarBehavior.floating,
content: Text(snackBarContent),
),
);
}
scaffoldMessenger
..removeCurrentSnackBar()
..showSnackBar(
SnackBar(
behavior: SnackBarBehavior.floating,
content: Text(snackBarContent),
),
);
}

Future<void> _showQuizDialog(BuildContext context) async {
final scaffoldMessenger = ScaffoldMessenger.of(context);
final result = await QuizDialog.show(context);

if (!mounted) {
return;
}

late final String snackBarContent;

if (result == null) {
Expand All @@ -46,16 +54,14 @@ class _HomeScreenState extends State<HomeScreen> {
snackBarContent = 'Hamburger all the way! 🍔';
}

if (mounted) {
ScaffoldMessenger.of(context)
..removeCurrentSnackBar()
..showSnackBar(
SnackBar(
behavior: SnackBarBehavior.floating,
content: Text(snackBarContent),
),
);
}
scaffoldMessenger
..removeCurrentSnackBar()
..showSnackBar(
SnackBar(
behavior: SnackBarBehavior.floating,
content: Text(snackBarContent),
),
);
}

@override
Expand Down

0 comments on commit 61ef81f

Please sign in to comment.