Another exception was thrown: Incorrect use of ParentDataWidget.

180 views
Skip to first unread message

HIMANSHU MISHRA

unread,
May 11, 2021, 4:17:26 AM5/11/21
to Flutter Development (flutter-dev)
Hello All,

I am getting warning of

"Another exception was thrown: Incorrect use of ParentDataWidget."

Here is my code . Please help me out to resolve this issue.


import 'package:conqer_music/App/navigationDrawer/navigationDrawer.dart';
import 'package:conqer_music/App/widgets/AppBarWidget.dart';
import 'package:flutter/material.dart';

// ignore: import_of_legacy_library_into_null_safe
import 'package:flutter_neumorphic/flutter_neumorphic.dart';

// ignore: unused_import
import 'package:conqer_music/App/widgets/SearchWidget.dart';
// ignore: import_of_legacy_library_into_null_safe

class HomePage extends StatelessWidget {
  static const String routeName = '/homePage';

  @override
  // ignore: unused_element
  Widget build(BuildContext context) {
    // ignore: todo
    // TODO: implement build
    showAlertDialog(BuildContext context) {
      // Create button
      // ignore: deprecated_member_use
      Widget okButton = FlatButton(
        child: Text("OK"),
        onPressed: () {
          Navigator.of(context).pop();
        },
      );

      // Create AlertDialog
      AlertDialog alert = AlertDialog(
        title: Text("Simple Alert"),
        content: Text("This Search Icon."),
        actions: [
          okButton,
        ],
      );

      // show the dialog
      showDialog(
        context: context,
        builder: (BuildContext context) {
          return alert;
        },
      );
    }

    return Scaffold(
      appBar: AppBar(
        iconTheme: IconThemeData(color: Colors.white),
        leading: AppBarWidget(),
        leadingWidth: 100,
        backgroundColor: Color(0xFFbaa15e),
        title: Text(
          "Home",
          style: TextStyle(color: Colors.white),
        ),
        centerTitle: true,
        // actions: <Widget>[
        //   AppBarWidget(),
        // ],
      ),
      endDrawer: navigationDrawer(),
      backgroundColor: NeumorphicTheme.baseColor(context),
      body: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            Container(
              padding: const EdgeInsets.all(8.0),
              height: MediaQuery.of(context).size.height * 0.25,
              decoration: BoxDecoration(color: Colors.black),
              child: Column(
                children: <Widget>[
                  Container(
                    height: MediaQuery.of(context).size.height * 0.03,
                    alignment: Alignment.centerLeft,
                    child: Text(
                      'Conqer Top Picks',
                      style: TextStyle(
                        fontSize: 14,
                        color: Colors.white,
                      ),
                    ),
                  ),
                  SizedBox(
                    height: MediaQuery.of(context).size.height * 0.01,
                  ),
                  Container(
                    height: MediaQuery.of(context).size.height * 0.18,
                    child: SizedBox(
                      width: MediaQuery.of(context).size.width,
                      child: ClipRRect(
                        borderRadius: BorderRadius.circular(5),
                        child: Image.network(
                          'https:\/\/www.conqermusic.com\/images\/conquer\/26\/Back2TheFuture2009\/Unknown.jpg',
                          fit: BoxFit.cover,
                        ),
                      ),
                    ),
                  ),
                ],
              ),
            ),
            Container(
              padding: const EdgeInsets.all(8.0),
              height: MediaQuery.of(context).size.height * 0.30,
              decoration: BoxDecoration(color: Colors.black),
              child: Expanded(
                child: Column(
                  children: <Widget>[
                    Container(
                      height: MediaQuery.of(context).size.height * 0.03,
                      alignment: Alignment.centerLeft,
                      child: Row(
                        children: [
                          Expanded(
                            flex: 7,
                            child: Text(
                              'Made For You',
                              style: TextStyle(
                                fontSize: 14,
                                color: Colors.white,
                              ),
                            ),
                          ),
                          Expanded(
                            child: Text(
                              'More',
                              style: TextStyle(
                                fontSize: 14,
                                color: Color(0xFFbaa15e),
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                    SizedBox(
                      height: MediaQuery.of(context).size.height * 0.01,
                    ),
                    Container(
                      height: MediaQuery.of(context).size.height * 0.23,
                      child: Row(
                        children: <Widget>[
                          Padding(
                            padding: const EdgeInsets.fromLTRB(0030),
                            child: Expanded(
                              flex: 1,
                              child: Container(
                                height:
                                    MediaQuery.of(context).size.height * 0.22,
                                width: MediaQuery.of(context).size.width * 0.30,
                                child: Column(
                                  children: [
                                    ClipRRect(
                                      borderRadius: BorderRadius.circular(5),
                                      child: Image.network(
                                        'https:\/\/www.conqermusic.com\/images\/conquer\/75\/2018RecklessLove\/Unknown.jpg',
                                        fit: BoxFit.fill,
                                      ),
                                    ),
                                    Text(
                                      'Higher Learning..',
                                      style: TextStyle(color: Colors.white),
                                    ),
                                  ],
                                ),
                              ),
                            ),
                          ),
                          Padding(
                            padding: const EdgeInsets.fromLTRB(3030),
                            child: Expanded(
                              flex: 1,
                              child: Container(
                                height:
                                    MediaQuery.of(context).size.height * 0.22,
                                width: MediaQuery.of(context).size.width * 0.30,
                                child: Column(
                                  children: [
                                    ClipRRect(
                                      borderRadius: BorderRadius.circular(5),
                                      child: Image.network(
                                        'https:\/\/www.conqermusic.com\/images\/conquer\/26\/Back2TheFuture2009\/Unknown.jpg',
                                        fit: BoxFit.fill,
                                      ),
                                    ),
                                    Text(
                                      'The Story...',
                                      style: TextStyle(color: Colors.white),
                                    ),
                                  ],
                                ),
                              ),
                            ),
                          ),
                          Padding(
                            padding: const EdgeInsets.fromLTRB(3000),
                            child: Expanded(
                              flex: 1,
                              child: Container(
                                height:
                                    MediaQuery.of(context).size.height * 0.22,
                                width: MediaQuery.of(context).size.width * 0.30,
                                child: Column(
                                  children: [
                                    ClipRRect(
                                      borderRadius: BorderRadius.circular(5),
                                      child: Image.network(
                                        'https:\/\/www.conqermusic.com\/images\/conquer\/75\/2018RecklessLove\/Unknown.jpg',
                                        fit: BoxFit.fill,
                                      ),
                                    ),
                                    Text(
                                      'Camp the....',
                                      style: TextStyle(color: Colors.white),
                                    ),
                                  ],
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ),
            Container(
              padding: const EdgeInsets.all(8.0),
              height: MediaQuery.of(context).size.height * 0.23,
              decoration: BoxDecoration(color: Colors.black),
              child: Column(
                children: <Widget>[
                  Stack(
                    children: <Widget>[
                      Container(
                        height: MediaQuery.of(context).size.height * 0.18,
                        child: SizedBox(
                          width: MediaQuery.of(context).size.width,
                          child: ClipRRect(
                            borderRadius: BorderRadius.circular(5),
                            child: Image.asset(
                              'lib/App/Assets/Images/BackGround.png',
                              fit: BoxFit.cover,
                            ),
                          ),
                        ),
                      ),
                      Container(
                        height: MediaQuery.of(context).size.height * 0.18,
                        alignment: Alignment.centerLeft,
                        margin: EdgeInsets.all(5),
                        child: Column(
                          children: [
                            Text(
                              'Top',
                              style: TextStyle(
                                fontSize: 16,
                                fontWeight: FontWeight.bold,
                                color: Colors.white,
                              ),
                            ),
                            Text(
                              'Spritual God',
                              style: TextStyle(
                                fontSize: 16,
                                fontWeight: FontWeight.bold,
                                color: Colors.white,
                              ),
                            ),
                            Text(
                              'Songs',
                              style: TextStyle(
                                fontSize: 16,
                                fontWeight: FontWeight.bold,
                                color: Colors.white,
                              ),
                            ),
                            TextButton(
                              child: Text(
                                'Play this Podcast',
                                style: TextStyle(
                                  fontSize: 10,
                                ),
                              ),
                              style: TextButton.styleFrom(
                                primary: Colors.white,
                                backgroundColor: Color(0xFF1F71EA),
                                shape: const RoundedRectangleBorder(
                                    borderRadius:
                                        BorderRadius.all(Radius.circular(30))),
                              ),
                              onPressed: () {},
                            ),
                          ],
                        ),
                      ),
                    ],
                  ),
                ],
              ),
            ),
            Container(
              padding: const EdgeInsets.all(8.0),
              height: MediaQuery.of(context).size.height * 0.22,
              decoration: BoxDecoration(color: Colors.black),
              child: Column(
                children: <Widget>[
                  Container(
                    height: MediaQuery.of(context).size.height * 0.03,
                    alignment: Alignment.centerLeft,
                    child: Row(
                      children: [
                        Expanded(
                          flex: 7,
                          child: Text(
                            'Recently Played',
                            style: TextStyle(
                              fontSize: 14,
                              color: Colors.white,
                            ),
                          ),
                        ),
                        Expanded(
                          child: Text(
                            'More',
                            style: TextStyle(
                              fontSize: 14,
                              color: Color(0xFFbaa15e),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ),
                  SizedBox(
                    height: MediaQuery.of(context).size.height * 0.01,
                  ),
                  Container(
                    height: MediaQuery.of(context).size.height * 0.15,
                    child: Row(
                      children: <Widget>[
                        Padding(
                          padding: const EdgeInsets.fromLTRB(0030),
                          child: Expanded(
                            flex: 1,
                            child: Container(
                              height: MediaQuery.of(context).size.height * 0.15,
                              width: MediaQuery.of(context).size.width * 0.30,
                              child: ClipRRect(
                                borderRadius: BorderRadius.circular(5),
                                child: Image.network(
                                  'https:\/\/www.conqermusic.com\/images\/conquer\/75\/2018RecklessLove\/Unknown.jpg',
                                  fit: BoxFit.fill,
                                ),
                              ),
                            ),
                          ),
                        ),
                        Padding(
                          padding: const EdgeInsets.fromLTRB(3030),
                          child: Expanded(
                            flex: 1,
                            child: Container(
                              height: MediaQuery.of(context).size.height * 0.19,
                              width: MediaQuery.of(context).size.width * 0.30,
                              child: ClipRRect(
                                borderRadius: BorderRadius.circular(5),
                                child: Image.network(
                                  'https:\/\/www.conqermusic.com\/images\/conquer\/26\/Back2TheFuture2009\/Unknown.jpg',
                                  fit: BoxFit.fill,
                                ),
                              ),
                            ),
                          ),
                        ),
                        Padding(
                          padding: const EdgeInsets.fromLTRB(3000),
                          child: Expanded(
                            flex: 1,
                            child: Container(
                              height: MediaQuery.of(context).size.height * 0.19,
                              width: MediaQuery.of(context).size.width * 0.30,
                              child: ClipRRect(
                                borderRadius: BorderRadius.circular(5),
                                child: Image.network(
                                  'https:\/\/www.conqermusic.com\/images\/conquer\/75\/2018RecklessLove\/Unknown.jpg',
                                  fit: BoxFit.fill,
                                ),
                              ),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Suzuki Tomohiro

unread,
May 11, 2021, 7:39:26 AM5/11/21
to HIMANSHU MISHRA, Flutter Development (flutter-dev)
Can you share the entire error?

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/CAJySXU-CDHF%2BpBMzw7yFAtTDrvc4itWKa99riyOj8uA%2B9%3DYZ_Q%40mail.gmail.com.

HIMANSHU MISHRA

unread,
May 11, 2021, 7:48:13 AM5/11/21
to Suzuki Tomohiro, Flutter Development (flutter-dev)
Only this I am getting. There is no problem on the screen. 

Thanks And Regards
HIMANSHU MISHRA
   

Suzuki Tomohiro

unread,
May 11, 2021, 8:20:24 AM5/11/21
to HIMANSHU MISHRA, Flutter Development (flutter-dev)
Check the console.
Reply all
Reply to author
Forward
0 new messages