Skip to content

Commit

Permalink
updated: package to be standard across all example apps
Browse files Browse the repository at this point in the history
  • Loading branch information
nisrulz committed Jul 7, 2018
1 parent 01a2ac5 commit 75d833b
Show file tree
Hide file tree
Showing 114 changed files with 12,201 additions and 290 deletions.
76 changes: 39 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,74 @@
![Image](img/github_banner.png)


### Show some :heart: and star the repo to support the project

[![GitHub stars](https://img.shields.io/github/stars/nisrulz/flutter-examples.svg?style=social&label=Star)](https://github.com/nisrulz/flutter-examples) [![GitHub forks](https://img.shields.io/github/forks/nisrulz/flutter-examples.svg?style=social&label=Fork)](https://github.com/nisrulz/flutter-examples/fork) [![GitHub watchers](https://img.shields.io/github/watchers/nisrulz/flutter-examples.svg?style=social&label=Watch)](https://github.com/nisrulz/flutter-examples) [![GitHub followers](https://img.shields.io/github/followers/nisrulz.svg?style=social&label=Follow)](https://github.com/nisrulz/flutter-examples)
[![Twitter Follow](https://img.shields.io/twitter/follow/nisrulz.svg?style=social)](https://twitter.com/nisrulz)

Main repository containing all the example apps demonstrating features/functionality/integrations in [Flutter](https://flutter.io/) application development

### Featured In

- [Flutter Weekly #11](https://mailchi.mp/5db146a7468b/flutter-weekly-11)

Lookup Links: [[Setup Flutter](https://flutter.io/setup/)] [[Widgets Catalog](https://flutter.io/widgets/)] [[Dart Lang](https://flutter.io/bootstrap-into-dart/)]


<img src="stateful_widget/demo_img.gif" height="300em" /> <img src="using_bottom_nav_bar/demo_img.gif" height="300em" /> <img src="dropdown_button/demo_img.gif" height="300em" /> <img src="using_stepper/demo_img.gif" height="300em" /> <img src="using_tabs/demo_img.gif" height="300em" />

## Example apps

1. [Simple Material App](/simple_material_app) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/simple_material_app)
1. [Using Theme](/using_theme) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_theme)
1. [Stateless Widgets](/stateless_widgets) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/stateless_widgets)
1. [Stateful Widget](/stateful_widget) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/stateful_widget)
1. [Using EditText](/using_edittext) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_edittext)
1. [Load local image](/load_local_image) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/load_local_image)
1. [Load local json](/load_local_json) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/load_local_json)
1. [Using HTTP GET](/using_http_get) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_http_get)
1. [Using Alert Dialog](/using_alert_dialog) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_alert_dialog)
1. [Using Stepper](/using_stepper) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_stepper)
1. [Using Tabs](/using_tabs) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_tabs)
1. [Using Bottom Navigation Bar](/using_bottom_nav_bar) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_bottom_nav_bar)
1. [Using Custom Fonts](/using_custom_fonts) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_custom_fonts)
1. [Using Gradient](/using_gradient) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_gradient)
1. [Navigation Drawer](/navigation_drawer) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/navigation_drawer)
1. [Enable Splash Screen](/enabling_splash_screen) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/enabling_splash_screen)
1. [Using Listview](/using_listview) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_listview)
1. [Using SnackBar](/using_snackbar) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_snackbar)
1. [Grid Layout](/grid_layout) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/grid_layout)
1. [DropDown Button](/dropdown_button) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/dropdown_button)
1. [Image from Network](/image_from_network) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/image_from_network)
1. [Infinite List](/infinite_list) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/infinite_list)
1. [Simple Material App](/simple_material_app) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/simple_material_app)
1. [Using Theme](/using_theme) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_theme)
1. [Stateless Widgets](/stateless_widgets) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/stateless_widgets)
1. [Stateful Widget](/stateful_widget) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/stateful_widget)
1. [Using EditText](/using_edittext) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_edittext)
1. [Load local image](/load_local_image) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/load_local_image)
1. [Load local json](/load_local_json) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/load_local_json)
1. [Using HTTP GET](/using_http_get) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_http_get)
1. [Using Alert Dialog](/using_alert_dialog) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_alert_dialog)
1. [Using Stepper](/using_stepper) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_stepper)
1. [Using Tabs](/using_tabs) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_tabs)
1. [Using Bottom Navigation Bar](/using_bottom_nav_bar) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_bottom_nav_bar)
1. [Using Custom Fonts](/using_custom_fonts) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_custom_fonts)
1. [Using Gradient](/using_gradient) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_gradient)
1. [Navigation Drawer](/navigation_drawer) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/navigation_drawer)
1. [Enable Splash Screen](/enabling_splash_screen) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/enabling_splash_screen)
1. [Using Listview](/using_listview) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_listview)
1. [Using SnackBar](/using_snackbar) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/using_snackbar)
1. [Grid Layout](/grid_layout) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/grid_layout)
1. [DropDown Button](/dropdown_button) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/dropdown_button)
1. [Image from Network](/image_from_network) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/image_from_network)
1. [Infinite List](/infinite_list) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/infinite_list)
1. [Google Signin](/google_signin) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/google_signin)

### Complete apps with multiple features

1. [Tip Calculator](/tip_calculator) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/tip_calculator)

