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

Wheel breaks when wrapped with FittedBox & SizedBox #87

Closed
LenaWirtz opened this issue May 15, 2024 · 2 comments
Closed

Wheel breaks when wrapped with FittedBox & SizedBox #87

LenaWirtz opened this issue May 15, 2024 · 2 comments

Comments

@LenaWirtz
Copy link

Hi all,

i created a very simple flutter project (version 3.3.9, Picker version 3.0.2). when wrapping the Scaffold with a Fitted & Sized box as you see in the example code below, the touch points of the color wheel are broken (like in the video). Is there any way to fix this?

vlc-record-2024-05-15-12h21m07s-2024-05-15.12-18-28.mkv-.mp4

`
import 'package:flex_color_picker/flex_color_picker.dart';
import 'package:flutter/material.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(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;

@OverRide
State createState() => _MyHomePageState();
}

class _MyHomePageState extends State {
Color currentColor = Colors.blue;

@OverRide
Widget build(BuildContext context) {
return FittedBox(
child: SizedBox(
width: 1920,
height: 1080,
child: Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: ColorPicker(
pickersEnabled: const <ColorPickerType, bool>{
ColorPickerType.wheel: true,
ColorPickerType.primary: false,
ColorPickerType.accent: false,
},
wheelDiameter: 500,
wheelSquarePadding: 50,
wheelWidth: 40,
wheelSquareBorderRadius: 16,
enableShadesSelection: false,
color: currentColor,
onColorChanged: (value) {
setState(() {
currentColor = value;
});
},
),
),
),
),
);
}
}

`

@LenaWirtz LenaWirtz changed the title Wheel breaks when Scaffold wrapped with FittedBox Wheel breaks when wrapped with FittedBox & SizedBox May 15, 2024
@rydmike rydmike self-assigned this May 17, 2024
@rydmike rydmike added question Further information is requested in triage labels May 17, 2024
@rydmike
Copy link
Owner

rydmike commented May 17, 2024

It seems to be working. The painted wheel seems to have a diameter of 500 in the video as specified and it works.

What do you expect it to do?

Please note that the wheel is fixed size painter, kind of like e.g. Switch, it does not expand/shrink to fit surrounding constraints. You can of course compute the max diameter of the the wheel that would fit into the area you have and give that as diameter, if you need it to respond to available space.

@rydmike
Copy link
Owner

rydmike commented Jun 14, 2024

Closed due to no response. If more info is presented we can open this again.

@rydmike rydmike closed this as completed Jun 14, 2024
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