Skip to content

Commit c2002b0

Browse files
committed
API: Adding buttons to check Twitter and reload screen
1 parent 5372a98 commit c2002b0

File tree

7 files changed

+169
-87
lines changed

7 files changed

+169
-87
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22
<application
3-
android:label="guardian_dock"
3+
android:label="Guardian Dock"
44
android:name="${applicationName}"
55
android:icon="@mipmap/ic_launcher">
66
<activity
@@ -30,4 +30,10 @@
3030
android:name="flutterEmbedding"
3131
android:value="2" />
3232
</application>
33+
<queries>
34+
<intent>
35+
<action android:name="android.intent.action.VIEW" />
36+
<data android:scheme="https" />
37+
</intent>
38+
</queries>
3339
</manifest>

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,13 @@
475475
DEVELOPMENT_TEAM = 6MURAC78AD;
476476
ENABLE_BITCODE = NO;
477477
INFOPLIST_FILE = Runner/Info.plist;
478+
INFOPLIST_KEY_CFBundleDisplayName = "Guardian Dock";
479+
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
478480
LD_RUNPATH_SEARCH_PATHS = (
479481
"$(inherited)",
480482
"@executable_path/Frameworks",
481483
);
484+
MARKETING_VERSION = 0.1;
482485
PRODUCT_BUNDLE_IDENTIFIER = dock.guardian.guardianDock;
483486
PRODUCT_NAME = "$(TARGET_NAME)";
484487
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -661,10 +664,13 @@
661664
DEVELOPMENT_TEAM = 6MURAC78AD;
662665
ENABLE_BITCODE = NO;
663666
INFOPLIST_FILE = Runner/Info.plist;
667+
INFOPLIST_KEY_CFBundleDisplayName = "Guardian Dock";
668+
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
664669
LD_RUNPATH_SEARCH_PATHS = (
665670
"$(inherited)",
666671
"@executable_path/Frameworks",
667672
);
673+
MARKETING_VERSION = 0.1;
668674
PRODUCT_BUNDLE_IDENTIFIER = dock.guardian.guardianDock;
669675
PRODUCT_NAME = "$(TARGET_NAME)";
670676
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -687,10 +693,13 @@
687693
DEVELOPMENT_TEAM = 6MURAC78AD;
688694
ENABLE_BITCODE = NO;
689695
INFOPLIST_FILE = Runner/Info.plist;
696+
INFOPLIST_KEY_CFBundleDisplayName = "Guardian Dock";
697+
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
690698
LD_RUNPATH_SEARCH_PATHS = (
691699
"$(inherited)",
692700
"@executable_path/Frameworks",
693701
);
702+
MARKETING_VERSION = 0.1;
694703
PRODUCT_BUNDLE_IDENTIFIER = dock.guardian.guardianDock;
695704
PRODUCT_NAME = "$(TARGET_NAME)";
696705
PROVISIONING_PROFILE_SPECIFIER = "";

ios/Runner/Base.lproj/Main.storyboard

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
3-
<dependencies>
4-
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
6-
</dependencies>
7-
<scenes>
8-
<!--Flutter View Controller-->
9-
<scene sceneID="tne-QT-ifu">
10-
<objects>
11-
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
12-
<layoutGuides>
13-
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
14-
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
15-
</layoutGuides>
16-
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
17-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
18-
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
20-
</view>
21-
</viewController>
22-
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
23-
</objects>
24-
</scene>
25-
</scenes>
26-
</document>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina6_12" orientation="portrait" appearance="light"/>
4+
<dependencies>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8+
</dependencies>
9+
<scenes>
10+
<!--Flutter View Controller-->
11+
<scene sceneID="tne-QT-ifu">
12+
<objects>
13+
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
14+
<layoutGuides>
15+
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
16+
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
17+
</layoutGuides>
18+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
19+
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
20+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
21+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
22+
</view>
23+
</viewController>
24+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
25+
</objects>
26+
<point key="canvasLocation" x="-16" y="-40"/>
27+
</scene>
28+
</scenes>
29+
</document>

ios/Runner/Info.plist

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,55 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3-
<plist version="1.0">
4-
<dict>
5-
<key>CFBundleDevelopmentRegion</key>
6-
<string>$(DEVELOPMENT_LANGUAGE)</string>
7-
<key>CFBundleDisplayName</key>
8-
<string>Guardian Dock</string>
9-
<key>CFBundleExecutable</key>
10-
<string>$(EXECUTABLE_NAME)</string>
11-
<key>CFBundleIdentifier</key>
12-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13-
<key>CFBundleInfoDictionaryVersion</key>
14-
<string>6.0</string>
15-
<key>CFBundleName</key>
16-
<string>guardian_dock</string>
17-
<key>CFBundlePackageType</key>
18-
<string>APPL</string>
19-
<key>CFBundleShortVersionString</key>
20-
<string>$(FLUTTER_BUILD_NAME)</string>
21-
<key>CFBundleSignature</key>
22-
<string>????</string>
23-
<key>CFBundleVersion</key>
24-
<string>$(FLUTTER_BUILD_NUMBER)</string>
25-
<key>LSRequiresIPhoneOS</key>
26-
<true/>
27-
<key>UILaunchStoryboardName</key>
28-
<string>LaunchScreen</string>
29-
<key>UIMainStoryboardFile</key>
30-
<string>Main</string>
31-
<key>UISupportedInterfaceOrientations</key>
32-
<array>
33-
<string>UIInterfaceOrientationPortrait</string>
34-
<string>UIInterfaceOrientationLandscapeLeft</string>
35-
<string>UIInterfaceOrientationLandscapeRight</string>
36-
</array>
37-
<key>UISupportedInterfaceOrientations~ipad</key>
38-
<array>
39-
<string>UIInterfaceOrientationPortrait</string>
40-
<string>UIInterfaceOrientationPortraitUpsideDown</string>
41-
<string>UIInterfaceOrientationLandscapeLeft</string>
42-
<string>UIInterfaceOrientationLandscapeRight</string>
43-
</array>
44-
<key>UIViewControllerBasedStatusBarAppearance</key>
45-
<false/>
46-
<key>CADisableMinimumFrameDurationOnPhone</key>
47-
<true/>
48-
<key>UIApplicationSupportsIndirectInputEvents</key>
49-
<true/>
50-
</dict>
51-
</plist>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
7+
<key>CFBundleDevelopmentRegion</key>
8+
<string>$(DEVELOPMENT_LANGUAGE)</string>
9+
<key>CFBundleDisplayName</key>
10+
<string>Guardian Dock</string>
11+
<key>CFBundleExecutable</key>
12+
<string>$(EXECUTABLE_NAME)</string>
13+
<key>CFBundleIdentifier</key>
14+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
15+
<key>CFBundleInfoDictionaryVersion</key>
16+
<string>6.0</string>
17+
<key>CFBundleName</key>
18+
<string>guardian_dock</string>
19+
<key>CFBundlePackageType</key>
20+
<string>APPL</string>
21+
<key>CFBundleShortVersionString</key>
22+
<string>$(FLUTTER_BUILD_NAME)</string>
23+
<key>CFBundleSignature</key>
24+
<string>????</string>
25+
<key>CFBundleVersion</key>
26+
<string>$(FLUTTER_BUILD_NUMBER)</string>
27+
<key>LSApplicationQueriesSchemes</key>
28+
<array>
29+
<string>https</string>
30+
</array>
31+
<key>LSRequiresIPhoneOS</key>
32+
<true/>
33+
<key>UIApplicationSupportsIndirectInputEvents</key>
34+
<true/>
35+
<key>UILaunchStoryboardName</key>
36+
<string>LaunchScreen</string>
37+
<key>UIMainStoryboardFile</key>
38+
<string>Main</string>
39+
<key>UIStatusBarStyle</key>
40+
<string></string>
41+
<key>UISupportedInterfaceOrientations</key>
42+
<array>
43+
<string>UIInterfaceOrientationPortrait</string>
44+
</array>
45+
<key>UISupportedInterfaceOrientations~ipad</key>
46+
<array>
47+
<string>UIInterfaceOrientationLandscapeLeft</string>
48+
<string>UIInterfaceOrientationLandscapeRight</string>
49+
<string>UIInterfaceOrientationPortrait</string>
50+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
51+
</array>
52+
<key>UIViewControllerBasedStatusBarAppearance</key>
53+
<false/>
54+
</dict>
55+
</plist>

lib/src/theme.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ const ColorScheme appScheme = ColorScheme(
3232

3333
class AppTheme {
3434
static final ThemeData defaultTheme = ThemeData(
35-
fontFamily: 'NeueHaasDisplay',
36-
scaffoldBackgroundColor: appScheme.background,
37-
colorScheme: appScheme
35+
fontFamily: 'NeueHaasDisplay',
36+
scaffoldBackgroundColor: appScheme.background,
37+
colorScheme: appScheme,
38+
useMaterial3: true
3839
);
3940
}

lib/src/views/home_view.dart

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import 'package:flutter/material.dart';
22

33
import 'package:get_it/get_it.dart';
4-
import 'package:guardian_dock/src/widgets/maintenance_error.dart';
54

65
import 'package:guardian_dock/src/widgets/persistent_search_bar.dart';
6+
import 'package:guardian_dock/src/widgets/maintenance_error.dart';
77
import 'package:guardian_dock/src/widgets/rss/rss_news_feed.dart';
88
import 'package:guardian_dock/src/widgets/custom_appbar.dart';
99
import 'package:guardian_dock/api/models/news_article.dart';
@@ -19,7 +19,6 @@ class HomeView extends StatefulWidget {
1919
class _HomeViewState extends State<HomeView> {
2020
List<NewsArticle> fetchedArticles = [];
2121
bool isLoadingNewsArticle = false;
22-
late Future<void> future;
2322

2423
Future<void> getManifest() async => await GetIt.I<ApiClient>().getManifest();
2524

@@ -29,14 +28,13 @@ class _HomeViewState extends State<HomeView> {
2928

3029
@override
3130
void initState() {
32-
future = Future.wait([getNewsArticles(), getManifest()]);
3331
super.initState();
3432
}
3533

3634
@override
3735
Widget build(BuildContext context) {
3836
return FutureBuilder(
39-
future: future,
37+
future: Future.wait([getNewsArticles(), getManifest()]),
4038
builder: (BuildContext context, AsyncSnapshot<void> snapshot) {
4139
if (snapshot.connectionState == ConnectionState.waiting) {
4240
return Center(
@@ -48,7 +46,15 @@ class _HomeViewState extends State<HomeView> {
4846
)
4947
);
5048
} else if (snapshot.hasError) {
51-
return Scaffold(body: MaintenanceError(error: snapshot.error));
49+
return Scaffold(
50+
body: MaintenanceError(
51+
error: snapshot.error,
52+
onReload: () {
53+
setState(() {});
54+
Future.delayed(const Duration(seconds: 5));
55+
},
56+
)
57+
);
5258
}
5359
return Scaffold(
5460
resizeToAvoidBottomInset: false,

lib/src/widgets/maintenance_error.dart

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import 'package:flutter/material.dart';
2+
import 'package:simple_icons/simple_icons.dart';
3+
import 'package:url_launcher/url_launcher.dart';
24

35
class MaintenanceError extends StatelessWidget {
46
final Object? error;
7+
final void Function() onReload;
58

6-
const MaintenanceError({required this.error, super.key});
9+
const MaintenanceError({required this.error, required this.onReload, super.key});
710

811
@override
912
Widget build(BuildContext context) {
@@ -30,6 +33,56 @@ class MaintenanceError extends StatelessWidget {
3033
color: Theme.of(context).colorScheme.error,
3134
),
3235
),
36+
),
37+
SizedBox(height: MediaQuery.of(context).size.height * .02),
38+
Row(
39+
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
40+
crossAxisAlignment: CrossAxisAlignment.center,
41+
children: [
42+
Flexible(
43+
child: ElevatedButton.icon(
44+
onPressed: () async {
45+
canLaunchUrl(Uri.parse("https://twitter.com/BungieHelp")).then((bool result) async {
46+
await launchUrl(
47+
Uri.parse("https://twitter.com/BungieHelp"),
48+
mode: LaunchMode.externalApplication
49+
);
50+
});
51+
},
52+
label: Text("@BungieHelp",
53+
style: TextStyle(
54+
color: Theme.of(context).colorScheme.onBackground
55+
),
56+
),
57+
icon: Icon(
58+
size: 20,
59+
SimpleIcons.x,
60+
color: Theme.of(context).colorScheme.onBackground,
61+
),
62+
style: ElevatedButton.styleFrom(
63+
backgroundColor: Theme.of(context).colorScheme.error.withOpacity(.35)
64+
),
65+
),
66+
),
67+
Flexible(
68+
child: ElevatedButton.icon(
69+
onPressed: onReload,
70+
label: Text("Reload",
71+
style: TextStyle(
72+
color: Theme.of(context).colorScheme.onBackground
73+
),
74+
),
75+
icon: Icon(
76+
size: 20,
77+
Icons.refresh,
78+
color: Theme.of(context).colorScheme.onBackground,
79+
),
80+
style: ElevatedButton.styleFrom(
81+
backgroundColor: Theme.of(context).colorScheme.error.withOpacity(.35)
82+
),
83+
),
84+
)
85+
],
3386
)
3487
]
3588
),

0 commit comments

Comments
 (0)