Ionic Firebase App
Published in

Ionic Firebase App

Flutter Mobile App Properties Source Codes.

Short Intro about Flutter:

Information Flutter Widget Properties

Flutter is Google’s mobile SDK for crafting high-quality native interfaces on iOS and Android in record time. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.

If you are familiar with object-oriented code and basic programming concepts such as variables, loops, and conditionals, you can complete this codelab. You don’t need previous experience with Dart or mobile programming.

Some Common Flutter Properties and their Source Codes:

Container Properties Source Code:

import ‘package:flutter/material.dart’;

void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return new MaterialApp(
title: ‘Generated App’,
theme: new ThemeData(
primarySwatch: Colors.blue,
primaryColor: const Color(0xFF2196f3),
accentColor: const Color(0xFF2196f3),
canvasColor: const Color(0xFFfafafa),
fontFamily: ‘Roboto’,
),
home: new MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(‘App Name’),
),
body:
new Container(
padding: const EdgeInsets.all(0.0),
alignment: Alignment.center,
),

);
}
}

Flutter Row Properties Source Code:

import ‘package:flutter/material.dart’;

void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return new MaterialApp(
title: ‘Generated App’,
theme: new ThemeData(
primarySwatch: Colors.blue,
primaryColor: const Color(0xFF2196f3),
accentColor: const Color(0xFF2196f3),
canvasColor: const Color(0xFFfafafa),
fontFamily: ‘Roboto’,
),
home: new MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(‘App Name’),
),
body:
new Container(
child:
new Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
),

padding: const EdgeInsets.all(0.0),
alignment: Alignment.center,
),

);
}
}

Flutter Column Properties Source Code:

import ‘package:flutter/material.dart’;

void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return new MaterialApp(
title: ‘Generated App’,
theme: new ThemeData(
primarySwatch: Colors.blue,
primaryColor: const Color(0xFF2196f3),
accentColor: const Color(0xFF2196f3),
canvasColor: const Color(0xFFfafafa),
fontFamily: ‘Roboto’,
),
home: new MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(‘App Name’),
),
body:
new Container(
child:
new Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
new Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
)
]

),

padding: const EdgeInsets.all(0.0),
alignment: Alignment.center,
),

);
}
}

Flutter Image Properties Source Code:

import ‘package:flutter/material.dart’;

void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return new MaterialApp(
title: ‘Generated App’,
theme: new ThemeData(
primarySwatch: Colors.blue,
primaryColor: const Color(0xFF2196f3),
accentColor: const Color(0xFF2196f3),
canvasColor: const Color(0xFFfafafa),
fontFamily: ‘Roboto’,
),
home: new MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(‘App Name’),
),
body:
new Image.network(
‘https://res.cloudinary.com/dzu7tvexv/image/upload/f_auto,q_auto/v1565008713/p4jcpwj4txv9fftlaygl.png’,
fit:BoxFit.fill,
),

);
}
}

Flutter Icon Properties Source Code:

import ‘package:flutter/material.dart’;

void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return new MaterialApp(
title: ‘Generated App’,
theme: new ThemeData(
primarySwatch: Colors.blue,
primaryColor: const Color(0xFF2196f3),
accentColor: const Color(0xFF2196f3),
canvasColor: const Color(0xFFfafafa),
fontFamily: ‘Roboto’,
),
home: new MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(‘App Name’),
),
body:
new Icon(
Icons.account_balance,
color: const Color(0xFF000000),
size: 48.0),

);
}
}

Flutter Raised Button Properties Source Code:

import ‘package:flutter/material.dart’;

void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return new MaterialApp(
title: ‘Generated App’,
theme: new ThemeData(
primarySwatch: Colors.blue,
primaryColor: const Color(0xFF2196f3),
accentColor: const Color(0xFF2196f3),
canvasColor: const Color(0xFFfafafa),
fontFamily: ‘Roboto’,
),
home: new MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(‘App Name’),
),
body:
new RaisedButton(key:null, onPressed:buttonPressed,
color: const Color(0xFFe0e0e0),
child:
new Text(
“BUTTON 1”,
style: new TextStyle(fontSize:33.0,
color: const Color(0xFF000000),
fontWeight: FontWeight.w200,
fontFamily: “Roboto”),
)
),

);
}
void buttonPressed(){}

}

