Skip to content

Commit cc89c1c

Browse files
authored
Migrate to flutter2 (duytq94#52)
Migrate to Flutter 2 and using Dart sound null safety Update version plugins Update code check Update some UX (image loading indicator for circle avatar, border wrap loading image indicator...)
1 parent 1c6b23a commit cc89c1c

File tree

19 files changed

+978
-983
lines changed

19 files changed

+978
-983
lines changed

.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

android/app/src/main/AndroidManifest.xml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,33 @@
55
<uses-permission android:name="android.permission.VIBRATE" />
66

77
<application
8-
android:name=".Application"
98
android:icon="@mipmap/ic_launcher"
109
android:label="flutter_chat_demo">
1110
<meta-data
1211
android:name="com.google.firebase.messaging.default_notification_icon"
1312
android:resource="@mipmap/ic_launcher" />
1413
<activity
15-
android:name="io.flutter.embedding.android.FlutterActivity"
16-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
14+
android:name=".MainActivity"
15+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1716
android:hardwareAccelerated="true"
1817
android:launchMode="singleTop"
1918
android:theme="@style/LaunchTheme"
2019
android:windowSoftInputMode="adjustResize">
21-
<!-- Specify that the launch screen should continue being displayed -->
22-
<!-- until Flutter renders its first frame. -->
23-
<meta-data
24-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
25-
android:resource="@drawable/launch_background" />
26-
27-
<!-- Theme to apply as soon as Flutter begins rendering frames -->
20+
<!-- Specifies an Android theme to apply to this Activity as soon as
21+
the Android process has started. This theme is visible to the user
22+
while the Flutter UI initializes. After that, this theme continues
23+
to determine the Window background behind the Flutter UI. -->
2824
<meta-data
2925
android:name="io.flutter.embedding.android.NormalTheme"
30-
android:resource="@style/NormalTheme"
31-
/>
32-
26+
android:resource="@style/NormalTheme" />
27+
<!-- Displays an Android View that continues showing the launch screen
28+
Drawable until Flutter paints its first frame, then this splash
29+
screen fades out. A splash screen is useful to avoid any visual
30+
gap between the end of Android's launch screen and the painting of
31+
Flutter's first frame. -->
3332
<meta-data
34-
android:name="flutterEmbedding"
35-
android:value="2" />
33+
android:name="io.flutter.embedding.android.SplashScreenDrawable"
34+
android:resource="@drawable/launch_background" />
3635

3736
<intent-filter>
3837
<action android:name="android.intent.action.MAIN" />
@@ -43,5 +42,10 @@
4342
<category android:name="android.intent.category.DEFAULT" />
4443
</intent-filter>
4544
</activity>
45+
<!-- Don't delete the meta-data below.
46+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
47+
<meta-data
48+
android:name="flutterEmbedding"
49+
android:value="2" />
4650
</application>
4751
</manifest>

android/app/src/main/java/com/dfa/flutterchatdemo/Application.java

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.dfa.flutterchatdemo;
2+
3+
import io.flutter.embedding.android.FlutterActivity;
4+
5+
public class MainActivity extends FlutterActivity {
6+
}

android/app/src/main/res/raw/keep.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources xmlns:tools="http://schemas.android.com/tools"
3+
tools:keep="@drawable/*" />

ios/Flutter/Flutter.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#
22
# NOTE: This podspec is NOT to be published. It is only used as a local source!
3+
# This is a generated file; do not edit or check into version control.
34
#
45

56
Pod::Spec.new do |s|
67
s.name = 'Flutter'
78
s.version = '1.0.0'
89
s.summary = 'High-performance, high-fidelity mobile apps.'
9-
s.description = <<-DESC
10-
Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
11-
DESC
1210
s.homepage = 'https://flutter.io'
1311
s.license = { :type => 'MIT' }
1412
s.author = { 'Flutter Dev Team' => '[email protected]' }
1513
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
1614
s.ios.deployment_target = '8.0'
17-
s.vendored_frameworks = 'Flutter.framework'
15+
# Framework linking is handled by Flutter tooling, not CocoaPods.
16+
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
17+
s.vendored_frameworks = 'path/to/nothing'
1818
end

ios/Flutter/flutter_export_environment.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
# This is a generated file; do not edit or check into version control.
33
export "FLUTTER_ROOT=/Users/lap01434/Documents/Flutter/flutter"
44
export "FLUTTER_APPLICATION_PATH=/Users/lap01434/Documents/Flutter/flutter-chat-demo"
5+
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
56
export "FLUTTER_TARGET=/Users/lap01434/Documents/Flutter/flutter-chat-demo/lib/main.dart"
67
export "FLUTTER_BUILD_DIR=build"
78
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
8-
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
9-
export "FLUTTER_FRAMEWORK_DIR=/Users/lap01434/Documents/Flutter/flutter/bin/cache/artifacts/engine/ios"
109
export "FLUTTER_BUILD_NAME=1.0.0"
1110
export "FLUTTER_BUILD_NUMBER=1"
12-
export "DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue"
11+
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
1312
export "DART_OBFUSCATION=false"
1413
export "TRACK_WIDGET_CREATION=true"
1514
export "TREE_SHAKE_ICONS=false"
16-
export "PACKAGE_CONFIG=.packages"
15+
export "PACKAGE_CONFIG=/Users/lap01434/Documents/Flutter/flutter-chat-demo/.dart_tool/package_config.json"

ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '9.0'
2+
platform :ios, '10.0'
33

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

0 commit comments

Comments
 (0)