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

AutoSizeText doesn't works in Card. #89

Closed
EliaTolin opened this issue Mar 22, 2021 · 2 comments
Closed

AutoSizeText doesn't works in Card. #89

EliaTolin opened this issue Mar 22, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@EliaTolin
Copy link

EliaTolin commented Mar 22, 2021

Hi to everyone,

I insert the AutoSizeText in my Card but it not works.
I tried to insert AutoSizeText in home and it works perfectly.

 Column cardContent() {
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Padding(
          padding: const EdgeInsets.all(8.0),
          child: Row(
            children: <Widget>[
              Container(
                height: SVConst.kSizeIcons,
                width: SVConst.kSizeIcons,
                decoration: BoxDecoration(
                  //color: SVConst.iconColor,
                  shape: BoxShape.circle,
                ),
                child: SvgPicture.asset(
                  widget.iconpath,
                  height: SVConst.kSizeIcons,
                  width: SVConst.kSizeIcons,
                ),
              ),
              SizedBox(width: 25),
              Container(
                child: AutoSizeText(
                  "PRovaaaaaaaaaaaaaa",
                  maxLines: 1,
                  style: TextStyle(
                    fontSize: 25,
                    fontWeight: FontWeight.bold,
                    fontStyle: FontStyle.normal,
                  ),
                ),
              ),
            ],
          ),
        ),
        ready() ? futureInformationContent() : waitFutureInformation(),
      ],
    );
  }

This function is a member of :

Widget build(BuildContext context) {
   return Card(
     shape: RoundedRectangleBorder(
       borderRadius: BorderRadius.circular(SVConst.radiusComponent),
     ),
     borderOnForeground: false,
     semanticContainer: false,
     child: InkWell(
       splashColor: Colors.blue.withAlpha(30),
       onTap: () {},
       child: SizedBox(
         width: double.infinity,
         child: Padding(
           padding: EdgeInsets.all(12.0),
           child: Padding(
             padding: const EdgeInsets.all(12),
             child: Wrap(
               children: <Widget>[
                 cardContent(),
               ],
             ),
           ),
         ),
       ),
     ),
   );
 }

Where is the problem? Is a bug?
If you would this is the rep where I working : https://github.com/EliaTolin/StatusVaccini

Version

  • Flutter version: Flutter 2.0.2
  • auto_size_text: ^2.1.0
@EliaTolin EliaTolin added the bug Something isn't working label Mar 22, 2021
@EliaTolin
Copy link
Author

I fix that with Flexible :

Flexible(
                fit: FlexFit.tight,
                child: AutoSizeText(
                  "deewfwefewfwewefwefwefweffwewefwefewf",
                  maxLines: 1,
                  style: TextStyle(
                    fontSize: 25,
                    fontWeight: FontWeight.bold,
                    fontStyle: FontStyle.normal,
                  ),
                ),
              ),

@houssam15
Copy link

Same problem


import "package:auto_size_text/auto_size_text.dart";
import "package:flutter/material.dart";

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

  @override
  State<PictureWithLinkDialogHeader> createState() => _PictureWithLinkDialogHeaderState();
}

class _PictureWithLinkDialogHeaderState extends State<PictureWithLinkDialogHeader> {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      padding: EdgeInsets.all(5),
      decoration: BoxDecoration(
          color: Colors.grey.shade100,
          borderRadius: BorderRadius.circular(5)
      ),
      child:Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.center,
        mainAxisSize: MainAxisSize.min,
        children: [
          Flexible(
            fit: FlexFit.tight,
            child: AutoSizeText("HIIII",style: TextStyle(
                fontSize: 25,
                color: Colors.black,
                decoration: TextDecoration.none
            )),
          )
        /*AutoSizeText(
            widget.title,
            maxLines: 1,
            style: TextStyle(
                fontSize: 25,
                color: Colors.black,
                decoration: TextDecoration.none
            )
        ),
        SizedBox(height: 10),
        AutoSizeText(
            widget.description,
            maxLines: 1,
            style: TextStyle(
                fontSize: 15,
                color: Colors.grey,
                decoration: TextDecoration.none
            )
        )*/
      ]
              )
    );
  }
}


The relevant error-causing widget was: 
  AlertDialog AlertDialog:file:///C:/Users/HP/Desktop/Projects/Dev/Mobile/CreacomNetwork/1.0.0/creacom_v2/lib/screens/content_of_page/widget/picture_with_link_dialog.dart:45:12
When the exception was thrown, this was the stack: 
#2      RenderBox.size (package:flutter/src/rendering/box.dart:2164:12)
#3      _RenderCustomClip._updateClip (package:flutter/src/rendering/proxy_box.dart:1455:33)
#4      RenderPhysicalShape.paint (package:flutter/src/rendering/proxy_box.dart:2120:5)
#5      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#6      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:251:13)
#7      RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:136:13)
#8      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#9      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:251:13)
#10     RenderShiftedBox.paint (package:flutter/src/rendering/shifted_box.dart:76:15)
#11     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#12     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:251:13)
#13     RenderShiftedBox.paint (package:flutter/src/rendering/shifted_box.dart:76:15)
#14     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#15     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:251:13)
#16     RenderShiftedBox.paint (package:flutter/src/rendering/shifted_box.dart:76:15)
#17     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#18     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:251:13)
#19     RenderShiftedBox.paint (package:flutter/src/rendering/shifted_box.dart:76:15)
#20     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#21     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:251:13)
#22     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:136:13)
#23     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#24     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:251:13)
#25     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:136:13)
#26     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#27     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:167:11)
#28     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:110:5)
#29     PaintingContext._compositeChild (package:flutter/src/rendering/object.dart:262:7)
#30     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:243:7)
#31     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:136:13)
#32     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#33     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:251:13)
#34     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:136:13)
#35     RenderAnimatedOpacityMixin.paint (package:flutter/src/rendering/proxy_box.dart:1085:11)
#36     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#37     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:167:11)
#38     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:110:5)
#39     PaintingContext._compositeChild (package:flutter/src/rendering/object.dart:262:7)
#40     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:243:7)
#41     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:136:13)
#42     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268:7)
#43     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:167:11)
#44     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:110:5)
#45     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1183:31)
#46     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1193:15)
#47     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:604:23)
#48     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1164:13)
#49     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:468:5)
#50     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1397:15)
#51     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1318:9)
#52     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1176:5)
#53     _invoke (dart:ui/hooks.dart:312:13)
#54     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419:5)
#55     _drawFrame (dart:ui/hooks.dart:283:31)
(elided 2 frames from class _AssertionError)
The following RenderObject was being processed when the exception was fired: RenderPhysicalShape#13c42 relayoutBoundary=up2
...  parentData: <none> (can use size)
...  constraints: BoxConstraints(280.0<=w<=520.9, 0.0<=h<=886.5)
...  size: MISSING
...  elevation: 6.0
...  color: Color(0xff212121)
...  shadowColor: Color(0xff212121)
...  clipper: ShapeBorderClipper
RenderObject: RenderPhysicalShape#13c42 relayoutBoundary=up2
  parentData: <none> (can use size)
  constraints: BoxConstraints(280.0<=w<=520.9, 0.0<=h<=886.5)
  size: MISSING
  elevation: 6.0
  color: Color(0xff212121)
  shadowColor: Color(0xff212121)
  clipper: ShapeBorderClipper
...  child: RenderCustomPaint#14489 relayoutBoundary=up3 NEEDS-PAINT
...    parentData: <none> (can use size)
...    constraints: BoxConstraints(280.0<=w<=520.9, 0.0<=h<=886.5)
...    size: MISSING
...    painter: null
...    foregroundPainter: _ShapeBorderPainter#d7f09()
...    child: _RenderInkFeatures#ed568 relayoutBoundary=up4 NEEDS-PAINT
...      parentData: <none> (can use size)
...      constraints: BoxConstraints(280.0<=w<=520.9, 0.0<=h<=886.5)
...      size: MISSING
...      child: RenderSemanticsAnnotations#56606 relayoutBoundary=up5 NEEDS-PAINT
...        parentData: <none> (can use size)
...        constraints: BoxConstraints(280.0<=w<=520.9, 0.0<=h<=886.5)
...        size: MISSING
...        child: RenderIntrinsicWidth#357df relayoutBoundary=up6 NEEDS-PAINT
...          parentData: <none> (can use size)
...          constraints: BoxConstraints(280.0<=w<=520.9, 0.0<=h<=886.5)
...          size: MISSING
...          stepWidth: null
...          stepHeight: null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants