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'),
),
)
);
}
}
![](https://img.haomeiwen.com/i6979435/1170193ea65d4004.png)
![](https://img.haomeiwen.com/i6979435/352263660d4ba66d.png)
![](https://img.haomeiwen.com/i6979435/9aaa196311b112b9.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
),
),
),
)
);
}
}
![](https://img.haomeiwen.com/i6979435/8bd8ad934033e97b.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,
),
),
)
);
}
}
![](https://img.haomeiwen.com/i6979435/5c00e397db26a654.png)
![](https://img.haomeiwen.com/i6979435/2b9ef9291b72ee49.png)
![](https://img.haomeiwen.com/i6979435/1dcd60356041b6b9.png)