Skip to content

Instantly share code, notes, and snippets.

@sooxt98
Last active December 2, 2020 12:55
Show Gist options
  • Save sooxt98/49eb57f2ea79709e11fa16cf1d4f5467 to your computer and use it in GitHub Desktop.
Save sooxt98/49eb57f2ea79709e11fa16cf1d4f5467 to your computer and use it in GitHub Desktop.
Flutter Bottom Center Button
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center ,
mainAxisAlignment: MainAxisAlignment.center ,
children: [
Text('MY CONTENT'),
Text('MY CONTENT'),
Text('MY CONTENT'),
Spacer(),
FlatButton(child: Text('BUTTON'),onPressed: (){},color: Colors.red),
],),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment