Skip to content

Commit

Permalink
Merge pull request #103 from ayalma/dev
Browse files Browse the repository at this point in the history
Update to last flutter version and fix issues
  • Loading branch information
ayalma authored Dec 7, 2024
2 parents 7dc6026 + 471e719 commit 4c43701
Show file tree
Hide file tree
Showing 20 changed files with 88 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install Flutter
uses: subosito/flutter-action@v1
- name: Check Dart Formatting
run: flutter format --set-exit-if-changed -n .
run: dart format --set-exit-if-changed .

package-analysis:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## 0.14.2
* Updated All Dependencies versions
* Updated To Flutter version 3.24.3
# Changelog
## 0.14.1
* Updated Provider version

Expand Down
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include: package:pedantic/analysis_options.yaml
linter:
rules:
unnecessary_const: true
Expand Down
18 changes: 9 additions & 9 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,10 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
Expand All @@ -21,20 +23,18 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29
compileSdk 34

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
applicationId "com.example.example"
minSdkVersion 16
targetSdkVersion 29
minSdkVersion flutter.minSdkVersion
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
31 changes: 21 additions & 10 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,38 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:name="${applicationName}"
android:label="example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:theme="@style/NormalTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
android:windowSoftInputMode="adjustResize"
android:exported="true">

<!-- Specify that the launch screen should continue being displayed -->
<!-- until Flutter renders its first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />

<!-- Theme to apply as soon as Flutter begins rendering frames -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>


<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package com.example.example;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}

}

This file was deleted.

2 changes: 1 addition & 1 deletion example/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
Expand Down
13 changes: 1 addition & 12 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}

allprojects {
repositories {
google()
Expand All @@ -24,6 +13,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
1 change: 0 additions & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
3 changes: 1 addition & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sun Nov 03 09:46:37 IRST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
30 changes: 20 additions & 10 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.1" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

include ":app"
24 changes: 12 additions & 12 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: Text('Toggle enablePulsingAnimation',
style: Theme.of(context)
.textTheme
.button!
.labelLarge!
.copyWith(color: Colors.white)),
),
const Text(
Expand All @@ -126,7 +126,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: Text('Toggle overflowMode',
style: Theme.of(context)
.textTheme
.button!
.labelLarge!
.copyWith(color: Colors.white)),
),
for (int n = 42; n > 0; n--)
Expand Down Expand Up @@ -158,7 +158,7 @@ class _MyHomePageState extends State<MyHomePage> {
'Understood',
style: Theme.of(context)
.textTheme
.button!
.labelLarge!
.copyWith(color: Colors.white),
),
),
Expand All @@ -168,7 +168,7 @@ class _MyHomePageState extends State<MyHomePage> {
'Dismiss',
style: Theme.of(context)
.textTheme
.button!
.labelLarge!
.copyWith(color: Colors.white),
),
),
Expand Down Expand Up @@ -201,7 +201,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: Text('Add another item',
style: Theme.of(context)
.textTheme
.button!
.labelLarge!
.copyWith(color: Colors.white)),
),
for (int n = feature3ItemCount; n > 0; n--)
Expand Down Expand Up @@ -234,7 +234,7 @@ class _ContentState extends State<Content> {
ensureKey = GlobalKey<EnsureVisibleState>();
ensureKey2 = GlobalKey<EnsureVisibleState>();

WidgetsBinding.instance!.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) {
FeatureDiscovery.discoverFeatures(
context,
const <String>{
Expand Down Expand Up @@ -275,10 +275,10 @@ class _ContentState extends State<Content> {
width: double.infinity,
padding: const EdgeInsets.all(16.0),
color: Colors.blue,
child: Column(
child: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Padding(
Padding(
padding: EdgeInsets.only(bottom: 8.0),
child: Text(
'DISH REPUBLIC',
Expand All @@ -288,7 +288,7 @@ class _ContentState extends State<Content> {
),
),
),
const Text(
Text(
'Eat',
style: TextStyle(
color: Colors.white,
Expand All @@ -314,7 +314,7 @@ class _ContentState extends State<Content> {
return true;
},
onOpen: () async {
WidgetsBinding.instance!.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) {
ensureKey!.currentState!.ensureVisible(
preciseAlignment: 0.5,
duration: const Duration(milliseconds: 400),
Expand Down Expand Up @@ -364,7 +364,7 @@ class _ContentState extends State<Content> {
return true;
},
onOpen: () async {
WidgetsBinding.instance!.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) {
ensureKey2!.currentState!.ensureVisible(
duration: const Duration(milliseconds: 600));
});
Expand All @@ -380,7 +380,7 @@ class _ContentState extends State<Content> {
child: Text('Add item',
style: Theme.of(context)
.textTheme
.button!
.labelLarge!
.copyWith(color: Colors.white)),
),
for (int n = feature6ItemCount; n > 0; n--)
Expand Down
7 changes: 2 additions & 5 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,19 @@ description: A new Flutter project.
version: 1.0.0+1

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=3.3.0-0 <4.0.0'

publish_to: none

dependencies:
flutter:
sdk: flutter

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
feature_discovery:
path: ../

dev_dependencies:
pedantic: any
lints: any

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
Expand Down
2 changes: 1 addition & 1 deletion lib/src/rendering/proxy_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class RenderClipContent extends RenderProxyBox {
RenderClipContent({
required Offset center,
required double radius,
}) : _center = center,
}) : _center = center,
_radius = radius;

/// The inner area of the DescribedFeatureOverlay.
Expand Down
5 changes: 2 additions & 3 deletions lib/src/widgets/content.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:feature_discovery/src/rendering.dart';
import 'package:feature_discovery/src/widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class Content extends StatelessWidget {
final FeatureOverlayState state;
Expand Down Expand Up @@ -72,7 +71,7 @@ class Content extends StatelessWidget {
DefaultTextStyle(
style: Theme.of(context)
.textTheme
.headline6!
.titleLarge!
.copyWith(color: textColor),
child: title!,
),
Expand All @@ -82,7 +81,7 @@ class Content extends StatelessWidget {
DefaultTextStyle(
style: Theme.of(context)
.textTheme
.bodyText2!
.bodyMedium!
.copyWith(color: textColor.withOpacity(0.9)),
child: description!,
)
Expand Down
Loading

0 comments on commit 4c43701

Please sign in to comment.