Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes build issues #160

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 27
compileSdkVersion 30

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -45,10 +45,10 @@ android {
defaultConfig {
applicationId "dev.flutter.devRpg"
minSdkVersion 16
targetSdkVersion 27
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
Expand Down Expand Up @@ -81,6 +81,6 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}
14 changes: 7 additions & 7 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
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="Developer Quest"
android:icon="@mipmap/ic_launcher">
<activity
Expand All @@ -23,17 +22,18 @@
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
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.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
package dev.flutter.devrpg

import android.os.Bundle

import io.flutter.app.FlutterActivity
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
}
}
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.2.71'
ext.kotlin_version = '1.3.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
3 changes: 3 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
13 changes: 13 additions & 0 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/misir/Workspace/tools/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/misir/Workspace/repos/github.com/2d-inc/developer_quest"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
16 changes: 8 additions & 8 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class _MyAppState extends State<MyApp> {
Widget build(BuildContext context) {
return MultiProvider(
providers: [
ChangeNotifierProvider(builder: (_) => User()),
ChangeNotifierProvider.value(notifier: world),
ChangeNotifierProvider.value(notifier: world.characterPool),
ChangeNotifierProvider.value(notifier: world.taskPool),
ChangeNotifierProvider.value(notifier: world.company),
ChangeNotifierProvider.value(notifier: world.company.users),
ChangeNotifierProvider.value(notifier: world.company.joy),
ChangeNotifierProvider.value(notifier: world.company.coin),
ChangeNotifierProvider(create: (_) => User()),
ChangeNotifierProvider.value(value: world),
ChangeNotifierProvider.value(value: world.characterPool),
ChangeNotifierProvider.value(value: world.taskPool),
ChangeNotifierProvider.value(value: world.company),
ChangeNotifierProvider.value(value: world.company.users),
ChangeNotifierProvider.value(value: world.company.joy),
ChangeNotifierProvider.value(value: world.company.coin),
],
child: MaterialApp(
title: 'Flutter Demo',
Expand Down
10 changes: 5 additions & 5 deletions lib/src/game_screen/character_pool_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class CharacterPoolPage extends StatelessWidget {
gridDelegate: _gridStructure,
itemBuilder: (context, index) =>
ChangeNotifierProvider<Character>.value(
notifier: characterPool.children[index],
key: ValueKey(characterPool.children[index]),
child: CharacterListItem(),
),
value: characterPool.children[index],
key: ValueKey(characterPool.children[index]),
child: CharacterListItem(),
),
),
_fadeOverlay,
],
Expand Down Expand Up @@ -132,7 +132,7 @@ class CharacterDisplay extends StatelessWidget {
context: context,
builder: (BuildContext context) {
return ChangeNotifierProvider<Character>.value(
notifier: character,
value: character,
child: CharacterModal(),
);
});
Expand Down
2 changes: 1 addition & 1 deletion lib/src/game_screen/task_pool_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TaskPoolPage extends StatelessWidget {
delegate: SliverChildBuilderDelegate((context, index) {
WorkItem item = workItems[index];
return ChangeNotifierProvider<WorkItem>.value(
notifier: item,
value: item,
key: ValueKey(item),
child: item is Bug ? BugListItem() : TaskListItem(),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/app_bar/stat_badge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class StatBadgeState<T extends num> extends State<StatBadge<T>> {
/// Since [widget.statValue] is [ValueListenable], we can subscribe to
/// its changes in [didUpdateWidget].
void valueChanged() {
T change = widget.statValue.number - _lastStatValue;
T change = widget.statValue.number - _lastStatValue as T;
if (widget.celebrateAfter == 0 || change > widget.celebrateAfter) {
controls.play('points');
_lastStatValue = widget.statValue.number;
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ dependencies:
flutter:
sdk: flutter
intl: any
provider: ^2.0.0

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
provider: ^4.0.0
cupertino_icons: ^1.0.3
flare_flutter: ^1.8.3
auto_size_text: ^1.1.2

Expand Down
10 changes: 5 additions & 5 deletions test/world_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ void main() {

await tester.pumpWidget(
ChangeNotifierProvider(
builder: (_) => World(),
create: (_) => World(),
child: MaterialApp(
home: Consumer<World>(
builder: (context, world, child) => FlatButton(
key: buttonKey,
onPressed: () => world.start(),
child: Text(world.isRunning ? 'Stop' : 'Start'),
),
key: buttonKey,
onPressed: () => world.start(),
child: Text(world.isRunning ? 'Stop' : 'Start'),
),
),
),
),
Expand Down