Skip to content

Commit c5cf119

Browse files
committed
Bugfixes and cleanup
- Removed unused images - Minor changes to onboarding to make it more up to date with Stac changes - Renamed movie_carousel to anime_home_carousel - Episode list is not reversed on details screen now - Bottom nav height adjusted for iOS - Updated Readme.md
1 parent 9a5e0a9 commit c5cf119

File tree

9 files changed

+38
-26
lines changed

9 files changed

+38
-26
lines changed

examples/ani_watch/README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
# AniWatch
1+
# AniWatch 📺
22

3-
A new Flutter project.
3+
AniWatch is a sample Flutter application built to demonstrate the capabilities of the **Stac** Server-Driven UI (SDUI) framework. The app allows users to browse through a catalog of Anime shows, view their airing schedules, and access detailed information about each series.
44

5-
## Getting Started
5+
## Features
66

7-
This project is a starting point for a Flutter application.
7+
* Browse a list/grid of Anime shows.
8+
* View detailed information for each Anime, including synopsis, genres, ratings, etc. (content driven by Stac).
9+
* Check airing schedules for ongoing and upcoming Anime.
10+
* Dynamic UI rendering powered by the Stac SDUI framework.
811

9-
A few resources to get you started if this is your first Flutter project:
12+
## Purpose
1013

11-
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
14+
This project primarily serves as an example of how to:
1315

14-
For help getting started with Flutter development, view the
15-
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16-
samples, guidance on mobile development, and a full API reference.
16+
* Integrate the Stac SDUI framework into a Flutter application.
17+
* Manage navigation and data flow in an SDUI architecture.
-1.6 MB
Binary file not shown.
-1.09 MB
Binary file not shown.

examples/ani_watch/assets/jsons/screens/onboarding_screen.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"type": "image",
88
"imageType": "asset",
99
"src": "assets/images/kny.png",
10-
"width": 10000,
11-
"height": 10000,
10+
"width": "maxFinite",
11+
"height": "maxFinite",
1212
"fit": "cover"
1313
},
1414
{
@@ -52,16 +52,9 @@
5252
},
5353
{
5454
"type": "text",
55-
"data": "",
55+
"data": "Watch, enjoy and track all of your anime series, movies and OVA’s",
5656
"style": "bodyLarge",
57-
"children": [
58-
{
59-
"data": "Watch, enjoy and track all of your anime series, movies and OVA’s",
60-
"style": {
61-
"color": "onSurfaceVariant@65"
62-
}
63-
}
64-
]
57+
"copyWithStyle": {"color": "onSurfaceVariant@65"}
6558
},
6659
{
6760
"type": "sizedBox",

examples/ani_watch/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:ani_watch/screens/navigation_view.dart';
55
import 'package:ani_watch/widgets/ani_list_description_text/ani_list_description_text_parser.dart';
66
import 'package:ani_watch/widgets/animeScheduleItem/anime_schedule_item_parser.dart';
77
import 'package:ani_watch/widgets/anime_upcoming/anime_upcoming_parser.dart';
8-
import 'package:ani_watch/widgets/movie_carousel/movie_carousel_parser.dart';
8+
import 'package:ani_watch/widgets/movie_carousel/anime_home_carousel_parser.dart';
99
import 'package:stac/stac.dart';
1010

1111
void main() async {

examples/ani_watch/lib/screens/details_screen.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ Map<String, dynamic> getAnimeEpisodesView() {
483483
"type": "listView",
484484
"padding": {"left": 16, "right": 16, "top": 0, "bottom": 0},
485485
"isPrimary": false,
486-
"reverse": true,
487486
"scrollDirection": "vertical",
488487
"shrinkWrap": true,
489488
"separator": {"type": "sizedBox", "height": 10},

examples/ani_watch/lib/screens/navigation_view.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:ani_watch/screens/home.dart';
22
import 'package:ani_watch/screens/schedule.dart';
3+
import 'package:flutter/foundation.dart';
34

45
final Map<String, dynamic> navigationView = {
56
"type": "defaultBottomNavigationController",
@@ -13,7 +14,7 @@ final Map<String, dynamic> navigationView = {
1314
},
1415
"bottomNavigationBar": {
1516
"type": "container",
16-
"height": 60,
17+
"height": getMobilePlatformSpecificValue(),
1718
"padding": 0,
1819
"child": {
1920
"type": "clipRRect",
@@ -102,3 +103,11 @@ final Map<String, dynamic> navigationView = {
102103
},
103104
},
104105
};
106+
107+
int getMobilePlatformSpecificValue() {
108+
if (defaultTargetPlatform == TargetPlatform.iOS) {
109+
return 86;
110+
} else {
111+
return 60;
112+
}
113+
}

examples/ani_watch/lib/widgets/movie_carousel/movie_carousel_parser.dart renamed to examples/ani_watch/lib/widgets/movie_carousel/anime_home_carousel_parser.dart

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'dart:ui';
22

33
import 'package:flutter/material.dart';
44
import 'package:flutter_svg/flutter_svg.dart';
5-
import 'package:ani_watch/widgets/movie_carousel/movie_carousel.dart';
5+
import 'package:ani_watch/widgets/movie_carousel/anime_home_carousel.dart';
66
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
77
import 'package:stac/stac.dart';
88

@@ -74,6 +74,16 @@ class _AnimeHomeCarouselWidgetState extends State<AnimeHomeCarouselWidget> {
7474
controller: pageController,
7575
itemCount: widget.movies.length,
7676
itemBuilder: (context, index) {
77+
var episodeText = "";
78+
try {
79+
if (widget.movies[index]['episodes'] != null) {
80+
episodeText = "${widget.movies[index]['episodes']}";
81+
} else if(widget.movies[index]['nextAiringEpisode']['episode'] != null) {
82+
episodeText = "${widget.movies[index]['nextAiringEpisode']['episode'] - 1}";
83+
}
84+
} on Exception {
85+
episodeText = "";
86+
}
7787
return Padding(
7888
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
7989
child: Container(
@@ -148,7 +158,7 @@ class _AnimeHomeCarouselWidgetState extends State<AnimeHomeCarouselWidget> {
148158
),
149159
),
150160
Text(
151-
"${widget.movies[index]['season'].toString().toCapitalized} ${widget.movies[index]['seasonYear']} · ${widget.movies[index]['episodes'] ?? widget.movies[index]['nextAiringEpisode']['episode'] - 1} Episodes",
161+
"${widget.movies[index]['season'].toString().toCapitalized} ${widget.movies[index]['seasonYear']}${episodeText.isEmpty ? "" : " · $episodeText Episodes"}",
152162
style: Theme.of(
153163
context,
154164
).textTheme.bodyMedium?.apply(

0 commit comments

Comments
 (0)