Skip to content

Commit

Permalink
Multiplatform stuff (roughike#102)
Browse files Browse the repository at this point in the history
* Multiplatform stuff.
* Update to make stuff work with the latest Flutter beta.
  • Loading branch information
roughike authored Nov 7, 2018
1 parent 2165759 commit 59fd61a
Show file tree
Hide file tree
Showing 344 changed files with 8,555 additions and 3,305 deletions.
45 changes: 36 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
.DS_Store
android/google-play-service-account.json
android/key.properties

_Store
.atom/
.idea
.idea/
.vscode/

.packages
.pub/
build/
ios/.generated/
packages
.dart_tool/
pubspec.lock

Podfile
Podfile.lock
Pods/
.symlinks/
**/Flutter/App.framework/
**/Flutter/Flutter.framework/
**/Flutter/Generated.xcconfig
**/Flutter/flutter_assets/
ServiceDefinitions.json
xcuserdata/

local.properties
.gradle/
gradlew
gradlew.bat
gradle-wrapper.jar
*.iml

GeneratedPluginRegistrant.h
GeneratedPluginRegistrant.m
GeneratedPluginRegistrant.java
build/
.flutter-plugins
lib/tmdb_config.dart
ios/Podfile.lock
.idea/workspace.xml
.firebaserc
.firebase/
.firebase-debug.log
.DS_Store

android/google-play-service-account.json
android/key.properties
core/lib/src/tmdb_config.dart
65 changes: 52 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,61 @@
# inKino - a showtime browser for Finnkino cinemas
# inKino - a multiplatform Dart project with code sharing between Flutter and web

[![Build Status](https://travis-ci.org/roughike/inKino.svg?branch=development)](https://travis-ci.org/roughike/inKino) [![Coverage Status](https://coveralls.io/repos/github/roughike/inKino/badge.svg?branch=development)](https://coveralls.io/github/roughike/inKino?branch=development)

<img src="https://github.com/roughike/inKino/blob/development/screenshots/now_in_theaters.png" width="33%" /> <img src="https://github.com/roughike/inKino/blob/development/screenshots/showtimes.png" width="33%" /> <img src="https://github.com/roughike/inKino/blob/development/screenshots/event_details.png" width="33%" />
<img src="_screenshots/now_in_theaters.png" width="33%" /> <img src="_screenshots/showtimes.png" width="33%" /> <img src="_screenshots/event_details.png" width="33%" />

## What is inKino?

inKino is a minimal app for browsing movies and showtimes for [Finnkino](https://finnkino.fi/) cinemas. It's made with [Flutter](https://flutter.io/), uses [flutter_redux](https://github.com/brianegan/flutter_redux), and has an [extensive set of unit and widget tests](https://github.com/roughike/inKino/tree/development/test). It also has smooth transition animations and handles offline use cases gracefully.
inKino is a _multiplatform_ Dart app for browsing movies and showtimes for Finnkino cinemas.

While I built inKino for my own needs, it is also intented to showcase good app structure and a clean, well-organized Flutter codebase. The app uses the [Finnkino XML API](https://finnkino.fi/xml) for fetching movies and showtimes, and the [TMDB API](https://www.themoviedb.org/documentation/api) for fetching the actor avatars.
InKino showcases Redux, has an extensive set of automated tests and **40% code sharing between Flutter and web**.
The Android & iOS apps are made with a single [Flutter](http://flutter.io) codebase. The progressive web app is made with [AngularDart](https://webdev.dartlang.org/angular).
This project is generally something that I believe is a good example of a multiplatform Dart project.

The source code is **100% Dart**, and everything resides in the [/lib](https://github.com/roughike/inKino/tree/development/lib) folder.
I plan on doing a full article series on multiplatform Dart stuff, so you might want to [check out my blog](https://iirokrankka.com) and subscribe to it.

<div>
<a href='https://play.google.com/store/apps/details?id=com.roughike.inkino'><img alt='Get it on Google Play' src='https://github.com/roughike/inKino/blob/development/screenshots/google_play.png' height='40px'/></a> <a href='https://itunes.apple.com/us/app/inkino/id1367181450'><img alt='Get it on the App Store' src='https://github.com/roughike/inKino/blob/development/screenshots/app_store.png' height='40px'/></a>
<a href='https://play.google.com/store/apps/details?id=com.roughike.inkino'><img alt='Get it on Google Play' src='_screenshots/google_play.png' height='48px'/></a>
<a href='https://itunes.apple.com/us/app/inkino/id1367181450'><img alt='Get it on the App Store' src='_screenshots/app_store.png' height='48px'/></a>
<a href='https://inkino.app'><img alt='Get it on the App Store' src='_screenshots/launch_pwa.png' height='48px'/></a>
</div>

## Folder structure

There's three different folders. Each of them is a Dart project.

* **core**: contains the pure Dart business logic, such API communication, Redux, XML parsing, sanitization, i18n, models and utilities.
It also has a great test coverage.
* **mobile**: this is the Flutter project. It imports **core**, and it's a 100% shared codebase for the native Android & iOS apps that go on app stores.
* **web**: the AngularDart progressive web app. Also imports **core**, and it's the thing that is live at https://inkino.app.

To work on these projects, open each one of them in an editor of your choice.

For example, if you want to do a new feature and you do it for the Flutter project first, you'd open both **core** and **mobile** in separate editor windows.
To clarify, you'd do `File -> Open...` for core and then `File -> Open...` again for mobile.

## Development environment setup

* [Install Dart for the web](https://webdev.dartlang.org/tools/sdk#install). The customized Dart version Flutter ships with is not suitable for web development.
* Install [webdev](https://webdev.dartlang.org/tools/webdev) by running `pub global activate webdev`. This requires that you ran your Dart installation properly and Dart is part of your PATH.
* Install an IDE. You can't go wrong with [WebStorm](https://webdev.dartlang.org/tools/webstorm). If that doesn't tickle your fancy, [there are other options too](https://www.dartlang.org/tools#ides).
* Install the Dart plugin for your IDE.

Finally, if you haven't already, [install Flutter](https://flutter.io/docs/get-started/install).
And the Flutter plugin for your IDE.
At the time of being, inKino is built with **Flutter 0.10.2**.

If you don't like IDEs, [you can apparently use Emacs or Vim too](https://news.ycombinator.com/item?id=16822780).

## Building the project

### Renaming the TMDB configuration file

If you try to build the project straight away, you'll get an error complaining that a `tmdb_config.dart` file is missing. To resolve that, run this on your terminal in the project root:
You don't need a TMDB API key, but the actor images won't load without it.

If you try to build the project straight away, you'll get an error complaining that a tmdb_config.dart file is missing.
To resolve that, run this on your terminal in the project root:

```bash
cd lib && mv tmdb_config.dart.sample tmdb_config.dart && cd ..
cd core/lib/src && mv tmdb_config.dart.sample tmdb_config.dart && cd ../../..
```

**OR**
Expand All @@ -32,12 +64,19 @@ If you don't trust in random bash scripts copied from the Internet, you can just

### Building from source

To build the project, ensure that you have a recent version of the Flutter SDK installed. Then either run `flutter run` in the project root or use your IDE of choice. To run the tests, run `flutter test` in the project root.
First, ensure that you followed the "Development environment setup" section above.

* To run the **web project**, first run `pub get` initially, and then `webdev serve` in the root of the web project.
* To run the **Flutter project**, open it in your editor and click the play button, or run `flutter run` on your terminal.

## Contributing

Contributions are welcome! However, if it's going to be a major change, please create an issue first. Before starting to work on something, please comment on a specific issue and say you'd like to work on it.
Contributions are welcome!
However, if it's going to be a major change, please create an issue first.
Before starting to work on something, please comment on a specific issue and say you'd like to work on it.

## Thanks

Special thanks to [Thibaud Colas](https://twitter.com/thibaud_colas), [Brian Egan](https://twitter.com/brianegan), [Alessandro Aime](https://twitter.com/aimealessandro) and [Juho Rautioaho](https://github.com/Jraut) for giving their extra pair of eyes for reviewing the source code.
Special thanks to [Olli Haataja](https://www.linkedin.com/in/olli-haataja-46b96b120/) for the design.

Additional thanks for the initial release go to [Thibaud Colas](https://twitter.com/thibaud_colas), [Brian Egan](https://twitter.com/brianegan), [Alessandro Aime](https://twitter.com/aimealessandro) and [Juho Rautioaho](https://github.com/Jraut) for giving their extra pair of eyes for reviewing the source code.
File renamed without changes
Binary file added _screenshots/event_details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added _screenshots/launch_pwa.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 added _screenshots/now_in_theaters.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 added _screenshots/showtimes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 0 additions & 12 deletions android.iml

This file was deleted.

Binary file removed android/app/release/app-release.apk
Binary file not shown.
Binary file removed android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
160 changes: 0 additions & 160 deletions android/gradlew

This file was deleted.

Loading

0 comments on commit 59fd61a

Please sign in to comment.