Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/shop_app_example/devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
extensions:
- provider: true
5 changes: 4 additions & 1 deletion packages/talker/example/talker_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import 'package:talker/talker.dart';

Future<void> main() async {
final talker = Talker(
logger: TalkerLogger(
output: (message) {},
),
settings: TalkerSettings(
colors: {
TalkerKey.info: AnsiPen()..magenta(),
Expand Down Expand Up @@ -36,7 +39,7 @@ Future<void> main() async {
}

class YourCustomKey extends TalkerLog {
YourCustomKey(String message) : super(message);
YourCustomKey(String super.message);

/// Your own log key (for color customization in settings)
static const logKey = 'custom_log_key';
Expand Down
4 changes: 4 additions & 0 deletions packages/talker_flutter/example/devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Enable DevTools extensions for this project.
# Talker tab will appear in DevTools when debugging.
extensions:
- talker_flutter: true
2 changes: 1 addition & 1 deletion packages/talker_flutter/example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.14'
platform :osx, '10.15'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
10 changes: 5 additions & 5 deletions packages/talker_flutter/example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos

SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
share_plus: 1fa619de8392a4398bfaf176d441853922614e89
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
share_plus: 510bf0af1a42cd602274b4629920c9649c52f4cc

PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down Expand Up @@ -639,7 +639,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -689,7 +689,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}

override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
}
45 changes: 45 additions & 0 deletions packages/talker_flutter/extension/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/
/coverage/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
30 changes: 30 additions & 0 deletions packages/talker_flutter/extension/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "9f455d2486bcb28cad87b062475f42edc959f636"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
- platform: web
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
30 changes: 30 additions & 0 deletions packages/talker_flutter/extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Talker DevTools extension

DevTools extension for [Talker](https://github.com/Frezyx/talker): view app logs in a console inside Flutter DevTools.

## Build

From this directory (`packages/talker_flutter/extension`):

```bash
./build_extension.sh
```

Or use the official command (see [DevTools extensions](https://docs.flutter.dev/tools/devtools/extensions)):

```bash
flutter pub run devtools_extensions build_and_copy --source . --dest devtools
```

## Validate

To check the extension meets DevTools requirements:

```bash
flutter pub run devtools_extensions validate --package ../
```

## References

- [Dart & Flutter DevTools Extensions](https://blog.flutter.dev/dart-flutter-devtools-extensions-c8bc1aaf8e5f)
- [DevTools extensions (docs)](https://docs.flutter.dev/tools/devtools/extensions)
28 changes: 28 additions & 0 deletions packages/talker_flutter/extension/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
21 changes: 21 additions & 0 deletions packages/talker_flutter/extension/build_extension.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Builds the Talker DevTools extension and copies output to extension/devtools/build.
# Run from packages/talker_flutter/extension (or from repo root: packages/talker_flutter/extension/build_extension.sh).
#
# Alternative (per Flutter DevTools extensions article):
# flutter pub run devtools_extensions build_and_copy --source . --dest devtools

set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
APP_DIR="${SCRIPT_DIR}"
DEST_DIR="${SCRIPT_DIR}/devtools/build"

echo "[build_extension] Building Flutter web app..."
(cd "$APP_DIR" && flutter build web --release --pwa-strategy=offline-first --no-tree-shake-icons)

echo "[build_extension] Copying to extension/devtools/build..."
rm -rf "$DEST_DIR"
cp -r "$APP_DIR/build/web" "$DEST_DIR"

echo "[build_extension] Done. Extension output is in extension/devtools/build/"
echo "[build_extension] Validate: flutter pub run devtools_extensions validate --package ../"
12 changes: 12 additions & 0 deletions packages/talker_flutter/extension/devtools/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Flutter DevTools extension configuration for talker_flutter.
# See: https://docs.flutter.dev/tools/devtools/extensions
# Spec: https://blog.flutter.dev/dart-flutter-devtools-extensions-c8bc1aaf8e5f
# Package name this extension belongs to (lowercase, underscores only). Used in title bar.
name: talker_flutter
version: 1.0.0
# URL for "Report an issue" in DevTools UI [required]
issueTracker: https://github.com/Frezyx/talker/issues
# Material Icons codepoint for extension tab (Icons.list = 0xe896) [required]
materialIconCodePoint: 59542
# Extension needs connected app to fetch logs [optional, default true]
requiresConnection: true
19 changes: 19 additions & 0 deletions packages/talker_flutter/extension/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:devtools_extensions/devtools_extensions.dart';
import 'package:flutter/material.dart';

import 'src/talker_logs_screen.dart';

void main() {
runApp(const TalkerDevToolsExtension());
}

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

@override
Widget build(BuildContext context) {
return const DevToolsExtension(
child: TalkerLogsScreen(),
);
}
}
Loading