-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7408b3b
commit 64e743e
Showing
26 changed files
with
855 additions
and
138 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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# animku | ||
|
||
A new Flutter application. | ||
Animku is unofficial myanimelist.com app that will be available on ios and android. | ||
|
||
## Getting Started | ||
if you want to contribute on this project, you can fork this project and pull request. | ||
|
||
This project is a starting point for a Flutter application. | ||
#TODO | ||
|
||
A few resources to get you started if this is your first Flutter project: | ||
|
||
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) | ||
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) | ||
|
||
For help getting started with Flutter, view our | ||
[online documentation](https://flutter.dev/docs), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. | ||
- [x] current season screen | ||
- [x] drawer and items | ||
- [x] anime detail | ||
- [x] schedule | ||
- [] search anime | ||
- [] top anime | ||
- [] splash screen | ||
- [] icon launcher |
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,28 @@ | ||
import 'package:animku/bloc/schedule_bloc/shedule_event_state.dart'; | ||
import 'package:animku/models/current_season_model.dart'; | ||
import 'package:animku/repository/schedule_repo.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class FridayBloc extends Bloc<ScheduleEvent,ScheduleState>{ | ||
ScheduleRepository scheduleRepository; | ||
|
||
FridayBloc(this.scheduleRepository); | ||
|
||
@override | ||
// TODO: implement initialState | ||
ScheduleState get initialState => ScheduleInitialState(); | ||
|
||
@override | ||
Stream<ScheduleState> mapEventToState(ScheduleEvent event) async*{ | ||
if(event is FetchSchedule){ | ||
yield ScheduleInitialState(); | ||
try{ | ||
List<AnimeList> list = await scheduleRepository.getFriday(); | ||
yield ScheduleLoadedState(animeList: list); | ||
}catch(e){ | ||
yield ScheduleErrorState(message: e.toString()); | ||
} | ||
} | ||
} | ||
|
||
} |
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,28 @@ | ||
import 'package:animku/bloc/schedule_bloc/shedule_event_state.dart'; | ||
import 'package:animku/models/current_season_model.dart'; | ||
import 'package:animku/models/days_model.dart'; | ||
import 'package:animku/repository/schedule_repo.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class MondayBloc extends Bloc<ScheduleEvent,ScheduleState>{ | ||
ScheduleRepository scheduleRepository; | ||
|
||
MondayBloc(this.scheduleRepository); | ||
|
||
@override | ||
// TODO: implement initialState | ||
ScheduleState get initialState => ScheduleInitialState(); | ||
|
||
@override | ||
Stream<ScheduleState> mapEventToState(ScheduleEvent event) async* { | ||
if(event is FetchSchedule){ | ||
yield ScheduleInitialState(); | ||
try{ | ||
List<AnimeList> list = await scheduleRepository.getMonday(); | ||
yield ScheduleLoadedState(animeList: list); | ||
}catch(e){ | ||
yield ScheduleErrorState(message: e.toString()); | ||
} | ||
} | ||
} | ||
} |
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,28 @@ | ||
import 'package:animku/bloc/schedule_bloc/shedule_event_state.dart'; | ||
import 'package:animku/models/current_season_model.dart'; | ||
import 'package:animku/repository/schedule_repo.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class SaturdayBloc extends Bloc<ScheduleEvent,ScheduleState>{ | ||
ScheduleRepository scheduleRepository; | ||
|
||
SaturdayBloc(this.scheduleRepository); | ||
|
||
@override | ||
// TODO: implement initialState | ||
ScheduleState get initialState => ScheduleInitialState(); | ||
|
||
@override | ||
Stream<ScheduleState> mapEventToState(ScheduleEvent event) async*{ | ||
if(event is FetchSchedule){ | ||
yield ScheduleInitialState(); | ||
try{ | ||
List<AnimeList> list = await scheduleRepository.getSaturday(); | ||
yield ScheduleLoadedState(animeList: list); | ||
}catch(e){ | ||
yield ScheduleErrorState(message: e.toString()); | ||
} | ||
} | ||
} | ||
|
||
} |
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,38 @@ | ||
import 'package:animku/models/current_season_model.dart'; | ||
import 'package:equatable/equatable.dart'; | ||
|
||
//fetch event | ||
abstract class ScheduleEvent extends Equatable{} | ||
|
||
class FetchSchedule extends ScheduleEvent{ | ||
@override | ||
// TODO: implement props | ||
List<Object> get props => []; | ||
} | ||
|
||
//state | ||
abstract class ScheduleState extends Equatable{} | ||
|
||
class ScheduleInitialState extends ScheduleState{ | ||
@override | ||
// TODO: implement props | ||
List<Object> get props => []; | ||
} | ||
class ScheduleLoadedState extends ScheduleState{ | ||
List<AnimeList> animeList; | ||
|
||
ScheduleLoadedState({this.animeList}); | ||
|
||
@override | ||
// TODO: implement props | ||
List<Object> get props => [animeList]; | ||
} | ||
class ScheduleErrorState extends ScheduleState{ | ||
String message; | ||
|
||
ScheduleErrorState({this.message}); | ||
|
||
@override | ||
// TODO: implement props | ||
List<Object> get props => [message]; | ||
} |
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,28 @@ | ||
import 'package:animku/bloc/schedule_bloc/shedule_event_state.dart'; | ||
import 'package:animku/models/current_season_model.dart'; | ||
import 'package:animku/models/days_model.dart'; | ||
import 'package:animku/repository/schedule_repo.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class SundayBloc extends Bloc<ScheduleEvent,ScheduleState>{ | ||
ScheduleRepository scheduleRepository; | ||
|
||
SundayBloc(this.scheduleRepository); | ||
|
||
@override | ||
// TODO: implement initialState | ||
ScheduleState get initialState => ScheduleInitialState(); | ||
|
||
@override | ||
Stream<ScheduleState> mapEventToState(ScheduleEvent event) async*{ | ||
if(event is FetchSchedule){ | ||
yield ScheduleInitialState(); | ||
try{ | ||
List<AnimeList> data = await scheduleRepository.getSunday(); | ||
yield ScheduleLoadedState(animeList: data); | ||
}catch(e){ | ||
yield ScheduleErrorState(message: e.toString()); | ||
} | ||
} | ||
} | ||
} |
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,27 @@ | ||
import 'package:animku/bloc/schedule_bloc/shedule_event_state.dart'; | ||
import 'package:animku/models/current_season_model.dart'; | ||
import 'package:animku/repository/schedule_repo.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class ThursdayBloc extends Bloc<ScheduleEvent,ScheduleState>{ | ||
ScheduleRepository scheduleRepository; | ||
|
||
ThursdayBloc(this.scheduleRepository); | ||
|
||
@override | ||
// TODO: implement initialState | ||
ScheduleState get initialState => ScheduleInitialState(); | ||
|
||
@override | ||
Stream<ScheduleState> mapEventToState(ScheduleEvent event) async*{ | ||
if(event is FetchSchedule){ | ||
yield ScheduleInitialState(); | ||
try{ | ||
List<AnimeList> list = await scheduleRepository.getThursday(); | ||
yield ScheduleLoadedState(animeList: list); | ||
}catch(e){ | ||
yield ScheduleErrorState(message: e.toString()); | ||
} | ||
} | ||
} | ||
} |
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,28 @@ | ||
import 'package:animku/bloc/schedule_bloc/shedule_event_state.dart'; | ||
import 'package:animku/models/current_season_model.dart'; | ||
import 'package:animku/repository/schedule_repo.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class TuesDayBloc extends Bloc<ScheduleEvent,ScheduleState>{ | ||
ScheduleRepository scheduleRepository; | ||
|
||
TuesDayBloc(this.scheduleRepository); | ||
|
||
@override | ||
// TODO: implement initialState | ||
ScheduleState get initialState => ScheduleInitialState(); | ||
|
||
@override | ||
Stream<ScheduleState> mapEventToState(ScheduleEvent event) async*{ | ||
if(event is FetchSchedule){ | ||
yield ScheduleInitialState(); | ||
try{ | ||
List<AnimeList>list = await scheduleRepository.getTuesday(); | ||
yield ScheduleLoadedState(animeList: list); | ||
}catch(e){ | ||
yield ScheduleErrorState(message: e.toString()); | ||
} | ||
} | ||
} | ||
|
||
} |
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,28 @@ | ||
import 'package:animku/bloc/schedule_bloc/shedule_event_state.dart'; | ||
import 'package:animku/models/current_season_model.dart'; | ||
import 'package:animku/repository/schedule_repo.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class WednesdayBloc extends Bloc<ScheduleEvent,ScheduleState>{ | ||
ScheduleRepository scheduleRepository; | ||
|
||
WednesdayBloc(this.scheduleRepository); | ||
|
||
@override | ||
// TODO: implement initialState | ||
ScheduleState get initialState => ScheduleInitialState(); | ||
|
||
@override | ||
Stream<ScheduleState> mapEventToState(ScheduleEvent event) async*{ | ||
if(event is FetchSchedule){ | ||
yield ScheduleInitialState(); | ||
try{ | ||
List<AnimeList> list = await scheduleRepository.getWednesday(); | ||
yield ScheduleLoadedState(animeList: list); | ||
}catch(e){ | ||
yield ScheduleErrorState(message: e.toString()); | ||
} | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.