Skip to content

Commit

Permalink
fix: nav bar transparency, updates
Browse files Browse the repository at this point in the history
  • Loading branch information
frostnova721 committed Mar 9, 2024
1 parent 6ad12e0 commit a998eee
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 638 deletions.
39 changes: 25 additions & 14 deletions lib/core/app/update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Future<UpdateCheckResult?> checkForUpdates() async {
final releasesRes = json.decode(await fetch(releasesUrl))[0];
final String currentVersion = packageInfo.version;
final String latestVersion = releasesRes['tag_name'];
print("$currentVersion , $latestVersion");
final String description = releasesRes['body'];
final bool pre = releasesRes['prerelease'];
if (currentVersion != latestVersion.replaceAll('v', '').split("-")[0]) {
Expand All @@ -53,6 +54,7 @@ showUpdateSheet(
showModalBottomSheet(
showDragHandle: true,
backgroundColor: backgroundColor,
isScrollControlled: true,
context: context,
builder: (context) {
return Container(
Expand All @@ -61,19 +63,28 @@ showUpdateSheet(
mainAxisSize: MainAxisSize.min,
children: [
if (pre)
Text("Test Version",
style: TextStyle(color: textSubColor, fontFamily: "Poppins")),
MarkdownBody(
data: markdownText,
styleSheet: MarkdownStyleSheet(
h1: style(),
h2: style(),
listBullet: style(),
h3: style(),
h4: style(),
h5: style(),
h6: style(),
p: style(),
Text(
"Test Version",
style: TextStyle(color: textSubColor, fontFamily: "Poppins"),
),
Container(
child: ListView(
shrinkWrap: true,
children: [
MarkdownBody(
data: markdownText,
styleSheet: MarkdownStyleSheet(
h1: style(),
h2: style(),
listBullet: style(),
h3: style(),
h4: style(),
h5: style(),
h6: style(),
p: style(),
),
),
],
),
),
Container(
Expand Down Expand Up @@ -139,7 +150,7 @@ showUpdateSheet(
),
],
),
)
),
],
),
);
Expand Down
20 changes: 11 additions & 9 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:io';

import 'package:animestream/core/data/theme.dart';
import 'package:animestream/ui/models/notification.dart';
import 'package:animestream/ui/pages/newHome.dart';
import 'package:animestream/ui/pages/home.dart';
import 'package:animestream/ui/theme/mainTheme.dart';
import 'package:flutter/material.dart';
import 'package:animated_splash_screen/animated_splash_screen.dart';
Expand Down Expand Up @@ -41,23 +41,25 @@ class _MyAppState extends State<MyApp> {
onDismissActionReceivedMethod:
NotificationController.onDismissActionReceivedMethod);

getTheme().then((theme) => {
accentColor = theme.accentColor,
textMainColor = theme.textMainColor,
textSubColor = theme.textSubColor,
backgroundColor = theme.backgroundColor
});

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: Colors.black.withOpacity(0.002)));
systemNavigationBarColor: Colors.black.withOpacity(0.002),
));

getTheme().then((theme) => {
accentColor = theme.accentColor,
textMainColor = theme.textMainColor,
textSubColor = theme.textSubColor,
backgroundColor = theme.backgroundColor
});
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge, overlays: [SystemUiOverlay.top]);

super.initState();
}

// This widget is the root of your application.
@override
Widget build(BuildContext context) {

return MaterialApp(
title: 'Animestream',
theme: ThemeData(
Expand Down
43 changes: 5 additions & 38 deletions lib/ui/models/cards.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Widget characterCard(String name, String role, String imageUrl) {
child: Text(
name,
style: TextStyle(
color: Colors.white,
color: textMainColor,
fontFamily: 'NotoSans',
fontSize: 15,
overflow: TextOverflow.ellipsis,
Expand All @@ -50,7 +50,7 @@ Widget characterCard(String name, String role, String imageUrl) {
Text(
role,
style: TextStyle(
color: const Color.fromARGB(255, 141, 141, 141),
color: textSubColor,
fontFamily: 'NotoSans',
fontSize: 12,
overflow: TextOverflow.ellipsis,
Expand Down Expand Up @@ -95,7 +95,7 @@ Widget NewsCard(String title, String imageUrl, String date, String time) {
overflow: TextOverflow.ellipsis,
maxLines: 5,
style: TextStyle(
color: Colors.white,
color: textMainColor,
fontSize: 18,
fontFamily: "Rubik",
),
Expand All @@ -109,7 +109,7 @@ Widget NewsCard(String title, String imageUrl, String date, String time) {
style: TextStyle(
fontFamily: "NotoSans",
fontSize: 13,
color: const Color.fromARGB(255, 151, 151, 151),
color: textSubColor,
),
),
),
Expand Down Expand Up @@ -157,7 +157,7 @@ Widget animeCard(String title, String imageUrl) {
Text(
title,
style: TextStyle(
color: Colors.white,
color: textMainColor,
fontFamily: 'NotoSans',
fontSize: 15,
overflow: TextOverflow.ellipsis,
Expand All @@ -170,39 +170,6 @@ Widget animeCard(String title, String imageUrl) {
);
}

Widget animeCardSkeleton(String title) {
return Card(
color: Colors.black,
clipBehavior: Clip.hardEdge,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
child: Column(
children: [
Container(
margin: EdgeInsets.only(bottom: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
),
clipBehavior: Clip.hardEdge,
height: 175,
width: 115,
),
Text(
title,
style: TextStyle(
color: Colors.white,
fontFamily: 'NotoSans',
fontSize: 15,
overflow: TextOverflow.ellipsis,
),
maxLines: 2,
),
],
),
);
}

class AnimeData {
final String imageUrl;
final String title;
Expand Down
Loading

0 comments on commit a998eee

Please sign in to comment.