Flutter App Bar properties Source Code:

import ‘package:flutter/material.dart’;

void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return new MaterialApp(
title: ‘Generated App’,
theme: new ThemeData(
primarySwatch: Colors.blue,
primaryColor: const Color(0xFF2196f3),
accentColor: const Color(0xFF2196f3),
canvasColor: const Color(0xFFfafafa),
fontFamily: ‘Roboto’,
),
home: new MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
body:
new Container(
child: new Scaffold(
appBar: new AppBar(
title: new Text(‘App Name’),
),
);,

padding: const EdgeInsets.all(0.0),
alignment: Alignment.center,
),

);
}
}

Flutter Drop down Button Properties Source Code:

import ‘package:flutter/material.dart’;

void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return new MaterialApp(
title: ‘Generated App’,
theme: new ThemeData(
primarySwatch: Colors.blue,
primaryColor: const Color(0xFF2196f3),
accentColor: const Color(0xFF2196f3),
canvasColor: const Color(0xFFfafafa),
fontFamily: ‘Roboto’,
),
home: new MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(‘App Name’),
),
body:
new DropdownButton<String>(
onChanged: popupButtonSelected,
value: “Child 1”,
style: new TextStyle(fontSize:52.0,
color: const Color(0xFF202020),
fontWeight: FontWeight.w200,
fontFamily: “Roboto”),
items: <DropdownMenuItem<String>>[
const DropdownMenuItem<String>(value: “Child 1”,
child: const Text(“Child 1”)),
const DropdownMenuItem<String>(value: “Child 2”,
child: const Text(“Child 2”)),
const DropdownMenuItem<String>(value: “Child 3”,
child: const Text(“Child 3”)),
],
),

);
}
void popupButtonSelected(String value) {}

}

As per Google Official site you can check Flutter setup and how to build your first mobile app below.

1. Set up your Flutter environment

You need two pieces of software to complete this lab: the Flutter SDK, and an editor (Like Android Studio or Visual editor, etc), you can use your preferred editor.

You can run your Flutter App using any of the following devices:

2. Create the initial Flutter app

Create a simple template Flutter App, Create the app

  1. Open the IDE and select Start a new Flutter project.
  2. Select Flutter Application as the project type. Then click Next.
  3. Verify the Flutter SDK path specifies the SDK’s location (select Install SDK… if the text field is blank).
  4. Enter a project name (for example, myapp). Then click Next.
  5. Click Finish.
  6. Wait for Android Studio to install the SDK and create the project.

For more details check at https://flutter.dev/docs/get-started/test-drive#androidstudio

Name the project startup_namer You’ll be modifying this starter app to create the finished app.

Replace the contents of lib/main.dart.
Delete all of the code from lib/main.dart. Replace with the following code, which displays "Hello World" in the center of the screen.

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: const Text('Welcome to Flutter'),
),
body: const Center(
child: const Text('Hello World'),
),
),
);
}
}

Note: When pasting code into your app, an indentation can become skewed. You can fix this automatically with the Flutter tools:

  • Android Studio / IntelliJ IDEA: Right-click the dart code and select Reformat Code with dartfmt.
  • VS Code: Right-click and select Format Document.
  • Terminal: Run flutter format <filename>.

You can check here https://codelabs.developers.google.com/codelabs/first-flutter-app-pt1/#2 for all steps-to-steps guide.

--

--

Browse your Mobile App on our market place https://www.ionicfirebaseapp.com/products

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ionic Firebase App

IonicFirebaseApp is the innovative marketplace for Mobile app, Web app, Backend on the newest trending technologies and tools. https://www.ionicfirebaseapp.com