Skip to content

Commit ccbd207

Browse files
committed
remove new keyword,
remove null propertys
1 parent a982409 commit ccbd207

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

example/lib/main.dart

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ import 'package:intro_views_flutter/Models/page_view_model.dart';
33
import 'package:intro_views_flutter/intro_views_flutter.dart';
44

55
/// This is the main method of app, from here execution starts.
6-
void main() => runApp(new App());
6+
void main() => runApp(App());
77

88
/// App widget class
99
1010
class App extends StatelessWidget {
1111
//making list of pages needed to pass in IntroViewsFlutter constructor.
1212
final pages = [
13-
new PageViewModel(
13+
PageViewModel(
1414
pageColor: const Color(0xFF03A9F4),
15-
iconImageAssetPath: 'assets/air-hostess.png',
16-
iconColor: null,
17-
bubbleBackgroundColor: null,
15+
// iconImageAssetPath: 'assets/air-hostess.png',
16+
bubble: Image.asset('assets/air-hostess.png'),
1817
body: Text(
1918
'Haselfree booking of flight tickets with full refund on cancelation',
2019
),
@@ -28,11 +27,9 @@ class App extends StatelessWidget {
2827
width: 285.0,
2928
alignment: Alignment.center,
3029
)),
31-
new PageViewModel(
30+
PageViewModel(
3231
pageColor: const Color(0xFF8BC34A),
3332
iconImageAssetPath: 'assets/waiter.png',
34-
iconColor: null,
35-
bubbleBackgroundColor: null,
3633
body: Text(
3734
'We work for the comfort , enjoy your stay at our beautiful hotels',
3835
),
@@ -45,11 +42,9 @@ class App extends StatelessWidget {
4542
),
4643
textStyle: TextStyle(fontFamily: 'MyFont', color: Colors.white),
4744
),
48-
new PageViewModel(
45+
PageViewModel(
4946
pageColor: const Color(0xFF607D8B),
5047
iconImageAssetPath: 'assets/taxi-driver.png',
51-
iconColor: null,
52-
bubbleBackgroundColor: null,
5348
body: Text(
5449
'Easy cab booking at your doorstep with cashless payment system',
5550
),
@@ -66,20 +61,20 @@ class App extends StatelessWidget {
6661

6762
@override
6863
Widget build(BuildContext context) {
69-
return new MaterialApp(
64+
return MaterialApp(
7065
debugShowCheckedModeBanner: false,
7166
title: 'IntroViews Flutter', //title of app
72-
theme: new ThemeData(
67+
theme: ThemeData(
7368
primarySwatch: Colors.blue,
7469
), //ThemeData
75-
home: new Builder(
76-
builder: (context) => new IntroViewsFlutter(
70+
home: Builder(
71+
builder: (context) => IntroViewsFlutter(
7772
pages,
7873
onTapDoneButton: () {
7974
Navigator.push(
8075
context,
81-
new MaterialPageRoute(
82-
builder: (context) => new HomePage(),
76+
MaterialPageRoute(
77+
builder: (context) => HomePage(),
8378
), //MaterialPageRoute
8479
);
8580
},
@@ -101,11 +96,11 @@ class HomePage extends StatelessWidget {
10196
@override
10297
Widget build(BuildContext context) {
10398
return Scaffold(
104-
appBar: new AppBar(
105-
title: new Text('Home'),
99+
appBar: AppBar(
100+
title: Text('Home'),
106101
), //Appbar
107-
body: new Center(
108-
child: new Text("This is the home page of the app"),
102+
body: Center(
103+
child: Text("This is the home page of the app"),
109104
), //Center
110105
); //Scaffold
111106
}

0 commit comments

Comments
 (0)