Skip to content

Commit b0f354f

Browse files
authored
Merge pull request #45 from roughike/release/1.0.1
v1.0.1
2 parents a54af3d + e4edd00 commit b0f354f

File tree

8 files changed

+216
-36
lines changed

8 files changed

+216
-36
lines changed

android/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
/build
99
/captures
1010
GeneratedPluginRegistrant.java
11+
*.jks

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ android {
3333
applicationId "com.roughike.inkino"
3434
minSdkVersion 16
3535
targetSdkVersion 27
36-
versionCode 2
37-
versionName "1.0.0"
36+
versionCode 4
37+
versionName "1.0.1"
3838
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3939
}
4040

assets/images/powered_by_tmdb.png

3.93 KB
Loading

ios/Runner/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.0</string>
20+
<string>1.0.1</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>3</string>
24+
<string>5</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
2727
<key>UILaunchStoryboardName</key>

lib/assets.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
class ImageAssets {
22
static const String transparentImage = 'assets/images/1x1_transparent.png';
3+
static const String poweredByTMDBLogo = 'assets/images/powered_by_tmdb.png';
34
}
45

56
class OtherAssets {

lib/ui/main_page.dart

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:inkino/redux/app/app_actions.dart';
88
import 'package:inkino/redux/app/app_state.dart';
99
import 'package:inkino/ui/events/events_page.dart';
1010
import 'package:inkino/ui/showtimes/showtimes_page.dart';
11+
import 'package:inkino/ui/theater_list/inkino_drawer_header.dart';
1112
import 'package:inkino/ui/theater_list/theater_list.dart';
1213

1314
class MainPage extends StatefulWidget {
@@ -134,36 +135,6 @@ class _MainPageState extends State<MainPage>
134135
];
135136
}
136137

