Skip to content

Commit 65d7ca6

Browse files
author
Wilberforce Uwadiegwu
authored
Merge pull request wilburx9#133 from wilburt/v1.0.6
Support for Flutter 3 and UI bug fixes
2 parents eb26f24 + 276815e commit 65d7ca6

37 files changed

+119
-163
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.0.6
2+
* Completed migration for Android v2 embedding.
3+
* Fixed colour issues in dark mode
4+
* Upgrades Kotlin and AGP versions.
5+
* Fixed build issues for Flutter 3
6+
17
## 1.0.5+1
28
* Updated dependencies
39
* Updated ReadMe

android/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ group 'co.paystack.flutterpaystack'
22
version '1.0-SNAPSHOT'
33

44
buildscript {
5-
ext.kotlin_version = '1.4.31'
5+
ext.kotlin_version = '1.7.10'
66
repositories {
7+
mavenCentral()
78
google()
8-
jcenter()
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:4.1.2'
12+
classpath 'com.android.tools.build:gradle:4.1.3'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
1515
}
1616

1717
rootProject.allprojects {
1818
repositories {
19+
mavenCentral()
1920
google()
20-
jcenter()
2121
}
2222
}
2323

@@ -42,6 +42,5 @@ android {
4242
}
4343

4444
dependencies {
45-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
46-
implementation 'com.google.android.material:material:1.4.0-alpha01'
45+
implementation 'com.google.android.material:material:1.8.0-alpha01'
4746
}

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-5.4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip

android/src/main/kotlin/co/paystack/flutterpaystack/FlutterPaystackPlugin.kt

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import io.flutter.embedding.engine.plugins.FlutterPlugin
55
import io.flutter.embedding.engine.plugins.activity.ActivityAware
66
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
77
import io.flutter.plugin.common.BinaryMessenger
8-
import io.flutter.plugin.common.PluginRegistry
98

109

1110
class FlutterPaystackPlugin : FlutterPlugin, ActivityAware {
@@ -21,7 +20,7 @@ class FlutterPaystackPlugin : FlutterPlugin, ActivityAware {
2120
pluginBinding = null
2221
}
2322

24-
private fun setupMethodHandler(messenger: BinaryMessenger?, activity: Activity) {
23+
private fun setupMethodHandler(messenger: BinaryMessenger, activity: Activity) {
2524
methodCallHandler = MethodCallHandlerImpl(messenger, activity)
2625
}
2726

@@ -33,20 +32,11 @@ class FlutterPaystackPlugin : FlutterPlugin, ActivityAware {
3332

3433

3534
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
36-
setupMethodHandler(pluginBinding?.binaryMessenger, binding.activity)
35+
pluginBinding?.let { setupMethodHandler(it.binaryMessenger, binding.activity) }
3736
}
3837

3938
override fun onDetachedFromActivityForConfigChanges() = onDetachedFromActivity()
4039

41-
override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) = onAttachedToActivity(binding)
42-
43-
companion object {
44-
45-
@JvmStatic
46-
fun registerWith(registrar: PluginRegistry.Registrar) {
47-
val plugin = FlutterPaystackPlugin()
48-
plugin.setupMethodHandler(registrar.messenger(), registrar.activity())
49-
}
50-
}
51-
40+
override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) =
41+
onAttachedToActivity(binding)
5242
}

android/src/main/kotlin/co/paystack/flutterpaystack/MethodCallHandlerImpl.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ package co.paystack.flutterpaystack
22

33
import android.annotation.SuppressLint
44
import android.app.Activity
5-
import android.os.Build
65
import android.provider.Settings
76
import io.flutter.plugin.common.BinaryMessenger
87
import io.flutter.plugin.common.MethodCall
98
import io.flutter.plugin.common.MethodChannel
109
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
1110

