Skip to content

Instantly share code, notes, and snippets.

@Eng-MFQ
Created December 29, 2018 08:02
Show Gist options
  • Save Eng-MFQ/29389276862976bf5908897bb8dfb8d8 to your computer and use it in GitHub Desktop.
Save Eng-MFQ/29389276862976bf5908897bb8dfb8d8 to your computer and use it in GitHub Desktop.
Starter template for flutter course
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
/// this is your APP Main screen configuration
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
// to change your app color change this
/// first color is for IOS the second color is for Android
/*******************--[focus here 🧐]--*******************/
primarySwatch: defaultTargetPlatform == TargetPlatform.iOS
? Colors.amber
: Colors.amber,
),
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 {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('App Title'),
elevation:
Theme.of(context).platform == TargetPlatform.iOS ? 0.0 : 4.0,
),
body: _myWidget(context)
);
}
}
/*******************--[focus here 🧐]--*******************/
/*******************--[Copy MR]--*******************/
/// Delete null and add your widget
Widget _myWidget(BuildContext context){
return null;
}
/** FontFamily **/
///'casual'
///'cursive'
///'monospace'
///'sans-serif-condensed'
///'sans-serif-smallcaps'
///'serif'
///'serif-monospace'
///
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment