Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When click outside of text form, get a flutter_markdown error. #18

Open
antfitch opened this issue Dec 12, 2024 · 2 comments
Open

When click outside of text form, get a flutter_markdown error. #18

antfitch opened this issue Dec 12, 2024 · 2 comments

Comments

@antfitch
Copy link

antfitch commented Dec 12, 2024

Steps to reproduce:

  1. Install flutter pub add flutter_ai_toolkit into a fresh project
  2. Run the debug environment from Chrome
  3. Click outside of the text form in the AI demo
  4. A flutter_markdown error appears in the debug VS Code debug window.

This appears to happen because the following line is missing in pubspec.yaml:

flutter_markdown: ^0.7.4+3

When I add the line above to the yaml file, everything works fine.

@domesticmouse
Copy link
Contributor

domesticmouse commented Dec 12, 2024

Can you please supply more detail to reproduce your issue? I built the following, and I'm not seeing any issues on macOS or on the web.

import 'package:flutter/material.dart';
import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
import 'package:google_generative_ai/google_generative_ai.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const ChatPage(title: 'Generative AI Chat'),
    );
  }
}

class ChatPage extends StatelessWidget {
  const ChatPage({super.key, required this.title});

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(title)),
      body: LlmChatView(
        provider: GeminiProvider(
          model: GenerativeModel(
            model: 'gemini-1.5-flash',
            apiKey: 'AIzaNotARealAPIKey',
          ),
        ),
      ),
    );
  }
}

And, of course, the required flutter doctor output.

$ flutter doctor -v
[✓] Flutter (Channel stable, 3.27.0, on macOS 15.2 24C101 darwin-arm64, locale en-AU)
    • Flutter version 3.27.0 on channel stable at /Users/brett/flutter
    • Upstream repository https://github.com/flutter/flutter
    • Framework revision 8495dee1fd (2 days ago), 2024-12-10 14:23:39 -0800
    • Engine revision 83bacfc525
    • Dart version 3.6.0
    • DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/brett/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16B40
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[✓] IntelliJ IDEA Community Edition (version 2024.3)
    • IntelliJ at /Users/brett/Applications/IntelliJ IDEA Community Edition.app
    • Flutter plugin version 83.0.4
    • Dart plugin version 243.22562.3

[✓] VS Code (version 1.96.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.102.0

[✓] Connected device (5 available)
    • Brett’s iPad (mobile)           • 00008103-001169D42223001E • ios            • iOS 18.2 22C152
    • iPhone (mobile)                 • 00008101-0014595934C2001E • ios            • iOS 18.2 22C152
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 15.2 24C101 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 15.2 24C101 darwin-arm64
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 131.0.6778.110

[✓] Network resources
    • All expected network resources are available.

• No issues found!

@domesticmouse
Copy link
Contributor

I created #19 after attempting to repro this issue =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants