Skip to content

Instantly share code, notes, and snippets.

@manjotsidhu
Last active July 28, 2021 04:51
Show Gist options
  • Save manjotsidhu/a33240474432a6129f46bf6e87a62ac7 to your computer and use it in GitHub Desktop.
Save manjotsidhu/a33240474432a6129f46bf6e87a62ac7 to your computer and use it in GitHub Desktop.
Flutter Wrap Issue
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
final String title;
MyHomePage({Key? key, required this.title}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Column(
children: [
Text('Expected ->'),
Text('Hi, I am Manjot, I like flutter and jfbskjbsb gjksfg dfg kdsfh gdsfj kgdsfkj gdshg jdfk hgdfksj hgksdjfh gkdjsf gdshf gjksdgh sdkjfgh sdjkg hsdkfgh jksdfhg ksdjhg kdsfh ghgk'),
Text('\nActual ->'),
Wrap(
children: [
Text('Hi, I '),
Text('am '),
Text('Manjot, I like flutter and jfbskjbsb gjksfg dfg kdsfh gdsfj kgdsfkj gdshg jdfk hgdfksj hgksdjfh gkdjsf gdshf gjksdgh sdkjfgh sdjkg hsdkfgh jksdfhg ksdjhg kdsfh ghgk',
softWrap: true,
),
],
),
Wrap(
children: [
Text('Hi, I '),
Text('am '),
Text('Manjot, this works fine for some reason until text is longer than screen width'),
],
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment