2019-01-15

2019-01-15  本文已影响0人  入秋未凉的海
hello world
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Hello World'),
        ),
        body: Center(
          child: Text('Hello World'),
        ),
      )
    );
  }
}
image.png image.png image.png
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'TextWidget',
      home: Scaffold(
        appBar: AppBar(
          title: Text('TextWidget'),
        ),
        body: Center(
          child: Text('Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin',
          textAlign: TextAlign.right,
          maxLines: 1,
          overflow: TextOverflow.ellipsis,
          ),
        ),
      )
    );
  }
}
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'TextWidget',
      home: Scaffold(
        appBar: AppBar(
          title: Text('TextWidget'),
        ),
        body: Center(
          child: Text(
            'Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin Hello World xubin',
            textAlign: TextAlign.right,
            style: TextStyle(
              fontSize: 25.0,
              color: Color.fromARGB(255, 255, 150, 150),
              decoration: TextDecoration.underline,
              decorationStyle: TextDecorationStyle.solid
            ),
          ),
        ),
      )
    );
  }
}
image.png
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'TextWidget',
      home: Scaffold(
        appBar: AppBar(
          title: Text('TextWidget'),
        ),
        body: Center(
          child: Container(
            child: Text(
              'Hello World',
              style: TextStyle(
                fontSize: 25.0,
              ),
            ),
            alignment: Alignment.bottomRight,
            width: 200.0,
            height: 200.0,
            color: Colors.lightBlue,
          ),
        ),
      )
    );
  }
}
image.png image.png
image.png
上一篇 下一篇

猜你喜欢

热点阅读