Skip to content

Instantly share code, notes, and snippets.

@figengungor
Created August 7, 2018 18:05
Show Gist options
  • Save figengungor/4b4b977b30a37951fcec151f625dc5eb to your computer and use it in GitHub Desktop.
Save figengungor/4b4b977b30a37951fcec151f625dc5eb to your computer and use it in GitHub Desktop.
SliverAppBar FlexibleSpaceBar title overflow issue
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
leading: IconButton(icon: Icon(Icons.arrow_back), onPressed: () {}),
expandedHeight: 256.0,
pinned: true,
flexibleSpace: FlexibleSpaceBar(
centerTitle: true,
title: Text(
'Minions ipsum bee do bee do bee do baboiii '
'pepete butt potatoooo poulet tikka ',
overflow: TextOverflow.ellipsis,
),
),
backgroundColor: Colors.red,
),
SliverList(
delegate: SliverChildListDelegate([
_getLongText(),
]),
)
],
),
);
}
Widget _getLongText() {
return Text(
'Minions ipsum bee do bee do bee do baboiii pepete butt '
'potatoooo poulet tikka masala. Tatata bala tu tatata bala tu chasy '
'aaaaaah. Gelatooo jeje poulet tikka masala aaaaaah me want bananaaa! '
'Chasy bee do bee do bee do pepete baboiii jiji butt. Jiji po kass '
'bappleees chasy aaaaaah bananaaaa underweaaar tank yuuu! Tank yuuu! '
'Para tú butt. Hana dul sae poulet tikka masala '
'baboiii tatata bala tu hana dul sae jiji tatata bala tu. Aaaaaah ti '
'aamoo! La bodaaa belloo! Pepete chasy pepete.'
'Minions ipsum bee do bee do bee do baboiii pepete butt '
'potatoooo poulet tikka masala. Tatata bala tu tatata bala tu chasy '
'aaaaaah. Gelatooo jeje poulet tikka masala aaaaaah me want bananaaa! '
'Chasy bee do bee do bee do pepete baboiii jiji butt. Jiji po kass '
'bappleees chasy aaaaaah bananaaaa underweaaar tank yuuu! Tank yuuu! '
'Para tú butt. Hana dul sae poulet tikka masala '
'baboiii tatata bala tu hana dul sae jiji tatata bala tu. Aaaaaah ti '
'aamoo! La bodaaa belloo! Pepete chasy pepete.'
'Minions ipsum bee do bee do bee do baboiii pepete butt '
'potatoooo poulet tikka masala. Tatata bala tu tatata bala tu chasy '
'aaaaaah. Gelatooo jeje poulet tikka masala aaaaaah me want bananaaa! '
'Chasy bee do bee do bee do pepete baboiii jiji butt. Jiji po kass '
'bappleees chasy aaaaaah bananaaaa underweaaar tank yuuu! Tank yuuu! '
'Para tú butt. Hana dul sae poulet tikka masala '
'baboiii tatata bala tu hana dul sae jiji tatata bala tu. Aaaaaah ti '
'aamoo! La bodaaa belloo! Pepete chasy pepete.'
'Minions ipsum bee do bee do bee do baboiii pepete butt '
'potatoooo poulet tikka masala. Tatata bala tu tatata bala tu chasy '
'aaaaaah. Gelatooo jeje poulet tikka masala aaaaaah me want bananaaa! ',
style: TextStyle(fontSize: 24.0),
);
}
}
@slightfoot
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment