Skip to content

Instantly share code, notes, and snippets.

View Eng-MFQ's full-sized avatar
🏠
Working from home

Muwaffaq imam Eng-MFQ

🏠
Working from home
View GitHub Profile
/// copy me
Widget _widgetName(BuildContext context) {
return null;
}
@Eng-MFQ
Eng-MFQ / FlutterMainStarter
Created December 29, 2018 08:02
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
/** FontFamily **/
///'casual'
///'cursive'
///'monospace'
///'sans-serif-condensed'
///'sans-serif-smallcaps'
///'serif'
///'serif-monospace'
@Eng-MFQ
Eng-MFQ / FlutterStarterColumn
Last active January 23, 2022 08:13
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) {
@Eng-MFQ
Eng-MFQ / FlutterStarterTemplate.dart
Last active December 25, 2018 11:43
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) {
/**
* Clean up the media player by releasing its resources.
*/
private void releaseMediaPlayer() {
// If the media player is not null, then it may be currently playing a sound.
if (mMediaPlayer != null) {
// Regardless of the current state of the media player, release its resources
// because we no longer need it.
mMediaPlayer.release();
public void openNumberActivity(){
Intent intent = new Intent(this, NumbersActivity.class);
startActivity(intent);
}
/**
* Displays the given score for Team B.
*/
public void displayForTeamB(int score) {
TextView scoreView = (TextView) findViewById(R.id.team_b_score);
scoreView.setText(String.valueOf(score));
}
/**
* Displays the given score for Team A.
*/
public void displayForTeamA(int score) {
TextView scoreView = (TextView) findViewById(R.id.team_a_score);
scoreView.setText(String.valueOf(score));
}
/**
* This method displays the given text on the screen.
*/
private void displayMessage(String message) {
TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
priceTextView.setText(message);
}