Close button doesn't work and can't find the line to move it down a bit

31 views Asked by At

I have a quizz app made in flutter and I can't find the line where the close icon that I will attach here it is. I tried to change the first SizedBox to 30 but stil the "x" doesn't move.Where should I add another SizedBox? Here is the code

import 'package:flutter/material.dart';
import 'package:bacgeografie/models/quiz_data.dart';
import 'package:bacgeografie/utils/string.dart';
import 'package:nb_utils/nb_utils.dart';

class QuizDescriptionComponent extends StatefulWidget {
  static String tag = '/QuizDescriptionComponent';

  final QuizData? quizModel;

  const QuizDescriptionComponent({Key? key, this.quizModel}) : super(key: key);

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

class QuizDescriptionComponentState extends State<QuizDescriptionComponent> {
  // String university = 'Any';
  @override
  void initState() {
    super.initState();
    init();
  }

  init() async {
    //
  }

  @override
  void setState(fn) {
    if (mounted) super.setState(fn);
  }

  @override
  Widget build(BuildContext context) {
    
    return SingleChildScrollView(
      
      child: Column(
        
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          const SizedBox(height: 30),
          widget.quizModel!.imageUrl.isEmptyOrNull
              ? Image.network(
                  widget.quizModel!.imageUrl!,
                  width: context.width(),
                  height: context.height() * 0.50,
                  fit: BoxFit.fill,
                ).cornerRadiusWithClipRRectOnly(
                  bottomLeft: defaultRadius.toInt(),
                  bottomRight: defaultRadius.toInt())
              : Container(),
          50.height,
          Text('About this quiz', style: boldTextStyle(size: 20))
              .paddingOnly(left: 25, right: 30),
          SizedBox(height: 10),
          Container(
            margin: const EdgeInsets.all(25),
            padding: const EdgeInsets.all(25),
            width: context.width(),
            decoration: boxDecorationWithRoundedCorners(
              borderRadius: BorderRadius.circular(defaultRadius),
              border: Border.all(color: grey.withOpacity(0.3)),
              backgroundColor: Theme.of(context).cardColor,
            ),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text('Quiz title', style: boldTextStyle()),
                8.height,
                Text(widget.quizModel!.quizTitle.validate(),
                    style: primaryTextStyle()),
                8.height,
                Divider(color: grey.withOpacity(0.3), thickness: 1),
                8.height,
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(lbl_quiz_description, style: boldTextStyle()),
                    8.height,
                    Text(widget.quizModel!.description.validate(),
                        style: primaryTextStyle()),
                    8.height,
                    Divider(color: grey.withOpacity(0.3), thickness: 1),
                    8.height,
                  ],
                ).visible(widget.quizModel!.description.validate().isNotEmpty),
                Row(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text('No of questions' + ":", style: boldTextStyle()),
                    4.width,
                    Text('20', softWrap: true, style: primaryTextStyle())
                        .expand(),
                  ],
                ),
                8.height,
                Divider(color: grey.withOpacity(0.3), thickness: 1),
                8.height,
                Row(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text('Quiz duration', style: boldTextStyle()),
                    4.width,
                    Text('20' + " minutes",
                            softWrap: true, style: primaryTextStyle())
                        .expand(),
                  ],
                ),
                // 8.height,
                // Divider(color: grey.withOpacity(0.3), thickness: 1),
                // 8.height,
                // Text('Choose University', style: boldTextStyle()),
                // 8.height,
                // DropdownButtonFormField(
                //   decoration: InputDecoration(
                //       border: OutlineInputBorder(
                //           borderSide: BorderSide(color: black))),
                //   value: university,
                //   items: ['Any', '1', '2', '3']
                //       .map((label) => DropdownMenuItem(
                //             child: Text(label.toString()),
                //             value: label,
                //           ))
                //       .toList(),
                //   onChanged: (value) {
                //     setState(() {
                //       university = value.toString();
                //     });
                //   },
                // ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}

image

I changed the first sandbox to 30 , but only"About this quiz" moved

1

There are 1 answers

0
Neil-NotNeo On

Seems like its somewhere outside of your class. Search for AppBar in your code, inside AppBar you may find it under actions widget list or in the title widget. Something like as below. Good Luck!

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: 'Maybe here'
        actions: [...or here],

...