ueman / feedback

A simple widget for getting better feedback.
https://pub.dev/packages/feedback
392 stars 94 forks source link

Black Screen and cant backspace using textfield #177

Closed DragonSlayer88 closed 2 years ago

DragonSlayer88 commented 2 years ago

Version

2.4.0

Library

feedback

Flutter channel

stable

Flutter version

2.8.1

Platform

Windows

Details

I updated to 2.4.0 and now there is a required scrollController to pass into my customfeedbackbuilder. Now when I get a black screen.... I tried to use the customfeedback example you provided as well and still gives me a black screen. The other version 2.0.0 was working fine for me. Besides not being able to backspace in the textfield, i thought updating would be helpful.

Steps to reproduce

update to 2.4.0 black screen

Output of flutter doctor -v

No response

ueman commented 2 years ago

Can you post your code and some more information on how to get to the black screen?

DragonSlayer88 commented 2 years ago

Sure here is what i have in main for the custom page, and here is my code for the custom page.

From Main:

runApp(EasyLocalization(
      supportedLocales: [Locale('en','US'), Locale('es','MX'), Locale('zh','CN')],
      path: 'assets/translations', // <-- change the path of the translation files
      fallbackLocale: Locale('en','US'),
      child: ThemeProvider(
                  initTheme: initTheme,
                  builder: (context, myTheme) {
                    return BetterFeedback(
                        feedbackBuilder: (context, onSubmit,scrollController) => CustomFeedbackForm(onSubmit: onSubmit),
                        child: MaterialApp(
                         /* navigatorObservers: <NavigatorObserver>[
                            observer
                          ],*/
                          navigatorKey: NavigationService.navigatorKey,
                      localizationsDelegates: context.localizationDelegates,
                      supportedLocales: context.supportedLocales,
                      locale: context.locale,
                      debugShowCheckedModeBanner: false,
                      // Add the locale here
                      home: Home(),
                      theme: myTheme,
                    )
                    );
                  })));

Custom Page:

import 'package:feedback/feedback.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/services.dart';

/// A data type holding user feedback consisting of a feedback type, free from
/// feedback text, and a sentiment rating.
///
List feedbackOptions = [
  "Select","Feature","Bug"
];
String selectedFeedback = feedbackOptions[0];
String feedbackMessage = "";

class CustomFeedbackForm extends StatefulWidget {
  const CustomFeedbackForm({Key? key, required this.onSubmit})
      : super(key: key);

  final OnSubmit onSubmit;

  @override
  _CustomFeedbackFormState createState() => _CustomFeedbackFormState();
}

class _CustomFeedbackFormState extends State<CustomFeedbackForm> {

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        Expanded(
          child: ListView(
            padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
            children: [
              Text('feedback.typeMessage'.tr()),
              Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: [
                  const Padding(
                    padding: EdgeInsets.only(right: 8),
                    child: Text('*'),
                  ),
                  Container(
                    child: DropdownButton<String>(
                      value: selectedFeedback,
                      items: feedbackOptions
                          .map(
                            (type) => DropdownMenuItem<String>(
                              child: Text(type),
                              value: type,
                            ),
                          )
                          .toList(),
                      onChanged: (feedbackType) => setState(
                          () { selectedFeedback = feedbackType!;
                          },
                    ),
                  ),
                  )],
              ),
              const SizedBox(height: 16),
              Text(selectedFeedback == "Select" ? 'feedback.typeMessage'.tr():selectedFeedback == "Feature" ? 'feedback.featureMessage'.tr():'feedback.bugMessage'.tr()),
              TextField(
                onChanged: (String newFeedback) {
                    feedbackMessage = newFeedback;
                }, // Only numbers can be entered
              )
            ],
          ),
        ),
        Align(alignment: Alignment.centerRight,
    child:Container(
      //flex: 1,
            child: Container(
              color: Colors.lightBlueAccent,
              height: double.infinity,
                width: 100,
                child: ElevatedButton(
          // disable this button until the user has specified a feedback type
          onPressed: selectedFeedback != "Select"
              ? () => widget.onSubmit(feedbackMessage,
                    extras: {"feedback_type":selectedFeedback},
                  )
              : null,
          child: Text('feedback.submit'.tr(),style: TextStyle(color: Colors.black),),
        )))),
        //const SizedBox(height: 8),
      ],
    );
  }
}
DragonSlayer88 commented 2 years ago

Bascially i had it working i think with version 2.0.0. And when i updated to 2.4.0 it asked me to include a scrollController. Ever since then, i cant get it to work, i see a black screen. I even tried to go back to 2.0.0 but for some reason it still asks for a scrollcontroller now. Not sure what the deal is.

DragonSlayer88 commented 2 years ago

Bascially i had it working i think with version 2.0.0. And when i updated to 2.4.0 it asked me to include a scrollController. Ever since then, i cant get it to work, i see a black screen. I even tried to go back to 2.0.0 but for some reason it still asks for a scrollcontroller now. Not sure what the deal is.

DragonSlayer88 commented 2 years ago

I found the issue with the black screen. I was popping before i showed the feedback screen because i have it in my drawer. SO i wanted to pop the drawer before i opened feedback. This was working fine in the older version.

But it still remains the textfield backspace issue. Very annoying problem. Only this textfield cant backspace.

MichaelSunday commented 2 years ago

@DragonSlayer88

Yeah I have the same issue with that specific textfield also. Currently trying to fix atm.

Windows Desktop App

ueman commented 2 years ago

@MichaelSunday If you figure it out I would really appreciate reading your finding or a PR. Thanks for looking at it.

DragonSlayer88 commented 2 years ago

Please look into this. I know this problem is isolated in this package somewhere.

ueman commented 2 years ago

Please look into this. I know this problem is isolated in this package somewhere.

I currently don't have time to do that, you know, life and all that.

However, I'm pretty sure it's something in Flutter itself and not specific to this package because there's nothing special about the way the textfields are used and it works on mobile and web.

If a previous version worked fine for you, I suggest reverting back to it for now. If that's the case, please let me know so I have some more information to work with when I come around to it.

ueman commented 2 years ago

Fixed in 2.4.1

DragonSlayer88 commented 2 years ago

I tried 2.4.1, still did not fix the issue

ueman commented 2 years ago

I tried 2.4.1, still did not fix the issue

Which Flutter version are you on?

On 2.10 I'm now able to backspace in textfields on desktop.

DragonSlayer88 commented 2 years ago

Sorry yes, Flutter 2.1.0 came out yesterday. I upgraded to that and now it works. Thank you for the continued support. I appreciate it. Well done.