Skip to content

Commit

Permalink
on tap account photo open in a new fullscreen window
Browse files Browse the repository at this point in the history
  • Loading branch information
odrevet committed May 31, 2019
1 parent b938906 commit 4c727dc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
33 changes: 27 additions & 6 deletions lib/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ Future<Account> fetchAccount(String accountId) async {
var favorites = <SongLink>[];
if (tables.isNotEmpty) {
for (dom.Element tr in tables[0].getElementsByTagName('tr')) {
var song = SongLink();
var songLink = SongLink();
var aTitle = tr.children[4].children[0];
song.id = extractSongId(aTitle.attributes['href']);
song.title = stripTags(aTitle.innerHtml);
song.artist = stripTags(tr.children[3].innerHtml);
favorites.add(song);
songLink.id = extractSongId(aTitle.attributes['href']);
songLink.title = stripTags(aTitle.innerHtml);
songLink.artist = stripTags(tr.children[3].innerHtml);
favorites.add(songLink);
}
}

Expand Down Expand Up @@ -142,8 +142,24 @@ class AccountPageWidget extends StatelessWidget {
);
}

_openAvatarViewerDialog(context, image){
Navigator.of(context).push(MaterialPageRoute<Null>(
builder: (BuildContext context) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: image,
fit: BoxFit.cover,
),
),
);
},
fullscreenDialog: true));
}

Widget _buildView(BuildContext context, Account account) {
final url = baseUri + account.avatar;
final image = NetworkImage(url);

var nestedScrollView = NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
Expand All @@ -160,7 +176,12 @@ class AccountPageWidget extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Image.network(url),
Expanded(
child: InkWell(
onTap: () {
_openAvatarViewerDialog(context, image);
},
child: Image.network(url))),
Expanded(
child: Text(
account.type +
Expand Down
17 changes: 16 additions & 1 deletion lib/manageAccount.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ class ManageAccountPageWidget extends StatelessWidget {
);
}

_openAvatarViewerDialog(context, image){
Navigator.of(context).push(MaterialPageRoute<Null>(
builder: (BuildContext context) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: image,
fit: BoxFit.cover,
),
),
);
},
fullscreenDialog: true));
}

Widget _buildView(BuildContext context, Account account) {
final url = baseUri + account.avatar;
final image = NetworkImage(url);
Expand All @@ -50,7 +65,7 @@ class ManageAccountPageWidget extends StatelessWidget {
Expanded(
child: InkWell(
onTap: () {
//_openAvatarViewerDialog(context, image);
_openAvatarViewerDialog(context, image);
},
child: Image.network(url))),
Expanded(
Expand Down

0 comments on commit 4c727dc

Please sign in to comment.