1
0
mirror of https://github.com/h7x4/Jisho-Study-Tool.git synced 2024-12-21 13:37:29 +01:00
This commit is contained in:
Oystein Kristoffer Tveit 2020-07-09 20:06:48 +02:00
parent 0b7dd30505
commit b8130cb6b9
13 changed files with 116 additions and 7 deletions

View File

@ -0,0 +1,18 @@
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:meta/meta.dart';
part 'kanji_event.dart';
part 'kanji_state.dart';
class KanjiBloc extends Bloc<KanjiEvent, KanjiState> {
KanjiBloc() : super(KanjiSearchInitial());
@override
Stream<KanjiState> mapEventToState(
KanjiEvent event,
) async* {
// TODO: implement mapEventToState
}
}

View File

@ -0,0 +1,4 @@
part of 'kanji_bloc.dart';
@immutable
abstract class KanjiEvent {}

View File

@ -0,0 +1,14 @@
part of 'kanji_bloc.dart';
@immutable
abstract class KanjiState {}
class KanjiSearchInitial extends KanjiState {}
class KanjiSearchLoading extends KanjiState {}
class KanjiSearchFinished extends KanjiState {}
class KanjiSearchError extends KanjiState {}
class ReKanjiSearch extends KanjiState {}

View File

@ -0,0 +1,18 @@
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:meta/meta.dart';
part 'search_event.dart';
part 'search_state.dart';
class SearchBloc extends Bloc<SearchEvent, SearchState> {
SearchBloc() : super(SearchInitial());
@override
Stream<SearchState> mapEventToState(
SearchEvent event,
) async* {
// TODO: implement mapEventToState
}
}

View File

@ -0,0 +1,4 @@
part of 'search_bloc.dart';
@immutable
abstract class SearchEvent {}

View File

@ -0,0 +1,14 @@
part of 'search_bloc.dart';
@immutable
abstract class SearchState {}
class SearchInitial extends SearchState {}
class SearchLoading extends SearchState {}
class SearchFinished extends SearchState {}
class SearchError extends SearchState {}
class ReSearch extends SearchState {}

View File

@ -8,7 +8,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
title: 'Jisho Study Tool',
theme: ThemeData(
primarySwatch: Colors.blue,
),

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:unofficial_jisho_api/api.dart' as jisho;
import 'package:jisho_study_tool/components/kanjiSearch/kanji_search_card.dart';
import 'package:jisho_study_tool/components/kanji/kanji_search_card.dart';
Widget searchForKanji(String kanji) {
return FutureBuilder(

View File

@ -8,6 +8,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
bloc:
dependency: transitive
description:
name: bloc
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.1"
boolean_selector:
dependency: transitive
description:
@ -50,13 +57,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
cupertino_icons:
dependency: "direct main"
cubit:
dependency: transitive
description:
name: cupertino_icons
name: cubit
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.2"
fake_async:
dependency: transitive
description:
@ -69,6 +76,20 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_bloc:
dependency: "direct main"
description:
name: flutter_bloc
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.1"
flutter_cubit:
dependency: transitive
description:
name: flutter_cubit
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1"
flutter_test:
dependency: "direct dev"
description: flutter
@ -116,6 +137,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
nested:
dependency: transitive
description:
name: nested
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4"
path:
dependency: transitive
description:
@ -130,6 +158,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0+1"
provider:
dependency: transitive
description:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "4.3.0"
sky_engine:
dependency: transitive
description: flutter
@ -200,3 +235,4 @@ packages:
version: "2.0.8"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.16.0"

View File

@ -22,8 +22,9 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
# cupertino_icons: ^0.1.2
unofficial_jisho_api: ^1.1.0
flutter_bloc: ^5.0.1
dev_dependencies:
flutter_test: