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

[Bug] windowSize error when an autocorrection popup is left open #203

Closed
nausharipov opened this issue Mar 20, 2023 · 0 comments · Fixed by #204
Closed

[Bug] windowSize error when an autocorrection popup is left open #203

nausharipov opened this issue Mar 20, 2023 · 0 comments · Fixed by #204
Assignees
Labels
bug Something isn't working

Comments

@nausharipov
Copy link
Collaborator

Video:

Screen.Recording.2023-03-20.at.17.34.32.mov

Code:

import 'package:flutter/material.dart';
import 'package:flutter_code_editor/flutter_code_editor.dart';
import 'package:highlight/languages/dart.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage>
    with SingleTickerProviderStateMixin {
  TabController? _tabController;

  static const _text =
      'type a popup trigger, for example "cl", then switch to another tab and return back to the tab with an open popup.';

  final firstController = CodeController(
    text: _text,
    language: dart,
  );
  final secondController = CodeController(
    text: _text,
    language: dart,
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Reproducible example of the popup bug'),
        bottom: TabBar(
          controller: _tabController,
          tabs: const [
            Tab(icon: Icon(Icons.home), text: 'Tab 1'),
            Tab(icon: Icon(Icons.settings), text: 'Tab 2'),
          ],
        ),
      ),
      body: TabBarView(
        controller: _tabController,
        children: [
          CodeField(controller: firstController),
          CodeField(controller: secondController),
        ],
      ),
    );
  }

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: 2, vsync: this);
  }

  @override
  void dispose() {
    _tabController?.dispose();
    super.dispose();
  }
}

@nausharipov nausharipov added the bug Something isn't working label Mar 20, 2023
@nausharipov nausharipov changed the title [Bug] windowSize is null error when a autocorrection popup is left open [Bug] windowSize error when an autocorrection popup is left open Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants