Skip to content

Commit

Permalink
final project wrap up
Browse files Browse the repository at this point in the history
  • Loading branch information
omergamliel3 committed Jan 24, 2021
1 parent ef8a50e commit e5f1a9b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ flutter packages pub run build_runner watch

**Step 4:**

Execute the following command to run the app (you must have an open android emulator)
Execute the following command to run the app (you must have an open android emulator):

```
flutter run -t lib/main/main_dev.dart
Expand Down
2 changes: 1 addition & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app_title": "Prospera",
"app_title": "Movies & Weather",
"initial_state": "initial state",
"success_state": "success state",
"failure_state": "failure state",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class MovieCacheDatasource {
for (final cacheMovie in cacheMovies) {
final movie = MovieModel.fromJson(
json.decode(cacheMovie) as Map<String, dynamic>);

if (movie.title.toLowerCase() == title.toLowerCase()) {
return Right(movie);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ class MovieView extends StatelessWidget {
Widget buildMovieCard(BuildContext context, Movie movie) {
const bold = TextStyle(fontWeight: FontWeight.bold);
return Card(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(12.0))),
margin: const EdgeInsets.symmetric(
vertical: 15.0,
),
elevation: 4.0,
child: Column(
children: [
Expand All @@ -24,7 +29,7 @@ class MovieView extends StatelessWidget {
child: ImageHandlerWidget(urlToImage: movie.poster),
),
Padding(
padding: const EdgeInsets.only(left: 8.0),
padding: const EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down
1 change: 0 additions & 1 deletion lib/app/features/presentation/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export './home_page/view/home_view.dart';
export './loading_page/view/loading_view.dart';
export './main_page/view/main_view.dart';
export './weather_page/view/weather_view.dart';
export './search_page/view/search_view.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:prospera_exercise/app/core/widgets/index.dart';

import 'package:prospera_exercise/di/injector.dart';
import 'package:prospera_exercise/localization/app_localizations.dart';

import '../controller/index.dart';

Expand All @@ -19,15 +20,15 @@ class LoadingView extends StatelessWidget {
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Icon(
children: [
const Icon(
Icons.movie,
size: 50,
),
SizedBox(width: 15.0),
const SizedBox(width: 15.0),
Text(
'Prospera',
style: TextStyle(
AppLocalizations.of(context).translate(APP_TITLE),
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
Expand Down
22 changes: 0 additions & 22 deletions lib/app/features/presentation/main_page/view/main_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,9 @@ class MainView extends StatelessWidget {
Text(AppLocalizations.of(context).translate(APP_TITLE))
],
),
actions: [
BlocBuilder<MainViewController, MainState>(
builder: (context, state) {
if (state.index == 0) {
return buildSearch(context);
}
return Container();
},
),
const SizedBox(
width: 10.0,
),
],
);
}

Widget buildSearch(BuildContext context) {
return IconButton(
icon: const Icon(Icons.search),
onPressed: () => showSearch(
context: context,
delegate: CustomSearchDelegate(),
));
}

@override
Widget build(BuildContext context) {
return SafeArea(
Expand Down

0 comments on commit e5f1a9b

Please sign in to comment.