Flutter遇到的坑

安装完Flutter开发环境之后,写了第一个程序:

import 'package:flutter/material.dart';

void main() => runApp(HomePage());

class HomePage extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    
    return Text( 'Hello');
  }
  
}

报错:


image.png

改为:

import 'package:flutter/material.dart';

void main() => runApp(HomePage());

class HomePage extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    
    return Text(
        'Hello',
        textDirection: TextDirection.ltr,
        );
  }
  
}

你可能感兴趣的:(Flutter遇到的坑)