bosskmk / pluto_grid

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
637 stars 291 forks source link

[Bug] Not work Android back button #932

Closed rapan931 closed 8 months ago

rapan931 commented 10 months ago

Thanks great package!

An event occurred in which clicking the Android back button (the back button displayed at the bottom of the screen) did not return to the previous screen.

Can you please fix it?

Reproduc step

main.dart ```main.dart import 'package:flutter/material.dart'; import 'package:pluto_grid/pluto_grid.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return const MaterialApp(title: 'Back Button', home: Home()); } } class Home extends StatefulWidget { const Home({super.key}); @override State createState() => _HomeState(); } class _HomeState extends State { final f = FocusNode(); @override void dispose() { f.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Parent'), centerTitle: true), body: Column( children: [ TextFormField(focusNode: f), ElevatedButton( child: const Text('unFocus'), onPressed: () { f.unfocus(); }), ElevatedButton( child: const Text('to grid'), onPressed: () async { Navigator.push(context, MaterialPageRoute(builder: (context) => const ListPage())); }, ), ], ), ); } } class ListPage extends StatelessWidget { const ListPage({super.key}); @override Widget build(BuildContext context) { final columns = [PlutoColumn(title: 'Id', field: 'id', type: PlutoColumnType.text())]; final rows = [ PlutoRow(cells: {'id': PlutoCell(value: 'user1')}), PlutoRow(cells: {'id': PlutoCell(value: 'user2')}), ]; return Scaffold( appBar: AppBar(title: const Text('Back Button'), centerTitle: true), body: PlutoGrid(columns: columns, rows: rows, mode: PlutoGridMode.selectWithOneTap), ); } } ```
  1. Click TextForm(Focus TextForm)
  2. Click to grid button
  3. Click Android back button

Expected results

Actual results

flutter doctor -v

Doctor output ```console C:\Users\user1\src>flutter doctor -v [√] Flutter (Channel stable, 3.10.6, on Microsoft Windows [Version 10.0.19045.3324], locale ja-JP) • Flutter version 3.10.6 on channel stable at C:\Users\user1\prog\flutter_windows_3.7.7-stable\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision f468f3366c (8 weeks ago), 2023-07-12 15:19:05 -0700 • Engine revision cdbeda788a • Dart version 3.0.6 • DevTools version 2.23.1 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.2) • Android SDK at C:\Users\user1\AppData\Local\Android\sdk • Platform android-33-ext5, build-tools 33.0.2 • Java binary at: C:\Program Files\AdoptOpenJDK\jdk-11.0.9.101-hotspot\bin\java • Java version OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9.1+1) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop for Windows (Visual Studio Professional 2022 17.5.4) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Professional • Visual Studio Professional 2022 version 17.5.33530.505 • Windows 10 SDK version 10.0.22000.0 [√] Android Studio (version 2022.1) • Android Studio at C:\Program Files\Android\AndroidStudio • 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 11.0.15+0-b2043.56-9505619) [√] VS Code (version 1.81.1) • VS Code at C:\Users\user1\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.72.0 [√] Connected device (4 available) • [Filter!] (mobile) • [Filter!] • android-arm64 • Android 10 (API 29) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.3324] • Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.141 • Edge (web) • edge • web-javascript • Microsoft Edge 116.0.1938.69 [√] Network resources • All expected network resources are available. • No issues found! ```

PlutoGrid version

7.0.2

Other

The following procedure returned to the previous screen as expected.

  1. Don't click TextForm(Focus TextForm)
  2. Click to grid button
  3. Click Android back button

But the following steps reproduced out of focus

  1. Click TextForm(Focus TextForm)
  2. Click unFocus button(unFocus TextForm)
  3. Click to grid button
  4. Click Android back button

Perhaps it is due to "Focus"

Thanks

github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 8 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

meetcse commented 4 months ago

This is still not resolved

KaushikGupta007 commented 3 weeks ago

Any workaround for the same?