Skip to content

Commit

Permalink
Fix bugs, add first use how to use screen
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysusm committed Jul 21, 2018
1 parent 99530c8 commit 532f119
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 23 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Cine-Data is an android app movie tracker that was made with flutter and uses TMDB Api.

#### Availabe download clicking in the logo
<a href="https://github.com/JaysusM/Cine-Data/releases/download/v1.0.1/CineData.apk"><img src="./screenshots/cinedata.png" height="250" alt="download logo"/></a>

# Screenshots

| Home Screen | Info Page |
Expand All @@ -19,3 +22,4 @@ Cine-Data is an android app movie tracker that was made with flutter and uses TM
| Genres list Screen | Genre Screen |
| ------------------ | ------------------ |
| <img src="./screenshots/genres.png" height="400" alt="genres"/> | <img src="./screenshots/genre page.png" height="400" alt="genre page"/> |

Binary file modified assets/Mystery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions lib/genre_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'searcher.dart';
import 'movie.dart';
import 'dart:async';
import 'dart:convert';
import 'dictionary.dart';
import 'grid_movie_screen.dart';
import 'loaded_content.dart';

Expand Down Expand Up @@ -80,7 +79,7 @@ class GenreScreenState extends State {
child: new Column(
children: <Widget>[
new Text("Awaiting results...",
style: new TextStyle(fontSize: 17.0)),
style: new TextStyle(fontSize: 17.0, fontFamily: 'Muli')),
new Image(image: new AssetImage("assets/loading.gif")),
],
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down
6 changes: 3 additions & 3 deletions lib/grid_movie_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'loaded_content.dart';

class GridMovieScreen extends StatelessWidget {

List<Movie> movies;
ScrollController controller;
final List<Movie> movies;
final ScrollController controller;

GridMovieScreen(this.movies, this.controller);

Expand All @@ -25,7 +25,7 @@ class GridMovieScreen extends StatelessWidget {
}

static Movie checkWatchlist(Movie movie) {
if (LoadedContent.toWatchMovies.any((x) => x.id == movie.id)) {
if (LoadedContent.watchedMovies.any((x) => x.id == movie.id)) {
movie.setWatched(true);
movie.setToWatch(false);
} else if (LoadedContent.toWatchMovies.any((x) => x.id == movie.id)) {
Expand Down
6 changes: 2 additions & 4 deletions lib/info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'loaded_content.dart';
import 'watchlist_manager.dart';

class InfoPage extends StatefulWidget {
Movie movie;
final Movie movie;

InfoPage(this.movie);

Expand Down Expand Up @@ -61,8 +61,6 @@ class InfoPageState extends State<InfoPage> {
: _buildPage(),
new GestureDetector(
child: new Container(
child: new Hero(
tag: widget.movie.id,
child: new Material(
child: new FadeInImage(
fit: BoxFit.fitHeight,
Expand All @@ -72,7 +70,7 @@ class InfoPageState extends State<InfoPage> {
),
borderRadius: new BorderRadius.circular(13.0),
elevation: 7.0,
)),
),
height: MediaQuery.of(context).size.height * 0.3,
margin: new EdgeInsets.only(left: 15.0, top: 60.0),
),
Expand Down
15 changes: 11 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ class MyApp extends StatelessWidget {
"/watched": (BuildContext context) => new WatchlistScreen(true),
"/toWatch": (BuildContext context) => new WatchlistScreen(false),
"/genres": (BuildContext context) =>
ScaffoldContainer(new GenreScreen(), "Genres"),
scaffoldContainer(new GenreScreen(), "Genres"),
"/popular": (BuildContext context) =>
ScaffoldContainer(new PopularMoviesWidget(), "Popular Movies"),
scaffoldContainer(new PopularMoviesWidget(), "Popular Movies"),
"/upcoming": (BuildContext context) =>
ScaffoldContainer(new UpcomingMoviesWidget(), "Upcoming Movies")
scaffoldContainer(new UpcomingMoviesWidget(), "Upcoming Movies")
},
home: new MainScreen(),
);
}

Widget ScaffoldContainer(Widget body, String title) {
Widget scaffoldContainer(Widget body, String title) {
return new Scaffold(
appBar: new AppBar(
title: new Text(title,
Expand Down Expand Up @@ -64,6 +64,13 @@ class MainScreenState extends State with SingleTickerProviderStateMixin {
tabController = new TabController(length: 3, vsync: this)..index = 1;
}

@override
void initState() {
super.initState();
WidgetsBinding.instance
.addPostFrameCallback((_) => (Watchlist.firstUseDB) ? howToUseDialog() : null);
}

Widget build(BuildContext context) {
return new Scaffold(
drawer: new Drawer(
Expand Down
6 changes: 2 additions & 4 deletions lib/movie_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'watchlist_manager.dart';
import 'loaded_content.dart';

class MovieBox extends StatefulWidget {
Movie movie;
final Movie movie;

MovieBox(this.movie);

Expand All @@ -18,13 +18,11 @@ class MovieBoxState extends State<MovieBox> {
Widget build(BuildContext context) {
return new GestureDetector(
child: new GridTile(
child: new Hero(
tag: widget.movie.id,
child: new FadeInImage(
fit: BoxFit.cover,
placeholder: new AssetImage("assets/loadingCircle.gif"),
image: new NetworkImage(widget.movie.getPosterUrl()),
)),
),
footer: new GridTileBar(
leading: (widget.movie.watched()) ? new Icon(Icons.check_circle, color: Colors.green) : (!widget.movie.toWatch()) ? new Container() : new Icon(Icons.remove_red_eye, color: Colors.white),
title: new Text(widget.movie.title, style: new TextStyle(fontFamily: 'Muli')),
Expand Down
2 changes: 1 addition & 1 deletion lib/popular_movies.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class PopularMoviesWidgetState extends State<PopularMoviesWidget> {
child: new Column(
children: <Widget>[
new Text("Awaiting results...",
style: new TextStyle(fontSize: 17.0)),
style: new TextStyle(fontSize: 17.0, fontFamily: 'Muli')),
new Image(image: new AssetImage("assets/loading.gif")),
],
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down
2 changes: 1 addition & 1 deletion lib/upcoming_movies.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class UpcomingMoviesState extends State {
child: new Column(
children: <Widget>[
new Text("Awaiting results...",
style: new TextStyle(fontSize: 17.0)),
style: new TextStyle(fontSize: 17.0, fontFamily: 'Muli')),
new Image(image: new AssetImage("assets/loading.gif")),
],
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down
6 changes: 2 additions & 4 deletions lib/watchlist_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'movie.dart';
class Watchlist {

static Database db;
static bool firstUseDB = true;
static bool firstUseDB = false;

static const String sqlMovie = """
id INTEGER PRIMARY KEY,
Expand All @@ -32,9 +32,7 @@ class Watchlist {
});

db = await openDatabase(path);
List<Movie> watched = await watchedList();

watched.forEach((movie) => dropToWatchMovie(movie.id));
(await watchedList()).forEach((movie) => dropToWatchMovie(movie.id));
}

static addWatchedMovie(Movie movie) async {
Expand Down
Binary file added screenshots/cinedata.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/drawer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 532f119

Please sign in to comment.