12-
class MethodCallHandlerImpl(messenger: BinaryMessenger?, private val activity: Activity?) : MethodCallHandler {
11+
class MethodCallHandlerImpl(messenger: BinaryMessenger, private val activity: Activity?) : MethodCallHandler {
1312
private var channel: MethodChannel? = null
1413
private var authDelegate: AuthDelegate? = null
1514

example/android/app/build.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ apply plugin: 'kotlin-android'
1616
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
1717

1818
android {
19-
compileSdkVersion 28
19+
compileSdkVersion 32
2020

2121
sourceSets {
2222
main.java.srcDirs += 'src/main/kotlin'
@@ -29,7 +29,7 @@ android {
2929
defaultConfig {
3030
applicationId "co.paystack.flutterpaystack"
3131
minSdkVersion 16
32-
targetSdkVersion 29
32+
targetSdkVersion 32
3333
versionCode 1
3434
versionName "1.0"
3535
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -44,8 +44,4 @@ android {
4444

4545
flutter {
4646
source '../..'
47-
}
48-
49-
dependencies {
50-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
51-
}
47+
}

example/android/app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="co.paystack.flutterpaystackexample">
33

4-
<!-- The INTERNET permission is required for development. Specifically,
5-
flutter needs it to communicate with the running application
6-
to allow setting breakpoints, to provide hot reload, etc.
7-
-->
84
<uses-permission android:name="android.permission.INTERNET" />
9-
10-
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
11-
calls FlutterMain.startInitialization(this); in its onCreate method.
12-
In most cases you can leave this as-is, but you if you want to provide
13-
additional functionality it is fine to subclass or reimplement
14-
FlutterApplication and put your custom class here. -->
155
<application
16-
android:name="io.flutter.app.FlutterApplication"
6+
android:name="${applicationName}"
177
android:icon="@mipmap/ic_launcher"
188
android:label="Flutter Paystack">
199
<activity
@@ -22,14 +12,12 @@
2212
android:hardwareAccelerated="true"
2313
android:launchMode="singleTop"
2414
android:theme="@style/LaunchTheme"
15+
android:exported="true"
2516
android:windowSoftInputMode="adjustResize">
26-
<!-- This keeps the window background of the activity showing
27-
until Flutter renders its first frame. It can be removed if
28-
there is no splash screen (such as the default splash screen
29-
defined in @style/LaunchTheme). -->
3017
<meta-data
31-
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
32-
android:value="true" />
18+
android:name="io.flutter.embedding.android.NormalTheme"
19+
android:resource="@style/NormalTheme" />
20+
3321
<intent-filter>
3422
<action android:name="android.intent.action.MAIN" />
3523
<category android:name="android.intent.category.LAUNCHER" />
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- Modify this file to customize your launch splash screen -->
32
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
43
<item android:drawable="@android:color/white" />
5-
6-
<!-- You can insert your own image assets here -->
7-
<!-- <item>
8-
<bitmap
9-
android:gravity="center"
10-
android:src="@mipmap/launch_image" />
11-
</item> -->
124
</layer-list>
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3+
34
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
4-
<!-- Show a splash screen on the activity. Automatically removed when
5-
Flutter draws its first frame -->
5+
<item name="android:windowBackground">@drawable/launch_background</item>
6+
</style>
7+
8+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
69
<item name="android:windowBackground">@drawable/launch_background</item>
710
</style>
811
</resources>

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.4.31'
2+
ext.kotlin_version = '1.7.10'
33
repositories {
44
google()
55
jcenter()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.2'
9+
classpath 'com.android.tools.build:gradle:7.2.2'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}

example/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-6.5-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>8.0</string>
24+
<string>11.0</string>
2525
</dict>
2626
</plist>

example/ios/Flutter/Flutter.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
Pod::Spec.new do |s|
77
s.name = 'Flutter'
88
s.version = '1.0.0'
9-
s.summary = 'High-performance, high-fidelity mobile apps.'
10-
s.homepage = 'https://flutter.io'
11-
s.license = { :type => 'MIT' }
9+
s.summary = 'A UI toolkit for beautiful and fast apps.'
10+
s.homepage = 'https://flutter.dev'
11+
s.license = { :type => 'BSD' }
1212
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
1313
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
14-
s.ios.deployment_target = '8.0'
14+
s.ios.deployment_target = '11.0'
1515
# Framework linking is handled by Flutter tooling, not CocoaPods.
1616
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
1717
s.vendored_frameworks = 'path/to/nothing'

example/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, '11.0'
33

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

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -163,7 +163,7 @@
163163
97C146E61CF9000F007C117D /* Project object */ = {
164164
isa = PBXProject;
165165
attributes = {
166-
LastUpgradeCheck = 1010;
166+
LastUpgradeCheck = 1300;
167167
ORGANIZATIONNAME = "The Chromium Authors";
168168
TargetAttributes = {
169169
97C146ED1CF9000F007C117D = {
@@ -339,7 +339,7 @@
339339
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
340340
GCC_WARN_UNUSED_FUNCTION = YES;
341341
GCC_WARN_UNUSED_VARIABLE = YES;
342-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
342+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
343343
MTL_ENABLE_DEBUG_INFO = YES;
344344
ONLY_ACTIVE_ARCH = YES;
345345
SDKROOT = iphoneos;
@@ -388,7 +388,7 @@
388388
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
389389
GCC_WARN_UNUSED_FUNCTION = YES;
390390
GCC_WARN_UNUSED_VARIABLE = YES;
391-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
391+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
392392
MTL_ENABLE_DEBUG_INFO = NO;
393393
SDKROOT = iphoneos;
394394
TARGETED_DEVICE_FAMILY = "1,2";

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1010"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@
4646
</array>
4747
<key>UIViewControllerBasedStatusBarAppearance</key>
4848
<false/>
49+
<key>CADisableMinimumFrameDurationOnPhone</key>
50+
<true/>
4951
</dict>
5052
</plist>

example/lib/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class MyApp extends StatelessWidget {
2525
Widget build(BuildContext context) {
2626
return new MaterialApp(
2727
title: appName,
28+
darkTheme: ThemeData.dark(),
2829
home: new HomePage(),
2930
);
3031
}
@@ -149,7 +150,9 @@ class _HomePageState extends State<HomePage> {
149150
_verticalSizeBox,
150151
Theme(
151152
data: Theme.of(context).copyWith(
152-
accentColor: green,
153+
colorScheme: Theme.of(context)
154+
.colorScheme
155+
.copyWith(secondary: green),
153156
primaryColorLight: Colors.white,
154157
primaryColorDark: navyBlue,
155158
textTheme: Theme.of(context).textTheme.copyWith(

example/test/widget_test.dart

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/src/widgets/birthday_widget.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
44
import 'package:flutter/cupertino.dart';
55
import 'package:flutter_paystack/src/widgets/base_widget.dart';
66
import 'package:flutter_paystack/src/widgets/buttons.dart';
7+
import 'package:flutter_paystack/src/widgets/common/extensions.dart';
78
import 'package:flutter_paystack/src/widgets/custom_dialog.dart';
89
import 'package:intl/intl.dart';
910

@@ -42,9 +43,9 @@ class _BirthdayWidgetState extends BaseState<BirthdayWidget> {
4243
new Text(
4344
widget.message,
4445
textAlign: TextAlign.center,
45-
style: const TextStyle(
46+
style: TextStyle(
4647
fontWeight: FontWeight.w500,
47-
color: Colors.black87,
48+
color: context.textTheme().headline6?.color,
4849
fontSize: 15.0,
4950
),
5051
),

0 commit comments

Comments
 (0)