Skip to content

Commit

Permalink
优化example代码
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhuoyuan committed Jan 6, 2020
1 parent eec3a61 commit 8aa6104
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .packages
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by pub on 2020-01-06 17:25:02.129620.
# Generated by pub on 2020-01-06 17:46:26.285635.
archive:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/archive-2.0.11/lib/
args:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.5.2/lib/
async:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.4.0/lib/
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,25 @@ Column(
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
void main() => runApp(new MyApp());
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter_ScreenUtil',
theme: new ThemeData(
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => new _MyHomePageState();
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
Expand All @@ -185,11 +185,11 @@ class _ExampleWidgetState extends State<ExampleWidget> {
@override
Widget build(BuildContext context) {
printScreenInformation();
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: new Center(
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expand Down
18 changes: 9 additions & 9 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,18 @@ Column(
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
void main() => runApp(new MyApp());
void main() => runApp( MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter_ScreenUtil',
theme: new ThemeData(
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(),
home: MyHomePage(),
);
}
}
Expand All @@ -162,7 +162,7 @@ class MyHomePage extends StatefulWidget {
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
Expand Down Expand Up @@ -190,11 +190,11 @@ class _ExampleWidgetState extends State<ExampleWidget> {
@override
Widget build(BuildContext context) {
printScreenInformation();
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: new Center(
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expand Down
8 changes: 4 additions & 4 deletions README_PT.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
print(
'Razão da fonte e altura para o tamanho do design:${ScreenUtil().scaleHeight * ScreenUtil.pixelRatio}');
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: new Center(
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expand Down
19 changes: 10 additions & 9 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

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

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter_ScreenUtil',
theme: new ThemeData(
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(),
home: MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => new _MyHomePageState();
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
Expand All @@ -45,11 +46,11 @@ class _ExampleWidgetState extends State<ExampleWidget> {
@override
Widget build(BuildContext context) {
printScreenInformation();
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: new Center(
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expand Down
18 changes: 9 additions & 9 deletions example/lib/main_zh.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

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

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter_ScreenUtil',
theme: new ThemeData(
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(),
home: MyHomePage(),
);
}
}
Expand All @@ -23,7 +23,7 @@ class MyHomePage extends StatefulWidget {
final String title;

@override
_MyHomePageState createState() => new _MyHomePageState();
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
Expand Down Expand Up @@ -51,11 +51,11 @@ class _ExampleWidgetState extends State<ExampleWidget> {
@override
Widget build(BuildContext context) {
printScreenInformation();
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: new Center(
body: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down

0 comments on commit 8aa6104

Please sign in to comment.