Skip to content

Instantly share code, notes, and snippets.

@chrislo2004
Last active January 5, 2020 09:49
Show Gist options
  • Save chrislo2004/4dc53b712c39402995f57e28314abc4a to your computer and use it in GitHub Desktop.
Save chrislo2004/4dc53b712c39402995f57e28314abc4a to your computer and use it in GitHub Desktop.
dartpad.dev
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
debugPaintSizeEnabled = true; // <--- enable visual rendering
runApp(new ChrisApp());
}
class ChrisApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Chris Developed App',
theme: new ThemeData(
primarySwatch: Colors.blue,
primaryColor: const Color(0xFF2196f3),
accentColor: const Color(0xFF2196f3),
canvasColor: const Color(0xFFfafafa),
),
home: new ChrisHomePage(),
);
}
}
class ChrisHomePage extends StatefulWidget {
ChrisHomePage({Key key}) : super(key: key);
@override
_ChrisHomePageState createState() => new _ChrisHomePageState();
}
class _ChrisHomePageState extends State<ChrisHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('Home is where the heart is'),
),
body:
new Container(
padding: const EdgeInsets.all(0.0),
alignment: Alignment.center,
child:
new Container(
child:
// new Column(
// mainAxisAlignment: MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.max,
// crossAxisAlignment: CrossAxisAlignment.center,
// ),
new Column(
children: [
Container(
color: Colors.orange,
child: FlutterLogo(
size: 60.0,
),
),
Container(
color: Colors.blue,
child: FlutterLogo(
size: 60.0,
),
),
Container(
color: Colors.purple,
child: FlutterLogo(
size: 60.0,
),
),
],
)
),
),
);
}
}
// class MyPageView extends StatefulWidget {
// MyPageView({Key key}) : super(key: key);
// _MyPageViewState createState() => _MyPageViewState();
// }
// class _MyPageViewState extends State<MyPageView> {
// PageController _pageController;
// @override
// void initState() {
// super.initState();
// _pageController = PageController();
// }
// @override
// void dispose() {
// _pageController.dispose();
// super.dispose();
// }
// @override
// Widget build(BuildContext context) {
// return MaterialApp(
// home: Scaffold(
// body: PageView(
// controller: _pageController,
// children: [
// Container(
// color: Colors.red,
// child: Center(
// child: RaisedButton(
// color: Colors.white,
// onPressed: () {
// if (_pageController.hasClients) {
// _pageController.animateToPage(
// 1,
// duration: const Duration(milliseconds: 400),
// curve: Curves.easeInOut,
// );
// }
// },
// child: Text('Next'),
// ),
// ),
// ),
// Container(
// color: Colors.blue,
// child: Center(
// child: RaisedButton(
// color: Colors.white,
// onPressed: () {
// if (_pageController.hasClients) {
// _pageController.animateToPage(
// 0,
// duration: const Duration(milliseconds: 400),
// curve: Curves.easeInOut,
// );
// }
// },
// child: Text('Previous'),
// ),
// ),
// ),
// ],
// ),
// ),
// );
// }
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment