Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Commit

Permalink
fix: movie top don't show
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayandev committed Apr 20, 2019
1 parent 04292c4 commit 017c075
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lib/home/movie_top_banner_view.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

import 'package:carousel_slider/carousel_slider.dart';
import 'package:palette_generator/palette_generator.dart';

import 'package:movie_recommend/public.dart';
import 'movie_top_item_view.dart';
Expand Down Expand Up @@ -59,6 +60,6 @@ class MovieTopBanner {
String title;
String subTitle;
String action;
Color coverColor;
PaletteColor coverColor;
MovieTopBanner(this.movies, this.title, this.subTitle, this.action, this.coverColor);
}
5 changes: 3 additions & 2 deletions lib/home/movie_top_item_view.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:palette_generator/palette_generator.dart';

import 'package:movie_recommend/model/movie_item.dart';
import 'package:movie_recommend/public.dart';
Expand All @@ -8,7 +9,7 @@ class MovieTopItemView extends StatelessWidget {
final List<MovieItem> movies;
final String title;
final String subTitle;
final Color coverColor;
final PaletteColor coverColor;

MovieTopItemView(this.movies, this.title, this.subTitle, this.coverColor);

Expand Down Expand Up @@ -71,7 +72,7 @@ class MovieTopItemView extends StatelessWidget {
child: new Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: this.coverColor == null ? Color(0xff3E454D) : this.coverColor,
color: this.coverColor == null ? Color(0xff3E454D) : this.coverColor.color,
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(5), bottomRight: Radius.circular(5))
),
child: ListView.builder(
Expand Down
8 changes: 4 additions & 4 deletions lib/home/movie_top_scroll_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ class _MovieTopScrollViewState extends State<MovieTopScrollView> with AutomaticK
usBoxList = usBoxData;
newMovieList = newMovieData;
banners = [
new MovieTopBanner(weeklyList, '一周口碑电影榜', '每周五更新·共10部', 'weekly',paletteGenerator1.darkVibrantColor.color),
new MovieTopBanner(top250List, '豆瓣电影Top250', '豆瓣榜单·共250部', 'top250',paletteGenerator2.darkVibrantColor.color),
new MovieTopBanner(newMovieList, '一周新电影榜', '每周五更新·共10部', 'new_movies',paletteGenerator3.darkVibrantColor.color),
new MovieTopBanner(usBoxList, '北美电影票房榜', '每周五更新·共10部', 'us_box',paletteGenerator4.darkVibrantColor.color)
new MovieTopBanner(weeklyList, '一周口碑电影榜', '每周五更新·共10部', 'weekly',paletteGenerator1.darkVibrantColor),
new MovieTopBanner(top250List, '豆瓣电影Top250', '豆瓣榜单·共250部', 'top250',paletteGenerator2.darkVibrantColor),
new MovieTopBanner(newMovieList, '一周新电影榜', '每周五更新·共10部', 'new_movies',paletteGenerator3.darkVibrantColor),
new MovieTopBanner(usBoxList, '北美电影票房榜', '每周五更新·共10部', 'us_box',paletteGenerator4.darkVibrantColor)
];
});
}
Expand Down

0 comments on commit 017c075

Please sign in to comment.