• An error problem
  • The solution

An error problem

MediaQuery.of() called with a context that does not contain a MediaQuery.
Copy the code

The Scaffold must be in the MaterialApp otherwise an error will occur

The solution

Wrap the root node with the MaterialApp()

import 'package:flutter/material.dart';
class FlareDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    returnMaterialApp( home: FlareSignInDemo() , ); }}Copy the code