Skip to content

Instantly share code, notes, and snippets.

View marcinOz's full-sized avatar
💙

Marcin marcinOz

💙
View GitHub Profile
final navigationReducer = combineReducers<List<String>>([
TypedReducer<List<String>, NavigateReplaceAction>(_navigateReplace),
TypedReducer<List<String>, NavigatePushAction>(_navigatePush),
TypedReducer<List<String>, NavigatePopAction>(_navigatePop),
]);
List<String> _navigateReplace(
List<String> route, NavigateReplaceAction action) =>
[action.routeName];
AppState appReducer(AppState state, action) {
return AppState(
isLoading: loadingReducer(state.isLoading, action),
games: gamesReducer(state.games, action),
route: navigationReducer(state.route, action)
);
}
@marcinOz
marcinOz / main.dart
Last active February 11, 2019 18:11
void main() => runApp(MyApp());
final GlobalKey<NavigatorState> navigatorKey = new GlobalKey<NavigatorState>();
class MyApp extends StatelessWidget {
final store = Store<AppState>(appReducer,
initialState: AppState.loading(),
middleware: createNavigationMiddleware());
MaterialPageRoute _getRoute(RouteSettings settings) {
class AppRoutes {
static const home = "/";
static const addGame = "/addGame";
static const history = "/history";
static const money = "/money";
static const profile = "/profile";
}
@immutable
class AppState {
final bool isLoading;
final List<Game> games;
final List<String> route;
...
}
external override fun cropSelectedArea(bitmap: Bitmap, points: FloatArray): Bitmap
companion object {
init {
System.loadLibrary("native-lib")
}
}
extern "C" JNIEXPORT jobject JNICALL
Java_co_netguru_vrhouseframework_NativeRecognizer_cropSelectedArea(
JNIEnv *env,
jobject _this,
jobject bitmap,
jfloatArray points) {...
set(OpenCV_DIR "../opencv/src/sdk/native/jni")
find_package(OpenCV REQUIRED)
message(STATUS "OpenCV libraries: ${OpenCV_LIBS}")
target_link_libraries(native-lib ${OpenCV_LIBS})
add_library( # Sets the name of the library.
native-lib
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
src/main/cpp/native-lib.cpp
../../Shared/SheetDetection.cpp
)