Skip to content

Instantly share code, notes, and snippets.

@Eng-MFQ
Last active December 25, 2018 11:43
Show Gist options
  • Save Eng-MFQ/2c7eeec505bd532e512d38db8c5c0b75 to your computer and use it in GitHub Desktop.
Save Eng-MFQ/2c7eeec505bd532e512d38db8c5c0b75 to your computer and use it in GitHub Desktop.
Flutter starter template for students to start building UI , and NOT get confused with the code
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.grey
: Colors.blue,
),
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,
),
/*******************--[focus here 🧐]--*******************/
body: Text(
'Hi im a text',
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment