Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed CARD_WIDTH to dymically by screen width. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/ui/card_physics.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import 'package:flutter/cupertino.dart';
double CARD_WIDTH = 10000 / 27;

const double CARD_WIDTH = (240 - 20) * (86.0 / 54) + 20;

class CardPhysics extends ScrollPhysics {
final int cardCount;
const CardPhysics({ this.cardCount, parent }) : super(parent: parent);

const CardPhysics({ this.cardCount, parent}) : super(parent: parent);
@override
CardPhysics applyTo(ScrollPhysics parent) {
return CardPhysics(parent: buildParent(parent));
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class HomeState extends State<HomeAct>
final data = snapshot.data;
this._refreshPhysics(data);
this._updateDetailInst(data);

CARD_WIDTH = MediaQuery.of(context).size.width * 0.9;
return Column(
children: <Widget>[
Padding(
Expand Down