1. [Tip Calculator](/tip_calculator) [![download](img/ic_download.png)](https://kinolien.github.com/gitzip/?download=https://github.com/nisrulz/flutter-examples/tree/master/tip_calculator)

# Pull Requests

I welcome and encourage all pull requests. It usually will take me within 24-48 hours to respond to any issue or request. Here are some basic rules to follow to ensure timely addition of your request:
1. Match coding style (braces, spacing, etc.) This is best achieved using `Reformat Code` feature of Android Studio `CMD`+`Option`+`L` on Mac and `CTRL` + `ALT` + `L` on Linux + Windows .
2. If its a feature, bugfix, or anything please only change code to what you specify.
3. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
4. Pull requests _must_ be made against `develop` branch. Any other branch (unless specified by the maintainers) will get rejected.
5. Check for existing [issues](https://github.com/nisrulz/flutter-examples/issues) first, before filing an issue.
6. Make sure you follow the set standard as all other projects in this repo do
7. Have fun!

1. Match coding style (braces, spacing, etc.) This is best achieved using `Reformat Code` feature of Android Studio `CMD`+`Option`+`L` on Mac and `CTRL` + `ALT` + `L` on Linux + Windows .
2. If its a feature, bugfix, or anything please only change code to what you specify.
3. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
4. Pull requests _must_ be made against `develop` branch. Any other branch (unless specified by the maintainers) will get rejected.
5. Check for existing [issues](https://github.com/nisrulz/flutter-examples/issues) first, before filing an issue.
6. Make sure you follow the set standard as all other projects in this repo do
7. Have fun!

> P.S. : I saw if you use Adblocker then Gitzip downloads an empty `zip` file, so disable Adblocker to get the correct `zip` file.
### Created & Maintained By

[Nishant Srivastava](https://github.com/nisrulz) ([@nisrulz](https://www.twitter.com/nisrulz))

> If you found these examples helpful or you learned something from their source code and want to thank me, consider buying me a cup of :coffee:
> + [PayPal](https://www.paypal.me/nisrulz/5)
> + Bitcoin Address: 13PjuJcfVW2Ad81fawqwLtku4bZLv1AxCL
>
> - [PayPal](https://www.paypal.me/nisrulz/5)
> - Bitcoin Address: 13PjuJcfVW2Ad81fawqwLtku4bZLv1AxCL
License
=======
# License

Copyright 2017 Nishant Srivastava

Expand Down
2 changes: 1 addition & 1 deletion enabling_splash_screen/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.yourcompany.enablingsplashscreen"
applicationId "github.nisrulz.enablingsplashscreen"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourcompany.enablingsplashscreen">
package="github.nisrulz.enablingsplashscreen">

<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.khandelwal.dipansh.infinitelist;
package github.nisrulz.enablingsplashscreen;

import android.os.Bundle;

Expand Down
4 changes: 2 additions & 2 deletions enabling_splash_screen/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.enablingSplashScreen;
PRODUCT_BUNDLE_IDENTIFIER = github.nisrulz.enablingSplashScreen;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -404,7 +404,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.enablingSplashScreen;
PRODUCT_BUNDLE_IDENTIFIER = github.nisrulz.enablingSplashScreen;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
4 changes: 2 additions & 2 deletions google_signin/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# google_signin
# Google Signin

A simple flutter app to demonstrate Google signin using Firebase. Register your app on Firebase and enable Google authentication.
Example app to demonstrate Google signin using Firebase. Register your app on Firebase and enable Google authentication.

![Initial Page](page1.jpg)
![Login Dialog](page2.jpg)
Expand Down
2 changes: 1 addition & 1 deletion google_signin/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.theroboticlab.googlesignin"
applicationId "github.nisrulz.googlesignin"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
Expand Down
2 changes: 1 addition & 1 deletion google_signin/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.theroboticlab.googlesignin">
package="github.nisrulz.googlesignin">

<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.yourcompany.usingstepper;
package github.nisrulz.googlesignin;

import android.os.Bundle;

Expand Down
Empty file modified google_signin/android/gradlew
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions google_signin/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions google_signin/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
63 changes: 63 additions & 0 deletions google_signin/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary
end

target 'Runner' do
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')

# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
end
generated_xcode_build_settings.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.symlinks', 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
end
}

# Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
}
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
4 changes: 2 additions & 2 deletions google_signin/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.theroboticlab.googleSignin;
PRODUCT_BUNDLE_IDENTIFIER = github.nisrulz.googleSignin;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -404,7 +404,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.theroboticlab.googleSignin;
PRODUCT_BUNDLE_IDENTIFIER = github.nisrulz.googleSignin;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion google_signin/lib/home.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:flutter/foundation.dart';

class Home extends StatelessWidget {
Home(
Expand Down
7 changes: 5 additions & 2 deletions google_signin/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'dart:async';

import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:firebase_auth/firebase_auth.dart';

import 'home.dart';
import 'user.dart';
import 'dart:async';

void main() {
runApp(new App());
Expand All @@ -18,6 +20,7 @@ class AppState extends State<App> {
Widget currentPage;
GoogleSignIn googleSignIn;
Widget userPage;

@override
void initState() {
super.initState();
Expand Down
4 changes: 2 additions & 2 deletions google_signin/lib/user.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:flutter/foundation.dart';
import 'package:firebase_auth/firebase_auth.dart';

class User extends StatelessWidget {
User({Key key, @required this.onLogout, @required this.user})
Expand Down
Loading

0 comments on commit 75d833b

Please sign in to comment.