Skip to content

Instantly share code, notes, and snippets.

View Ahmadre's full-sized avatar
🐦
fluttering

Rebar Ahmad Ahmadre

🐦
fluttering
  • App Logik GmbH
  • Krefeld - Germany
View GitHub Profile
@Ahmadre
Ahmadre / main.dart
Created November 24, 2019 22:06
Scrolling not working in ListView in Flutter Web
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class SimpleList extends StatefulWidget {
SimpleList({Key key}) : super(key: key);
@override
import 'package:flutter/material.dart';
const _tabletBreakpoint = 720.0;
const _desktopBreakpoint = 1440.0;
const _minHeight = 400.0;
const _tabletSpacingVertical = 15.0;
const _tabletSpacingHorizontial = 10.0;
const _drawerWidth = 304.0;
class NavigationRail extends StatelessWidget {
@Ahmadre
Ahmadre / main.dart
Created March 9, 2020 20:14
Segmentation fault
import 'package:flutter/material.dart';
import 'package:luitsapp/Screens/splashScreen.dart';
import 'package:luitsapp/services/hive/credentialsManager.dart';
import 'package:tinycolor/tinycolor.dart';
void main() async {
runApp(LUITSApp());
}
class LUITSApp extends StatefulWidget {
@Ahmadre
Ahmadre / main.dart
Created April 9, 2020 00:56
Slow Web example
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:ui';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@Ahmadre
Ahmadre / main.dart
Created April 23, 2020 03:19
Google Sign In Flutter Web
import 'package:google_sign_in/google_sign_in.dart';
import 'package:firebase_auth/firebase_auth.dart';
final GoogleSignIn _googleAuth = GoogleSignIn();
final FirebaseAuth _auth = FirebaseAuth.instance;
Future<dynamic> _signInWithGoogle({BuildContext ctx}) async {
final GoogleSignInAccount googleUser = await _googleAuth.signIn();
if (googleUser == null) {
Scaffold.of(ctx).showSnackBar(SnackBar(
@Ahmadre
Ahmadre / main.dart
Last active April 25, 2020 00:51
Upload Image - Firebase example for Flutter web
import 'dart:html' as html;
import 'package:mime_type/mime_type.dart';
import 'package:path/path.dart' as Path;
import 'package:image_picker_web/image_picker_web.dart';
import 'package:firebase/firebase.dart' as fb;
import 'package:flutter/material.dart';
html.File _cloudFile;
var _fileBytes;
@Ahmadre
Ahmadre / main.dart
Created June 18, 2020 01:54
Naive example for Expanding Child inside ExpansionTile
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
final kExpansionTileHeight = 114;
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@Ahmadre
Ahmadre / main.dart
Created June 18, 2020 01:58
Expanded in a column
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
final kExpansionTileHeight = 114;
@Ahmadre
Ahmadre / fling_physics.dart
Created August 3, 2020 20:12 — forked from slightfoot/fling_physics.dart
Fling PageScrollPhysics for Flutter
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Ahmadre
Ahmadre / Dockerfile
Created February 7, 2021 00:22
Dockerize Flutter
# Provide nginx webserver
FROM nginx:stable
# Set directory to Copy App
WORKDIR /app
# Prerequisites
RUN apt update && apt install -y curl git unzip xz-utils zip libglu1-mesa
# Download Flutter SDK