-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(example): fix android side of flutter example and refactor exampl…
…es (#766) * fix(example): fix android side of flutter example * java 17 * update * update gradle * update gradle * equatable * update * restructure * restructure
- Loading branch information
Showing
29 changed files
with
271 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
java-version: '17' | ||
|
||
- uses: subosito/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
examples/flutter/github_search/android/app/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
include ':app' | ||
pluginManagement { | ||
def flutterSdkPath = { | ||
def properties = new Properties() | ||
file("local.properties").withInputStream { properties.load(it) } | ||
def flutterSdkPath = properties.getProperty("flutter.sdk") | ||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties" | ||
return flutterSdkPath | ||
}() | ||
|
||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties") | ||
def properties = new Properties() | ||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") | ||
|
||
assert localPropertiesFile.exists() | ||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } | ||
repositories { | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
def flutterSdkPath = properties.getProperty("flutter.sdk") | ||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties" | ||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" | ||
plugins { | ||
id "dev.flutter.flutter-plugin-loader" version "1.0.0" | ||
id "com.android.application" version "8.5.2" apply false | ||
id "org.jetbrains.kotlin.android" version "2.0.20" apply false | ||
id("org.gradle.toolchains.foojay-resolver-convention") version("0.8.0") | ||
} | ||
|
||
rootProject.name = "github_search" | ||
include ":app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
|
||
import '../api/github_api.dart'; | ||
|
||
// The State represents the data the View requires. The View consumes a Stream | ||
// of States. The view rebuilds every time the Stream emits a new State! | ||
// | ||
// The State Stream will emit new States depending on the situation: The | ||
// initial state, loading states, the list of results, and any errors that | ||
// happen. | ||
// | ||
// The State Stream responds to input from the View by accepting a | ||
// Stream<String>. We call this Stream the onTextChanged "intent". | ||
@immutable | ||
sealed class SearchState extends Equatable { | ||
const SearchState(); | ||
} | ||
|
||
class SearchLoading extends SearchState { | ||
const SearchLoading(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class SearchError extends SearchState { | ||
const SearchError() : super(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class SearchNoTerm extends SearchState { | ||
const SearchNoTerm(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class SearchPopulated extends SearchState { | ||
final SearchResult result; | ||
|
||
const SearchPopulated(this.result); | ||
|
||
@override | ||
List<Object?> get props => [result]; | ||
} | ||
|
||
class SearchEmpty extends SearchState { | ||
const SearchEmpty(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.