Flutter: MediaQuery.of() called with a context that does not contain a MediaQuery

-2

How can I fix this error?

import 'package:flutter/material.dart';
import 'package:adobe_xd/pinned.dart';
import 'package:flutter_svg/flutter_svg.dart';
void main() => runApp(XDInitial_screen1());
class XDInitial_screen1 extends StatelessWidget {
  XDInitial_screen1({
    Key key,
  }) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xffffffff),
      body: Stack(
        children: <Widget>[
          // Adobe XD layer: 'Bg' (shape)
          Container(
            width: 375.0,
            height: 812.0,
            decoration: BoxDecoration(
              color: const Color(0xffffffff),
            ),
          ),
          // Adobe XD layer: 'Bg Purple' (shape)
          Container(
            width: 375.0,
            height: 576.0,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.only(
                bottomRight: Radius.circular(26.0),
                bottomLeft: Radius.circular(36.0),
              ),
              color: const Color(0xff182351),
            ),
          ),
          Transform.translate(
            offset: Offset(37.0, 714.0),
            child:
                // Adobe XD layer: 'btn-primary' (group)
                SizedBox(
              width: 302.0,
              height: 58.0,
              child: Stack(
                children: <Widget>[
                  Pinned.fromSize(
                    bounds: Rect.fromLTWH(0.0, 0.0, 302.0, 58.0),
                    size: Size(302.0, 58.0),
                    pinLeft: true,
                    pinRight: true,
                    pinTop: true,
                    pinBottom: true,
                    child: SvgPicture.string(
                      _svg_kj3c84,
                      allowDrawingOutsideViewBox: true,
                      fit: BoxFit.fill,
                    ),
                  ),
                  Pinned.fromSize(
                    bounds: Rect.fromLTWH(114.0, 18.0, 76.0, 21.0),
                    size: Size(302.0, 58.0),
                    fixedWidth: true,
                    fixedHeight: true,
                    child: Text(
                      'Start Now',
                      style: TextStyle(
                        fontFamily: 'Poppins',
                        fontSize: 16,
                        color: const Color(0xffffffff),
                        fontWeight: FontWeight.w700,
                        height: 1.25,
                      ),
                      textAlign: TextAlign.center,
                    ),
                  ),
                ],
              ),
            ),
          ),
          Transform.translate(
            offset: Offset(3.2, 597.0),
            child: SizedBox(
              width: 370.0,
              child: Text(
                'Read or listen your favorite\n books wherever you are',
                style: TextStyle(
                  fontFamily: 'Poppins',
                  fontSize: 24,
                  color: const Color(0xff191622),
                  fontWeight: FontWeight.w700,
                  height: 1.5,
                ),
                textAlign: TextAlign.center,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
flutter
dart
asked on Stack Overflow Sep 1, 2020 by luicasilva • edited Sep 1, 2020 by Christopher Moore

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0