Skip to content

Commit

Permalink
Merge branch 'master' into master-web
Browse files Browse the repository at this point in the history
  • Loading branch information
Arenukvern committed Dec 4, 2023
2 parents 6c42483 + dda6081 commit ba10d49
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 4 deletions.
13 changes: 13 additions & 0 deletions .github/wip/release_snapstore.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Snapstore Build
on:
release:
types: [created]
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: snapcore/action-build@v1
File renamed without changes.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ android/app/google-services.json
ios/firebase_app_id_file.json
ios/Runner/GoogleService-Info.plist
lib/firebase_options.dart
apps/core_server_server/config/google_client_secret.json
apps/core_server_server/config/passwords.yaml
packages/core_server_client/pubspec.lock
56 changes: 56 additions & 0 deletions lib/other/feedback.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import 'package:flutter/cupertino.dart';
import 'package:lastanswer/common_imports.dart';
import 'package:wiredash/wiredash.dart';

class FeedbackProvider extends StatelessWidget {
const FeedbackProvider({
required this.child,
super.key,
});
final Widget child;
static void show(final BuildContext context) {
Wiredash.of(context).show(
inheritMaterialTheme: true,
options: FeedbackProvider.feedbackOptions,
);
}

@override
Widget build(final BuildContext context) {
if (!Envs.isFeedbackAvailable) return child;
return Wiredash(
projectId: Envs.wiredashProjectId,
secret: Envs.wiredashProjectSecret,
feedbackOptions: feedbackOptions,
child: child,
);
}

static const feedbackOptions = WiredashFeedbackOptions(
labels: [
// Take the label ids from your project console
// https://console.wiredash.io/ -> Settings -> Labels
Label(
id: 'label-mlxjl2sa6f',
title: 'Bug',
),
Label(
id: 'label-qu10qzqcf2',
title: 'Feature request',
),
],
);
}

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

@override
Widget build(final BuildContext context) => Visibility(
visible: Envs.isFeedbackAvailable,
child: IconButton(
onPressed: () => FeedbackProvider.show(context),
icon: const Icon(CupertinoIcons.exclamationmark_bubble),
),
);
}
7 changes: 5 additions & 2 deletions lib/other/last_answer_app.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:lastanswer/common_imports.dart';
import 'package:lastanswer/other/feedback.dart';
import 'package:lastanswer/router.dart';

class LastAnswerApp extends StatelessWidget {
const LastAnswerApp({super.key});
@override
Widget build(final BuildContext context) => GlobalStatesProvider(
builder: (final context) => const Portal(child: _AppScaffold()),
Widget build(final BuildContext context) => FeedbackProvider(
child: GlobalStatesProvider(
builder: (final context) => const Portal(child: _AppScaffold()),
),
);
}

Expand Down
7 changes: 7 additions & 0 deletions lib/pack_app/screens/home/vertical_projects_bar.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:lastanswer/_library/widgets/widgets.dart';
import 'package:lastanswer/common_imports.dart';
import 'package:lastanswer/other/feedback.dart';

class VerticalProjectsBar extends StatelessWidget {
const VerticalProjectsBar({
Expand Down Expand Up @@ -35,6 +36,12 @@ class VerticalProjectsBar extends StatelessWidget {
direction: Axis.vertical,
spacing: 16,
children: [
if (Envs.isFeedbackAvailable)
BarItem(
onTap: () => FeedbackProvider.show(context),
label: 'Bugs',
child: const FeedbackButton(),
),
BarItem(
onTap: onIdeaTap,
label: context.l10n.idea,
Expand Down
4 changes: 4 additions & 0 deletions lib/settings/screens/small_settings_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:lastanswer/_library/widgets/widgets.dart';
import 'package:lastanswer/common_imports.dart';
import 'package:lastanswer/other/feedback.dart';
import 'package:lastanswer/other/other.dart';
import 'package:lastanswer/settings/features_widgets/general_settings_view.dart';

Expand All @@ -24,6 +25,9 @@ class SettingsScreen extends HookWidget {
final appbar = AppBar(
centerTitle: true,
leading: CupertinoCloseButton(onPressed: onBack),
actions: const [
FeedbackButton(),
],
title: Text(context.l10n.settings),
bottom: TabBar(
tabs: [
Expand Down
7 changes: 7 additions & 0 deletions packages/core/lib/src/state_di/envs.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
// ignore_for_file: do_not_use_environment

class Envs {
static const isarDbName = 'isar_4';
static const sembastWebDbName = 'sembast_web';
static const sembastWebDbVersion = 1;
static bool get isFeedbackAvailable => wiredashProjectId.isNotEmpty;
static const wiredashProjectId =
String.fromEnvironment('WIREDASH_PROJECT_ID');
static const wiredashProjectSecret =
String.fromEnvironment('WIREDASH_PROJECT_SECRET');
}
16 changes: 16 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.0"
nanoid2:
dependency: transitive
description:
name: nanoid2
sha256: "35b5048f836652a1d711db0d716bdee59fcaaa4c37792db8b3568da4f7feb2f9"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
nested:
dependency: transitive
description:
Expand Down Expand Up @@ -1616,6 +1624,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.2"
wiredash:
dependency: "direct main"
description:
name: wiredash
sha256: "5a02a6ad23d677bb7582c0ba87a1ca5e2724b4ffd2cd5f42db08ef6b9699fa8c"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
xdg_directories:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 3.17.2+34
version: 3.17.3+35

environment:
sdk: ">=3.2.0 <4.0.0"
Expand Down Expand Up @@ -67,6 +67,7 @@ dependencies:
universal_io: ^2.2.2
url_launcher: ^6.1.14
uuid: ^4.1.0
wiredash: ^1.8.0

dev_dependencies:
analyzer: ^6.3.0
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: last-answer
version: 3.17.2+34
version: 3.17.3+35
summary: Fast ideas brainstorming tool with quick notes
description: |
You have a cool idea or you need to write a post/article for your blog.
Expand Down

0 comments on commit ba10d49

Please sign in to comment.