-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding some album info and setup ready for a fire description (#14)
* album page and setup * update flutter version * finalize text and fix image resizing
- Loading branch information
Showing
9 changed files
with
238 additions
and
47 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,127 @@ | ||
import 'package:firebase_analytics/firebase_analytics.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_markdown/flutter_markdown.dart'; | ||
import 'package:spider_water/album/album_description.dart'; | ||
|
||
import '../analytics/analytics.dart'; | ||
|
||
class AlbumPage extends StatefulWidget { | ||
const AlbumPage({super.key}); | ||
|
||
@override | ||
State<StatefulWidget> createState() { | ||
return _AlbumPageState(); | ||
} | ||
} | ||
|
||
const style = TextStyle( | ||
color: Colors.black, | ||
fontSize: 14, | ||
fontFamily: 'Blockstepped', | ||
); | ||
|
||
const styleh1 = TextStyle( | ||
color: Colors.black, | ||
fontSize: 28, | ||
fontFamily: 'Blockstepped', | ||
); | ||
|
||
const styleh2 = TextStyle( | ||
color: Colors.black, | ||
fontSize: 24, | ||
fontFamily: 'Blockstepped', | ||
); | ||
|
||
const styleh3 = TextStyle( | ||
color: Colors.black, | ||
fontSize: 20, | ||
fontFamily: 'Blockstepped', | ||
); | ||
|
||
class _AlbumPageState extends State<AlbumPage> { | ||
final analytics = | ||
SpiderAnalytics(firebaseInstance: FirebaseAnalytics.instance); | ||
|
||
@override | ||
void didChangeDependencies() { | ||
loadImages(); | ||
super.didChangeDependencies(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
double screenWidth = MediaQuery.of(context).size.width; | ||
double screenHeight = MediaQuery.of(context).size.height; | ||
|
||
analytics.sendEvent(const AnalyticsEvent(name: "Loaded album page")); | ||
|
||
return screenWidth < 450 | ||
? mobilePage(screenHeight) | ||
: desktopPage(screenHeight, screenWidth); | ||
} | ||
|
||
Future<void> loadImages() async { | ||
try { | ||
await precacheImage(const AssetImage('assets/img/album.jpg'), context); | ||
} catch (e) { | ||
debugPrint('Failed to load and cache image: $e'); | ||
} | ||
} | ||
|
||
mobilePage(double screenHeight) { | ||
return SingleChildScrollView( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
IntrinsicWidth( | ||
child: Image.asset( | ||
'assets/img/album.jpg', | ||
height: screenHeight / 2, | ||
)), | ||
const AlbumBody(), | ||
], | ||
), | ||
); | ||
} | ||
|
||
desktopPage(double screenHeight, double screenWidth) { | ||
return SingleChildScrollView( | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
IntrinsicHeight( | ||
child: Image.asset( | ||
'assets/img/album.jpg', | ||
width: screenWidth / 3, | ||
)), | ||
const AlbumBody(), | ||
], | ||
), | ||
); | ||
} | ||
} | ||
|
||
class AlbumBody extends StatelessWidget { | ||
const AlbumBody({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
double screenWidth = MediaQuery.of(context).size.width; | ||
return SizedBox( | ||
height: screenWidth < 450 ? 800 : screenWidth * .45, | ||
width: screenWidth < 450 ? 800 : screenWidth * .45, | ||
child: Markdown( | ||
data: description, | ||
styleSheet: MarkdownStyleSheet( | ||
a: style, | ||
h1: styleh1, | ||
h2: styleh2, | ||
h3: styleh3, | ||
h4: style, | ||
p: style), | ||
)); | ||
} | ||
} |
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,20 @@ | ||
const String description = """ | ||
# akin to the feeling of washing your hands of soot | ||
similar to the feeling of wiping sweat onto a fully soaked cotton tee shirt | ||
spider water is the collective effort of post-millennial hyperbolization | ||
it is the result of stories without endings told to friends of friends | ||
pints downed in the arriving minutes of an uber driver | ||
## we're ready to finally share that story | ||
Spider Water is a 6-track guide for survival in a world where the silhouette lounge only has one shadow | ||
a world where brat politicians corrupt the masses through major chord progressions | ||
### break free from the plan. September 22 | ||
"""; |
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
Oops, something went wrong.