Skip to content

Commit

Permalink
tiny ui changes
Browse files Browse the repository at this point in the history
  • Loading branch information
marchellodev committed Apr 26, 2020
1 parent cad38cb commit dc3323a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
6 changes: 3 additions & 3 deletions lib/models/file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class FileModel {
name = data.split(Platform.isWindows ? '\\' : '/').last;
break;
case FileTypeModel.text:
name = data.length >= 101
? data.replaceAll('\n', ' ').substring(0, 100)
: data.replaceAll('\n', ' ');
var _ = data.trim().replaceAll('\n', ' ');
name =
_.length >= 101 ? _.substring(0, 100) : _.replaceAll('\n', ' ');
break;
case FileTypeModel.app:
throw Exception('when type is app, name is neccesary');
Expand Down
51 changes: 26 additions & 25 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,33 +190,34 @@ class _HomePageState extends State<HomePage> {
SizedBox(
height: 22,
),
Row(
children: [
Container(
margin: EdgeInsets.only(left: 24, right: 24),
child: Text(
L('Latest', _model.localeAdapter),
style:
GoogleFonts.comfortaa(textStyle: TextStyle(fontSize: 24)),
if (_latest != null && _latest.isNotEmpty)
Row(
children: [
Container(
margin: EdgeInsets.only(left: 24, right: 24),
child: Text(
L('Latest', _model.localeAdapter),
style:
GoogleFonts.comfortaa(textStyle: TextStyle(fontSize: 24)),
),
),
),
Spacer(),
Container(
margin: EdgeInsets.only(right: 24),
child: IconButton(
onPressed: () {
setState(() => _latest.clear());
Spacer(),
Container(
margin: EdgeInsets.only(right: 24),
child: IconButton(
onPressed: () {
setState(() => _latest.clear());

saveLatest();
},
icon: SvgPicture.asset(
'assets/icon_remove.svg',
semanticsLabel: 'remove',
height: 16,
)),
)
],
),
saveLatest();
},
icon: SvgPicture.asset(
'assets/icon_remove.svg',
semanticsLabel: 'remove',
height: 16,
)),
)
],
),
Expanded(
child: Container(
padding: EdgeInsets.only(left: 24, right: 24),
Expand Down

0 comments on commit dc3323a

Please sign in to comment.