Skip to content

Instantly share code, notes, and snippets.

@Eng-MFQ
Last active January 23, 2022 08:13
Show Gist options
  • Save Eng-MFQ/b4599e990f3962504e6ca3f65c5839b5 to your computer and use it in GitHub Desktop.
Save Eng-MFQ/b4599e990f3962504e6ca3f65c5839b5 to your computer and use it in GitHub Desktop.
a flutter app starter template with column layout written
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
/// this is your APP Main screen configuration
class MyApp extends StatelessWidget {
MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(),
);
}
}
/// this is a template to start building a UI
/// to start adding any UI you want change what comes after the [ body: ] tag below
class MyHomePage extends StatelessWidget {
MyHomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xfff4f4f4),
/*******************--[focus here 🧐]--*******************/
appBar: AppBar(
leading: const Icon(Icons.android_sharp),
title: const Text('App Title'),
backgroundColor: Colors.teal,
elevation: 4,
),
body: myWidget(),
/*******************--[focus here 🧐]--*******************/
);
}
Widget myWidget() {
return Container(
padding: const EdgeInsets.all(20),
color: Colors.blueAccent,
child: Column(
mainAxisSize: MainAxisSize.min,
children: const <Widget>[
/*******************--[focus here 🧐]--*******************/
Text(
'Welcome to the Course',
),
/*******************--[focus here 🧐]--*******************/
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment