Skip to content

Commit

Permalink
reboot to flutter-1.22.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tastelessjolt committed Dec 3, 2020
1 parent 56d84ac commit a9d40de
Show file tree
Hide file tree
Showing 39 changed files with 245 additions and 240 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,5 @@ unlinked_spec.ds
# Local files
login_response.json

.flutter-plugins-dependencies
ios/Flutter/flutter_export_environment.sh
21 changes: 11 additions & 10 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
// signingConfigs {
// release {
// keyAlias keystoreProperties['keyAlias']
// keyPassword keystoreProperties['keyPassword']
// storeFile file(keystoreProperties['storeFile'])
// storePassword keystoreProperties['storePassword']
// }
// }

buildTypes {
release {
signingConfig signingConfigs.release
signingConfig signingConfigs.debug
// signingConfig signingConfigs.release
}
}
}
Expand All @@ -70,7 +71,7 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
}

apply plugin: 'com.google.gms.google-services'
Expand Down
19 changes: 16 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="InstiApp"
android:icon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_launcher_round">

<meta-data
android:name="flutterEmbedding"
android:value="2" />

<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyAryoUjEhGTWvgrInX1rDAR3D3DEXD5Z7M"/>
Expand All @@ -36,9 +39,19 @@
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->

<!-- Specify that the launch screen should continue being displayed -->
<!-- until Flutter renders its first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />

<!-- Theme to apply as soon as Flutter begins rendering frames -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>

<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
package app.insti.flutter;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>

<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@android:color/black</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.google.gms:google-services:4.0.1'
classpath 'com.google.gms:google-services:4.3.0'
classpath 'com.android.tools.build:gradle:3.3.1'
}
}
Expand Down
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
1 change: 1 addition & 0 deletions android/settings_aar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':app'
13 changes: 7 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import 'package:uni_links/uni_links.dart';
void main() async {
GlobalKey<MyAppState> key = GlobalKey();
InstiAppBloc bloc = InstiAppBloc(wholeAppKey: key);
WidgetsFlutterBinding.ensureInitialized();
var temp = bloc.restorePrefs();

await temp;
Expand Down Expand Up @@ -91,7 +92,7 @@ class MyAppState extends State<MyApp> with WidgetsBindingObserver {
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.paused ||
state == AppLifecycleState.suspending) {
state == AppLifecycleState.detached) {
widget?.bloc?.saveToCache();
}
}
Expand Down Expand Up @@ -134,27 +135,27 @@ class MyAppState extends State<MyApp> with WidgetsBindingObserver {
brightness: widget.bloc.brightness.toBrightness(),

textTheme: TextTheme(
display1: TextStyle(
headline4: TextStyle(
color: widget.bloc.brightness == AppBrightness.light
? Colors.black
: Colors.white,
),
display2: TextStyle(
headline3: TextStyle(
color: widget.bloc.brightness == AppBrightness.light
? Colors.black
: Colors.white,
),
display3: TextStyle(
headline2: TextStyle(
color: widget.bloc.brightness == AppBrightness.light
? Colors.black
: Colors.white,
),
display4: TextStyle(
headline1: TextStyle(
color: widget.bloc.brightness == AppBrightness.light
? Colors.black
: Colors.white,
),
headline: TextStyle()),
headline5: TextStyle()),
),
onGenerateRoute: (RouteSettings settings) {
if (settings.name.startsWith("/event/")) {
Expand Down
4 changes: 3 additions & 1 deletion lib/src/api/apiclient.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ class InstiAppApi extends ApiClient with _$InstiAppApiClient {
Future<void> updateUserEventStatus(@Header("Cookie") String sessionID,
@PathParam() String eventID, @QueryParam("status") int status);

@GetReq(path: "/user-me/unr/:postID")
@GetReq(
path: "/user-me/unr/:postID",
)
Future<void> updateUserNewsReaction(@Header("Cookie") String sessionID,
@PathParam() String postID, @QueryParam("reaction") int reaction);

Expand Down
2 changes: 1 addition & 1 deletion lib/src/api/model/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Event {
int eventUserUesInt;

@Ignore()
UES get eventUserUes => UES.values[eventUserUesInt];
UES get eventUserUes => UES.values[eventUserUesInt ?? 0];

@Ignore()
set eventUserUes(UES ues) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/blocs/blog_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ enum PostType { Placement, Training, NewsArticle }

class PostBloc {
// Streams
Stream<UnmodifiableListView<Post>> get blog => _blogSubject.stream;
ValueStream<UnmodifiableListView<Post>> get blog => _blogSubject.stream;
final _blogSubject = BehaviorSubject<UnmodifiableListView<Post>>();

Sink<int> get inPostIndex => _indexController.sink;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/blocs/calendar_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class CalendarBloc {
InstiAppBloc bloc;

// Streams
Stream<Map<DateTime, List<Event>>> get events => _eventsSubject.stream;
ValueStream<Map<DateTime, List<Event>>> get events => _eventsSubject.stream;
final _eventsSubject = BehaviorSubject<Map<DateTime, List<Event>>>();

Stream<bool> get loading => _loadingSubject.stream;
ValueStream<bool> get loading => _loadingSubject.stream;
final _loadingSubject = BehaviorSubject<bool>();

// State
Expand Down
6 changes: 3 additions & 3 deletions lib/src/blocs/complaints_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'dart:async';
// import 'dart:async';
import 'dart:collection';
import 'dart:math';

Expand All @@ -21,11 +21,11 @@ class ComplaintsBloc {
InstiAppBloc bloc;

// Streams
Stream<UnmodifiableListView<Complaint>> get allComplaints =>
ValueStream<UnmodifiableListView<Complaint>> get allComplaints =>
_complaintsSubject.stream;
final _complaintsSubject = BehaviorSubject<UnmodifiableListView<Complaint>>();

Stream<UnmodifiableListView<Complaint>> get myComplaints =>
ValueStream<UnmodifiableListView<Complaint>> get myComplaints =>
_mycomplaintsSubject.stream;
final _mycomplaintsSubject =
BehaviorSubject<UnmodifiableListView<Complaint>>();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/blocs/drawer_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:async';
import 'package:rxdart/rxdart.dart';

class DrawerBloc {
Stream<int> get highlightPageIndex => _pageIndexSubject.stream;
ValueStream<int> get highlightPageIndex => _pageIndexSubject.stream;
final _pageIndexSubject = BehaviorSubject<int>();

String currentRoute;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/blocs/explore_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ExploreBloc {
InstiAppBloc bloc;

// Streams
Stream<ExploreResponse> get explore => _exploreSubject.stream;
ValueStream<ExploreResponse> get explore => _exploreSubject.stream;
final _exploreSubject = BehaviorSubject<ExploreResponse>();

// Params
Expand Down
9 changes: 5 additions & 4 deletions lib/src/blocs/ia_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,17 @@ class InstiAppBloc {
final FirebaseMessaging firebaseMessaging = FirebaseMessaging();

// Different Streams for the state
Stream<UnmodifiableListView<Hostel>> get hostels => _hostelsSubject.stream;
ValueStream<UnmodifiableListView<Hostel>> get hostels =>
_hostelsSubject.stream;
final _hostelsSubject = BehaviorSubject<UnmodifiableListView<Hostel>>();

Stream<Session> get session => _sessionSubject.stream;
ValueStream<Session> get session => _sessionSubject.stream;
final _sessionSubject = BehaviorSubject<Session>();

Stream<UnmodifiableListView<Event>> get events => _eventsSubject.stream;
ValueStream<UnmodifiableListView<Event>> get events => _eventsSubject.stream;
final _eventsSubject = BehaviorSubject<UnmodifiableListView<Event>>();

Stream<UnmodifiableListView<ntf.Notification>> get notifications =>
ValueStream<UnmodifiableListView<ntf.Notification>> get notifications =>
_notificationsSubject.stream;
final _notificationsSubject =
BehaviorSubject<UnmodifiableListView<ntf.Notification>>();
Expand Down
3 changes: 2 additions & 1 deletion lib/src/blocs/map_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class MapBloc {
InstiAppBloc bloc;

// Streams
Stream<UnmodifiableListView<Venue>> get locations => _locationsSubject.stream;
ValueStream<UnmodifiableListView<Venue>> get locations =>
_locationsSubject.stream;
final _locationsSubject = BehaviorSubject<UnmodifiableListView<Venue>>();

// State
Expand Down
Loading

0 comments on commit a9d40de

Please sign in to comment.