Skip to content

Commit 029f96b

Browse files
authored
Merge pull request #1 from nisrulz/master
pull
2 parents 3ea3b36 + 6d56bfc commit 029f96b

File tree

110 files changed

+703
-736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+703
-736
lines changed

.github/FUNDING.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These are supported funding model platforms
2+
3+
ko_fi: nisrulz
4+
liberapay: nisrulz
5+
custom: https://www.paypal.me/nisrulz/5usd

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Main repository containing all the example apps demonstrating features/functiona
99

1010
### Featured In
1111

12+
- [Official Flutter Samples](https://github.com/flutter/samples/blob/master/INDEX.md)
1213
- [Flutter Weekly #11](https://mailchi.mp/5db146a7468b/flutter-weekly-11)
1314

1415
Lookup Links: [[Setup Flutter](https://flutter.io/setup/)] [[Widgets Catalog](https://flutter.io/widgets/)] [[Dart Lang](https://flutter.io/bootstrap-into-dart/)]
@@ -46,6 +47,13 @@ Lookup Links: [[Setup Flutter](https://flutter.io/setup/)] [[Widgets Catalog](ht
4647

4748
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)
4849

50+
# Get packages for all flutter projects
51+
52+
- Once you have cloned this repo, navigate to the root of this repo.
53+
- Next run `./get_packages.sh`
54+
> Make sure the script is executable. If it is not, then run `chmod +x get_packages.sh` first to make it executable.
55+
- Done!
56+
4957
# Pull Requests
5058

5159
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:

delete_build_folder.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@
77
# Install trash cli
88
# brew install trash
99

10-
# Iterate over each child directory inside the current directory
11-
echo ""
12-
for dir in ./*;
10+
echo "# Deleting build directories..."
11+
12+
# Iterate over each sub-directory inside the current directory
13+
for DIR in ./*;
1314
do
14-
echo ""
15-
echo ">>>> Deleting build directory inside " $dir
16-
trash $dir/build/
17-
echo ""
18-
echo ">>>> Done."
15+
# Check if build directory exists inside the $DIR directory
16+
# If it does then it is a Flutter project
17+
if [ -d "$DIR/build/" ]; then
18+
# Update the packages in the project
19+
echo ""
20+
echo ">>>> Deleting build directory inside " "$DIR"
21+
# Run command inside the sub-directory i.e Flutter project
22+
(cd "$DIR" && trash build);
23+
echo ""
24+
echo ">>>> Done."
25+
fi
1926
done

dropdown_button/lib/main.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import 'package:flutter/material.dart';
22

3-
void main() => runApp(new MyApp());
3+
void main() => runApp(MyApp());
44

55
class MyApp extends StatefulWidget {
66
@override
77
State<StatefulWidget> createState() {
8-
return new MyAppState();
8+
return MyAppState();
99
}
1010
}
1111

@@ -23,9 +23,9 @@ class MyAppState extends State<MyApp> {
2323
}
2424

2525
List<DropdownMenuItem<String>> buildAndGetDropDownMenuItems(List fruits) {
26-
List<DropdownMenuItem<String>> items = new List();
26+
List<DropdownMenuItem<String>> items = List();
2727
for (String fruit in fruits) {
28-
items.add(new DropdownMenuItem(value: fruit, child: new Text(fruit)));
28+
items.add(DropdownMenuItem(value: fruit, child: Text(fruit)));
2929
}
3030
return items;
3131
}
@@ -38,20 +38,20 @@ class MyAppState extends State<MyApp> {
3838

3939
@override
4040
Widget build(BuildContext context) {
41-
return new MaterialApp(
41+
return MaterialApp(
4242
debugShowCheckedModeBanner: false,
43-
home: new Scaffold(
44-
appBar: new AppBar(
45-
title: new Text("DropDown Button Example"),
43+
home: Scaffold(
44+
appBar: AppBar(
45+
title: Text("DropDown Button Example"),
4646
),
47-
body: new Container(
48-
child: new Center(
49-
child: new Column(
47+
body: Container(
48+
child: Center(
49+
child: Column(
5050
crossAxisAlignment: CrossAxisAlignment.center,
5151
mainAxisAlignment: MainAxisAlignment.center,
5252
children: <Widget>[
53-
new Text("Please choose a fruit: "),
54-
new DropdownButton(
53+
Text("Please choose a fruit: "),
54+
DropdownButton(
5555
value: _selectedFruit,
5656
items: _dropDownMenuItems,
5757
onChanged: changedDropDownItem,

enabling_splash_screen/android/app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ apply plugin: 'com.android.application'
1515
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
1616

1717
android {
18-
compileSdkVersion 25
19-
buildToolsVersion '25.0.3'
18+
compileSdkVersion 28
19+
2020

2121
lintOptions {
2222
disable 'InvalidPackage'
@@ -26,7 +26,7 @@ android {
2626
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2727
applicationId "github.nisrulz.enablingsplashscreen"
2828
minSdkVersion 16
29-
targetSdkVersion 25
29+
targetSdkVersion 28
3030
versionCode 1
3131
versionName "1.0"
3232
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -46,7 +46,7 @@ flutter {
4646
}
4747

4848
dependencies {
49-
androidTestCompile 'com.android.support:support-annotations:25.4.0'
50-
androidTestCompile 'com.android.support.test:runner:0.5'
51-
androidTestCompile 'com.android.support.test:rules:0.5'
49+
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
50+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
51+
androidTestImplementation 'com.android.support.test:rules:1.0.2'
5252
}

enabling_splash_screen/android/build.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
buildscript {
22
repositories {
3+
google()
34
jcenter()
4-
maven {
5-
url "https://maven.google.com"
6-
}
75
}
86

97
dependencies {
10-
classpath 'com.android.tools.build:gradle:2.3.3'
8+
classpath 'com.android.tools.build:gradle:3.2.1'
119
}
1210
}
1311

1412
allprojects {
1513
repositories {
14+
google()
1615
jcenter()
17-
maven {
18-
url "https://maven.google.com"
19-
}
2016
}
2117
}
2218

enabling_splash_screen/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

enabling_splash_screen/lib/main.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import 'package:flutter/material.dart';
22

3-
void main() => runApp(new MyApp());
3+
void main() => runApp(MyApp());
44

55
class MyApp extends StatelessWidget {
66
// This widget is the root of your application.
77
@override
88
Widget build(BuildContext context) {
9-
return new MaterialApp(
9+
return MaterialApp(
1010
title: 'Flutter Demo',
11-
home: new Scaffold(
12-
appBar: new AppBar(
13-
title: new Text("Splash Screen Example"),
11+
home: Scaffold(
12+
appBar: AppBar(
13+
title: Text("Splash Screen Example"),
1414
),
15-
body: new Center(
16-
child: new Text("Hello World"),
15+
body: Center(
16+
child: Text("Hello World"),
1717
),
1818
),
1919
);

get_packages.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# Written by Nishant Srivastava
3+
4+
# Call as
5+
# ./get_packages.sh
6+
7+
echo "# Updating to packages..."
8+
9+
# Iterate over each sub-directory inside the current directory
10+
for DIR in ./*;
11+
do
12+
# Check if pubspec.yaml file exists inside the $DIR directory
13+
# If it does then it is a Flutter project
14+
if [ -f "$DIR/pubspec.yaml" ]; then
15+
# Update the packages in the project
16+
echo ""
17+
echo ">>>> Get packages for " "$DIR"
18+
# Run `flutter packages get` command inside the sub-directory i.e Flutter project
19+
(cd "$DIR" && flutter packages get);
20+
echo ""
21+
echo ">>>> Done."
22+
fi
23+
done

google_signin/lib/home.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ class Home extends StatelessWidget {
1616

1717
@override
1818
Widget build(BuildContext context) {
19-
return new Scaffold(
20-
appBar: new AppBar(title: new Text("Sign In")),
21-
body: new Container(
19+
return Scaffold(
20+
appBar: AppBar(title: Text("Sign In")),
21+
body: Container(
2222
padding: const EdgeInsets.all(20.0),
23-
child: new Center(
24-
child: new Column(
23+
child: Center(
24+
child: Column(
2525
mainAxisAlignment: MainAxisAlignment.center,
2626
children: <Widget>[
2727
showLoading
28-
? new CircularProgressIndicator()
29-
: new RaisedButton(
28+
? CircularProgressIndicator()
29+
: RaisedButton(
3030
onPressed: this.onSignin,
31-
child: new Text("Sign In"),
31+
child: Text("Sign In"),
3232
color: Colors.lightBlueAccent,
3333
),
34-
//new RaisedButton(onPressed: this.onLogout, child: new Text("Logout"), color: Colors.amberAccent),
34+
//RaisedButton(onPressed: this.onLogout, child: Text("Logout"), color: Colors.amberAccent),
3535
],
3636
),
3737
)),

0 commit comments

Comments
 (0)