Skip to content

Commit

Permalink
Adding some album info and setup ready for a fire description (#14)
Browse files Browse the repository at this point in the history
* album page and setup

* update flutter version

* finalize text and fix image resizing
  • Loading branch information
pelusodan authored Aug 25, 2024
1 parent b8907b2 commit c976559
Show file tree
Hide file tree
Showing 9 changed files with 238 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: '3.13.2'
flutter-version: '3.24.1'

- name: Get dependencies
run: flutter pub get
Expand Down
27 changes: 6 additions & 21 deletions .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,20 @@
# This file should be version controlled and should not be manually edited.

version:
revision: "7e07cd41cb78c1bb1199c458859c87ff818e1748"
channel: "beta"
revision: "5874a72aa4c779a02553007c47dacbefba2374dc"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
base_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
- platform: android
create_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
base_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
- platform: ios
create_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
base_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
- platform: linux
create_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
base_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
- platform: macos
create_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
base_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
- platform: web
create_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
base_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
- platform: windows
create_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
base_revision: 7e07cd41cb78c1bb1199c458859c87ff818e1748
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc

# User provided section

Expand Down
Binary file added assets/img/album.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
127 changes: 127 additions & 0 deletions lib/album/album.dart
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),
));
}
}
20 changes: 20 additions & 0 deletions lib/album/album_description.dart
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
""";
4 changes: 4 additions & 0 deletions lib/home/shows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ final ShowList = [
url: "https://pawtucketartscollaborative.wildapricot.org/",
title: "PAWTUCKET ART GALLERY",
date: DateTime(2023, 12, 9, 19)),
Show(
url: "https://regenttheatre.com/",
title: "ALBUM RELEASE SHOW @ REGENT",
date: DateTime(2024, 10, 12, 19)),
];
7 changes: 6 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
import 'package:spider_water/analytics/analytics.dart';
import 'package:spider_water/energy/energy.dart';

import 'album/album.dart';
import 'analytics/firebase_options.dart';
import 'home/face.dart';
import 'home/home_page_content.dart';
Expand Down Expand Up @@ -91,7 +92,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
home: DefaultTabController(
length: 2,
length: 3,
child: Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
Expand All @@ -111,13 +112,17 @@ class _MyHomePageState extends State<MyHomePage> {
),
Tab(
text: "energy",
),
Tab(
text: "album",
)
]),
),
)),
body: TabBarView(children: <Widget>[
HomePageContent(faceIndex: widget.faceIndex),
const EnergyViews(),
const AlbumPage(),
]),
)),
);
Expand Down
Loading

0 comments on commit c976559

Please sign in to comment.