Skip to content

Commit

Permalink
gave elevation to the contact list tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
richtwin567 committed Sep 6, 2020
1 parent 3721aea commit 57c48b2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lib/screens/contact_screen/contact_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ abstract class ContactViewState extends State<ContactViewStateful>
namedRoute: contactDetailRoute,
arguments: contacts[index],
),
Divider( thickness: 1.0,color: Theme.of(context).accentColor)
//Divider( thickness: 1.0,color: Theme.of(context).accentColor)
]);
}),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/contact_screen/contact_view_mobile_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ContactViewMobilePortraitState extends ContactViewState {
// width and height calculations made using the [MediaQueryData]
var mq = MediaQuery.of(context);
// horizontal and vertical padding for the list of contacts
var padH = mq.size.width * 0.1;
var padH = mq.size.width * 0.07;
var padV = (mq.size.height - (kToolbarHeight * 2)) * 0.07;
var topViewInsets = mq.padding.top;

Expand Down
45 changes: 24 additions & 21 deletions lib/widgets/contact_widgets/contact_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,31 @@ class ContactTile extends StatelessWidget {
var tStyle = titleStyle ?? Theme.of(context).textTheme.subtitle1;
var sStyle = subtitleStyle ?? Theme.of(context).textTheme.caption;

return ListTile(
onTap: namedRoute != null
? () {
arguments != null
? Navigator.pushNamed(context, namedRoute,
arguments: arguments)
: Navigator.pushNamed(context, namedRoute);
}
: tapFunc,
title: Text(
title,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: tStyle,
return Card(
elevation: 2.0,
child: ListTile(
onTap: namedRoute != null
? () {
arguments != null
? Navigator.pushNamed(context, namedRoute,
arguments: arguments)
: Navigator.pushNamed(context, namedRoute);
}
: tapFunc,
title: Text(
title,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: tStyle,
),
subtitle: Text(
subtitle,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: sStyle,
),
trailing: Icon(Icons.chevron_right, color: Theme.of(context).accentColor),
),
subtitle: Text(
subtitle,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: sStyle,
),
trailing: Icon(Icons.chevron_right, color: Theme.of(context).accentColor),
);
}
} // ContactTile definition

0 comments on commit 57c48b2

Please sign in to comment.