Unverified Commit 0bd5b53f authored by guidraghetti's avatar guidraghetti
Browse files

Overflow correct

parent 0351c30c
Showing with 11 additions and 6 deletions
+11 -6
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:project_id_care/model/entity/opportunity.dart';
import 'package:project_id_care/resources/application.dart';
......@@ -14,6 +15,13 @@ class HomeOpportunityCell extends StatefulWidget {
}
class _HomeOpportunityCellState extends State<HomeOpportunityCell> {
String combatOverflow (String text) {
if (text.length > 30) {
return text.substring(0,30) + '...';
} else {
return text;
}
}
Widget getImage() {
if (widget.opportunity.imageUrl.isNotEmpty) {
return Container(
......@@ -62,7 +70,7 @@ class _HomeOpportunityCellState extends State<HomeOpportunityCell> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.opportunity.title,
combatOverflow(widget.opportunity.title),
style: const TextStyle(
fontWeight: FontWeight.w700,
fontSize: 24,
......@@ -71,10 +79,7 @@ class _HomeOpportunityCellState extends State<HomeOpportunityCell> {
),
const SizedBox(height: 3),
Text(
widget.opportunity.description,
overflow: TextOverflow.fade,
maxLines: 1,
softWrap: false,
combatOverflow(widget.opportunity.description),
style: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 18,
......@@ -83,7 +88,7 @@ class _HomeOpportunityCellState extends State<HomeOpportunityCell> {
),
const SizedBox(height: 3),
Text(
widget.opportunity.jobType,
combatOverflow( widget.opportunity.jobType),
style: const TextStyle(
fontWeight: FontWeight.w700,
fontSize: 18,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment