-
Notifications
You must be signed in to change notification settings - Fork 157
Description
Flutter 3.10 web
I noticed this issue when I updated my project to flutter 3.10, I tried using a button that was on a Table and I could click it until I resized the screen a certain value.
At first I thought it was a flutter issue so I created a project to try it and it worked without any problem.
Then I tried using the responsive framework with a responsiveScalledBox and then when the windows was scaled I could click on the buttons.
I also noticed that if I removed the SelectionArea the button worked again, but for my case I need to use it.
I'll respond gladly any questions that might help.
For now I think I might have to stick to flutter 3.7.12 until this bug its fixed.
Here's some screenshots
The button work as intended and can be clicked (screen width size at 1640)
The screen is resized and now It can't be clicked (screen width size at 984)
Here is the code sample I used
import 'package:flutter/material.dart';
import 'package:responsive_framework/breakpoint.dart';
import 'package:responsive_framework/responsive_breakpoints.dart';
import 'package:responsive_framework/responsive_scaled_box.dart';
import 'package:responsive_framework/responsive_value.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Test',
home: const Test(),
builder: (context, widget) => ResponsiveBreakpoints.builder(
child: widget!,
breakpoints: [
const Breakpoint(start: 0, end: 450, name: MOBILE),
const Breakpoint(start: 451, end: 800, name: TABLET),
const Breakpoint(start: 801, end: 1920, name: DESKTOP),
const Breakpoint(start: 1921, end: double.infinity, name: '4K'),
],
),
);
}
}
class Test extends StatelessWidget {
const Test({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: ResponsiveScaledBox(
width: ResponsiveValue<double>(context, conditionalValues: [
const Condition.between(start: 0, end: 450, value: 450),
const Condition.between(start: 451, end: 800, value: 800),
const Condition.between(start: 801, end: 1600, value: 1600),
const Condition.largerThan(landscapeValue: 1601, value: 1601),
]).value,
child: const Center(
child: SelectionArea(child: Table()),
),
),
);
}
}
class Table extends StatelessWidget {
const Table({super.key});
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
height: 300,
child: PaginatedDataTable(
columns: const [
DataColumn(label: Text('Name')),
DataColumn(label: Text('Details')),
],
source: TableSource(),
rowsPerPage: 3,
),
);
}
}
class TableSource extends DataTableSource {
@override
DataRow? getRow(int index) {
return DataRow(cells: [
const DataCell(Text('Name')),
DataCell(IconButton(onPressed: () {}, icon: const Icon(Icons.add))),
]);
}
@override
bool get isRowCountApproximate => false;
@override
int get rowCount => 1;
@override
int get selectedRowCount => 1;
}
Flutter doctor
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.0, on macOS 13.2.1 22D68 darwin-x64, locale en-EC)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.1)
[✓] VS Code (version 1.78.1)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!