VelocityXApp icon indicating copy to clipboard operation
VelocityXApp copied to clipboard

I have issue when using VStack with widgets

Open jsonpreet opened this issue 5 years ago • 3 comments

Describe the bug I am using VStack() with Widget, and My Widget is calling from another dart file its bottomNavigationBar(). When i am using it and running my app i got error

════════ Exception caught by scheduler library ═════════════════════════════════ RenderBox was not laid out: RenderParagraph#49ab5 NEEDS-LAYOUT NEEDS-PAINT 'package:flutter/src/rendering/box.dart': Failed assertion: line 1687 pos 12: 'hasSize' Screenshot_1

jsonpreet avatar Apr 08 '20 20:04 jsonpreet

Its VelocityX version: velocity_x: ^0.3.0

jsonpreet avatar Apr 08 '20 20:04 jsonpreet

Can you replace it with the normal column & check it out? I don't think it's anything to do with VStack()

iampawan avatar Apr 09 '20 08:04 iampawan

@harpreet9629 I tried understanding your issue and I am not able to recreate it. Here's what and I understood and tried so far and it's working fine. Let me know if it's wrong.

Here is Build Method for Scaffold.

class MyLandingPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: [
        bottomNav()
      ].vStack()
    );
  }
}

Here is my bottomNav() in a separate file named bottom_nav.dart

import 'package:flutter/material.dart';

Widget bottomNav( ){
  return BottomNavigationBar(
  type: BottomNavigationBarType.fixed,
    items: [
    BottomNavigationBarItem(
      icon: Icon(Icons.home),
      title: Text("Home")
    ),
    BottomNavigationBarItem(
      icon: Icon(Icons.home),
      title: Text("Home")
    ),
    BottomNavigationBarItem(
      icon: Icon(Icons.home),
      title: Text("Home")
    )
  ]);
}


hasnentai avatar Apr 09 '20 21:04 hasnentai