主文件代码
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: new Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: () {
print('展开');
},
),
title: Text('效果'),
),
body: mypage(),
));
}
}
class mypage extends StatelessWidget {
Widget _center() {
return Container(
width: 30,
height: 30,
color: Colors.blue,
);
}
@override
Widget build(BuildContext context) {
return Center(
child: Container(
child: Row(
children: [
Column(
children: [
Image.asset(
'assets/images/photo.png',
color: Colors.amberAccent,
)
],
),
_center(),
Column(
children: [
Image.asset(
'assets/images/photo.png',
color: Colors.amberAccent,
)
],
),
_center(),
Column(
children: [
Image.asset(
'assets/images/photo.png',
color: Colors.amberAccent,
)
],
),
],
)),
);
}
}