137-
Widget _buildDrawer() {
138-
var textTheme = Theme.of(context).textTheme;
139-
var drawerHeader = new Container(
140-
color: Theme.of(context).primaryColor,
141-
constraints: new BoxConstraints.expand(height: 175.0),
142-
padding: const EdgeInsets.all(16.0),
143-
child: new Column(
144-
crossAxisAlignment: CrossAxisAlignment.start,
145-
mainAxisAlignment: MainAxisAlignment.end,
146-
children: <Widget>[
147-
new Text(
148-
'inKino',
149-
style: textTheme.display1.copyWith(color: Colors.white70),
150-
),
151-
new Text(
152-
'v1.0.0',
153-
style: textTheme.body2.copyWith(color: Colors.white),
154-
),
155-
],
156-
),
157-
);
158-
159-
return new Drawer(
160-
child: new TheaterList(
161-
header: drawerHeader,
162-
onTheaterTapped: () => Navigator.pop(context),
163-
),
164-
);
165-
}
166-
167138
@override
168139
Widget build(BuildContext context) {
169140
return new Scaffold(
@@ -182,7 +153,12 @@ class _MainPageState extends State<MainPage>
182153
],
183154
),
184155
),
185-
drawer: _buildDrawer(),
156+
drawer: new Drawer(
157+
child: new TheaterList(
158+
header: new InKinoDrawerHeader(),
159+
onTheaterTapped: () => Navigator.pop(context),
160+
),
161+
),
186162
body: new TabBarView(
187163
controller: _controller,
188164
children: <Widget>[
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
import 'package:flutter/gestures.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:inkino/assets.dart';
4+
import 'package:url_launcher/url_launcher.dart';
5+
6+
class InKinoDrawerHeader extends StatefulWidget {
7+
@override
8+
_InKinoDrawerHeaderState createState() => new _InKinoDrawerHeaderState();
9+
}
10+
11+
class _InKinoDrawerHeaderState extends State<InKinoDrawerHeader> {
12+
static const String flutterUrl = 'https://flutter.io/';
13+
static const String githubUrl = 'https://github.com/roughike/inKino';
14+
static final TextStyle linkStyle = new TextStyle(
15+
color: Colors.blue,
16+
decoration: TextDecoration.underline,
17+
);
18+
19+
TapGestureRecognizer _flutterTapRecognizer;
20+
TapGestureRecognizer _githubTapRecognizer;
21+
22+
@override
23+
void initState() {
24+
super.initState();
25+
_flutterTapRecognizer = new TapGestureRecognizer()
26+
..onTap = () => _openUrl(flutterUrl);
27+
_githubTapRecognizer = new TapGestureRecognizer()
28+
..onTap = () => _openUrl(githubUrl);
29+
}
30+
31+
@override
32+
void dispose() {
33+
_flutterTapRecognizer.dispose();
34+
_githubTapRecognizer.dispose();
35+
super.dispose();
36+
}
37+
38+
void _openUrl(String url) async {
39+
// Close the about dialog.
40+
Navigator.pop(context);
41+
42+
if (await canLaunch(url)) {
43+
await launch(url);
44+
}
45+
}
46+
47+
Widget _buildAppNameAndVersion(BuildContext context) {
48+
var textTheme = Theme.of(context).textTheme;
49+
50+
return new Padding(
51+
padding: const EdgeInsets.all(16.0),
52+
child: new Column(
53+
crossAxisAlignment: CrossAxisAlignment.start,
54+
mainAxisAlignment: MainAxisAlignment.end,
55+
children: <Widget>[
56+
new Text(
57+
'inKino',
58+
style: textTheme.display1.copyWith(color: Colors.white70),
59+
),
60+
new Text(
61+
'v1.0.1', // TODO: figure out a way to get this dynamically
62+
style: textTheme.body2.copyWith(color: Colors.white),
63+
),
64+
],
65+
),
66+
);
67+
}
68+
69+
Widget _buildAboutButton(BuildContext context) {
70+
var content = new Row(
71+
mainAxisAlignment: MainAxisAlignment.end,
72+
children: <Widget>[
73+
new Icon(
74+
Icons.info_outline,
75+
color: Colors.white70,
76+
size: 18.0,
77+
),
78+
new Padding(
79+
padding: const EdgeInsets.only(left: 8.0),
80+
child: new Text(
81+
'About',
82+
textAlign: TextAlign.end,
83+
style: new TextStyle(
84+
color: Colors.white70,
85+
fontSize: 12.0,
86+
),
87+
),
88+
),
89+
],
90+
);
91+
92+
return new Material(
93+
color: Colors.transparent,
94+
child: new InkWell(
95+
onTap: () {
96+
showDialog(
97+
context: context,
98+
child: _buildAboutDialog(context),
99+
);
100+
},
101+
child: new Padding(
102+
padding: const EdgeInsets.all(16.0),
103+
child: content,
104+
),
105+
),
106+
);
107+
}
108+
109+
Widget _buildAboutDialog(BuildContext context) {
110+
return new AlertDialog(
111+
title: new Text('About inKino'),
112+
content: new Column(
113+
mainAxisSize: MainAxisSize.min,
114+
crossAxisAlignment: CrossAxisAlignment.start,
115+
children: <Widget>[
116+
_buildAboutText(),
117+
_buildTMDBAttribution(),
118+
],
119+
),
120+
actions: <Widget>[
121+
new FlatButton(
122+
onPressed: () {
123+
Navigator.of(context).pop();
124+
},
125+
textColor: Theme.of(context).primaryColor,
126+
child: new Text('Okay, got it!'),
127+
),
128+
],
129+
);
130+
}
131+
132+
Widget _buildAboutText() {
133+
return new RichText(
134+
text: new TextSpan(
135+
text: 'inKino is the unofficial Finnkino client that '
136+
'is minimalistic, fast, and delightful to use.\n\n',
137+
style: new TextStyle(color: Colors.black87),
138+
children: <TextSpan>[
139+
new TextSpan(text: 'The app was developed with '),
140+
new TextSpan(
141+
text: 'Flutter',
142+
recognizer: _flutterTapRecognizer,
143+
style: linkStyle,
144+
),
145+
new TextSpan(
146+
text: ' and it\'s open source; check out the source '
147+
'code yourself from ',
148+
),
149+
new TextSpan(
150+
text: 'the GitHub repo',
151+
recognizer: _githubTapRecognizer,
152+
style: linkStyle,
153+
),
154+
new TextSpan(text: '.'),
155+
],
156+
),
157+
);
158+
}
159+
160+
Widget _buildTMDBAttribution() {
161+
return new Padding(
162+
padding: const EdgeInsets.only(top: 16.0),
163+
child: new Row(
164+
children: <Widget>[
165+
new Padding(
166+
padding: const EdgeInsets.only(top: 8.0),
167+
child: new Image.asset(
168+
ImageAssets.poweredByTMDBLogo,
169+
width: 32.0,
170+
),
171+
),
172+
new Expanded(
173+
child: new Padding(
174+
padding: const EdgeInsets.only(left: 12.0),
175+
child: new Text(
176+
'This product uses the TMDb API but is not endorsed or certified by TMDb.',
177+
style: new TextStyle(fontSize: 12.0),
178+
),
179+
),
180+
),
181+
],
182+
),
183+
);
184+
}
185+
186+
@override
187+
Widget build(BuildContext context) {
188+
return new Container(
189+
color: Theme.of(context).primaryColor,
190+
constraints: new BoxConstraints.expand(height: 175.0),
191+
child: new Row(
192+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
193+
crossAxisAlignment: CrossAxisAlignment.end,
194+
children: <Widget>[
195+
_buildAppNameAndVersion(context),
196+
_buildAboutButton(context),
197+
],
198+
),
199+
);
200+
}
201+
}

pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ flutter:
2121
uses-material-design: true
2222
assets:
2323
- assets/preloaded_data/theaters.xml
24-
- assets/images/1x1_transparent.png
24+
- assets/images/1x1_transparent.png
25+
- assets/images/powered_by_tmdb.png

0 commit comments

Comments
 (0)