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

childAspectRatio #41

Closed
pishguy opened this issue Mar 23, 2020 · 1 comment
Closed

childAspectRatio #41

pishguy opened this issue Mar 23, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@pishguy
Copy link

pishguy commented Mar 23, 2020

how can i set childAspectRatio in LiveGrid?

@pishguy pishguy added the enhancement New feature or request label Mar 23, 2020
@SergeShkurko
Copy link
Member

SergeShkurko commented Mar 23, 2020

@MahdiPishguy

LiveGrid(
  padding: EdgeInsets.all(16),
  showItemInterval: Duration(milliseconds: 100),
  showItemDuration: Duration(milliseconds: 250),
  gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( // gridDelegate from default grid
    crossAxisCount: 3,
    childAspectRatio: 0.55, // <------------ here
    crossAxisSpacing: 16,
    mainAxisSpacing: 16,
  ),
  itemBuilder: (BuildContext context, int index, animation) =>
      FadeTransition(
    opacity: Tween<double>(
      begin: 0,
      end: 1,
    ).animate(animation),
    child: SlideTransition(
      position: Tween<Offset>(
        begin: Offset(0, -0.025),
        end: Offset.zero,
      ).animate(animation),
      child: _buildIssue(state.issues[index]),
    ),
  ),
  itemCount: state.issues.length,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants