-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
account page amended, image support in posts started
- Loading branch information
1 parent
0452e2c
commit ca47b5d
Showing
8 changed files
with
158 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ImageWithDescription extends StatefulWidget { | ||
@override | ||
ImageWithDescriptionState createState() => ImageWithDescriptionState(); | ||
} | ||
|
||
class ImageWithDescriptionState extends State<ImageWithDescription> { | ||
late String _imageUrl; | ||
late String _description; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
|
||
//_mastodonApi = MastodonApi('https://mastodon.social'); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text('Mastodon Image Description'), | ||
), | ||
body: Center( | ||
child: Stack( | ||
children: [ | ||
Image.network(_imageUrl), | ||
Positioned( | ||
bottom: 16, | ||
right: 16, | ||
child: Visibility( | ||
visible: _description != "", | ||
child: Container( | ||
padding: const EdgeInsets.all(8), | ||
decoration: BoxDecoration( | ||
color: Colors.black.withOpacity(0.6), | ||
borderRadius: BorderRadius.circular(4), | ||
), | ||
child: Text( | ||
_description, | ||
style: const TextStyle(color: Colors.white), | ||
), | ||
), | ||
), | ||
), | ||
Positioned( | ||
bottom: 16, | ||
left: 16, | ||
child: _description != "" | ||
? SizedBox() | ||
: ElevatedButton( | ||
onPressed: () { | ||
ScaffoldMessenger.of(context).showSnackBar(SnackBar( | ||
content: Text(_description), | ||
)); | ||
}, | ||
child: Text('Description'), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
// floatingActionButton: FloatingActionButton( | ||
// onPressed: _fetchRandomImage, | ||
// tooltip: 'Fetch Random Image', | ||
// ), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters