Giter Club home page Giter Club logo

flutter_native_splash's People

Contributors

adeeteya avatar almighty-alpaca avatar alpavlove avatar aryansethi avatar bungeefan avatar bwolfs2 avatar faiizii avatar hallot avatar henriquearthur avatar ikoamu avatar itsahmed-dev avatar j-j-gajjar avatar jcquintas avatar jonbhanson avatar lsaudon avatar lucalves avatar lyledean1 avatar lzyct avatar m123-dev avatar mihiron avatar milindgoel15 avatar mirland avatar nohli avatar outdatedguy avatar tarasbounty avatar tenhobi avatar vkammerer avatar vlazdra avatar wemersonrv avatar yda93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_native_splash's Issues

Support for Light and Dark Splash Screen

So In android is very easy to implement a Dark Splash Screen for devices with Android 9 or 10, because the sistem recognize a values-night folder inside the res folder.

In the image below I don't use the launch_background_night.xml and splash_night.png files, because my image looks fine in light and dark background, so in this case the values-night/styles.xmland values/styles.xml call the same file in android:windowBackground.

But if had a dark logo and light logo, I need to call to launch_background.xml and launch_background_night.xml respectively and these need to call to splash.png and splash-night.png respectively.

I don't know much about this process on ios, but I know that you need Xcode 10(or 10.2) to set a Dark and Light Splash Screen.

image

Splash Screen image is always stretched out

The Splash Screen image is always stretched out no matter what resolution I use, Even using the image in the example I still get the same result:
https://ibb.co/3yQv9SJ

My config:
flutter_native_splash: image: assets/images/splash.png color: "#42a5f5"

Thank you in advance for your help

Splash screen not applied

I'm trying to use this beautiful package to avoid every time to do always the same procedures to apply native splash screen.
For an unknow reason in a about 6 month old app I'm not able to keep it working. Splash screen is not applied. All the files are correctly generated but it does not work.
My app use java and ObjectiveC.
I cannot share the project because it is proprietary.

This is the package output (seems all ok):

PS C:\Projects\FCSSystem\mes-mobile-flutter> flutter pub pub run flutter_native_splash:create
[Android] Creating splash images
[Android] Updating launch_background.xml with splash image path
[Android] No colors.xml file found in your Android project
[Android] Creating colors.xml file and adding it to your Android project
[Android] Updating styles.xml with full screen mode setting
[iOS] Creating splash images
[iOS] Updating LaunchScreen.storyboard with width, height and color
[iOS] Updating Info.plist for status bar hidden/visible

and these are the files changes
image

MainActivity.java

package com.fcssystem.mes_mobile_flutter;

import android.os.Bundle;
import io.flutter.app.FlutterFragmentActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;

import android.os.Build;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
public class MainActivity extends FlutterFragmentActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    boolean flutter_native_splash = true;
    int originalStatusBarColor = 0;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        originalStatusBarColor = getWindow().getStatusBarColor();
        getWindow().setStatusBarColor(0xff2d98e7);
    }
    int originalStatusBarColorFinal = originalStatusBarColor;

    GeneratedPluginRegistrant.registerWith(this);
    ViewTreeObserver vto = getFlutterView().getViewTreeObserver();
    vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
      @Override
      public void onGlobalLayout() {
        getFlutterView().getViewTreeObserver().removeOnGlobalLayoutListener(this);
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
          getWindow().setStatusBarColor(originalStatusBarColorFinal);
        }
      }
    });

  }
}

launch_background.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/splash_color" />

    <!-- You can insert your own image assets here -->
    <!-- <item>
        <bitmap
            android:gravity="center"
            android:src="@mipmap/launch_image" />
    </item> -->
    <item>
        <bitmap android:gravity="fill" android:src="@drawable/splash" />
    </item>

</layer-list>

colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="splash_color">#42a5f5</color>
</resources>

styles.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="LaunchTheme" 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>
        <item name="android:windowFullscreen">true</item>

    </style>
</resources>

(If I try with a new app the package works perfectly. )

AlertDialog hidden by keyboard after adding flutter_native_splash: ^0.1.9

I know this issue so strange but it's happen to me, I don't know why after adding this package if i showing Alert Dialog , My dialog hidden by keyboard .
After running this command flutter pub pub run flutter_native_splash:create and running the app.

Using Flutter native splash Packages

alertdialog hidden by keyboard because using flutter native splash package

Source Code

import 'package:flutter/material.dart';

void main() {
  // WidgetsFlutterBinding.ensureInitialized();
  return runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(title: "Mateiral App", home: TestingPage());
  }
}

class TestingPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: FlatButton(
          color: Colors.red,
          onPressed: () => showDialog(
            context: context,
            builder: (ctxDialog) => SimpleDialog(),
          ),
          child: Text('Show Dialog'),
        ),
      ),
    );
  }
}

class SimpleDialog extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      title: Text('Testing DIALOG'),
      content: TextFormField(
        decoration: InputDecoration(
          border: OutlineInputBorder(borderRadius: BorderRadius.circular(30)),
        ),
      ),
      actions: <Widget>[
        FlatButton.icon(
            onPressed: () => "", icon: Icon(Icons.add), label: Text('ttest')),
        FlatButton.icon(
            onPressed: () => "", icon: Icon(Icons.add), label: Text('ttest')),
      ],
    );
  }
}

Pubspec.yaml

name: flutter_native_splash_bug
description: A new Flutter application.
version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_native_splash: ^0.1.9
  flutter_launcher_icons: ^0.7.4

flutter_native_splash:
  image: assets/1.png
  color: "42a5f5"

flutter_icons:
  android: true
  ios: true
  image_path: "assets/1.png"
flutter:
  uses-material-design: true

Without Flutter Native Splash

alertdialog without flutter native splash

Source Code

import 'package:flutter/material.dart';

void main() {
  // WidgetsFlutterBinding.ensureInitialized();
  return runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(title: "Mateiral App", home: TestingPage());
  }
}

class TestingPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: FlatButton(
          color: Colors.red,
          onPressed: () => showDialog(
            context: context,
            builder: (ctxDialog) => SimpleDialog(),
          ),
          child: Text('Show Dialog'),
        ),
      ),
    );
  }
}

class SimpleDialog extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      title: Text('Testing DIALOG'),
      content: TextFormField(
        decoration: InputDecoration(
          border: OutlineInputBorder(borderRadius: BorderRadius.circular(30)),
        ),
      ),
      actions: <Widget>[
        FlatButton.icon(
            onPressed: () => "", icon: Icon(Icons.add), label: Text('ttest')),
        FlatButton.icon(
            onPressed: () => "", icon: Icon(Icons.add), label: Text('ttest')),
      ],
    );
  }
}

Pubspec.yaml

name: without_flutter_native_splash
description: A new Flutter application.

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: ^0.7.4

flutter_icons:
  android: true
  ios: true
  image_path: "assets/1.png"
flutter:
  uses-material-design: true

Add support for smaller images (icons)

When you use fluter_native_splash, image covers the whole width of a screen. But what if this is just an icon and you want to make it smaller than screen size (as the icon usually is)?

CantFindMainActivityPath Error on run create

I use flutter 1.9.1 added the package to pubspec dependencies (flutter_native_splash 0.1.9) and create the entry

flutter_native_splash:
image: assets/images/launcher_icon.jpg
color: "42a5f5"
fill: true

If i run the the statement the error appear. If I try a new projekt it work, but if i try my old projekt the error appear. I only added some permissions to the androidManifest file. Can you please give me more infos what the exact problem is with this error?

Unhandled exception:
*** ERROR [flutter_native_splash] ***
CantFindMainActivityPath
Not able to determinate MainActivity path. Maybe the problem is your package path OR your AndroidManifest.xml 'package' attribute on manifest.
#0      _javaOrKotlin (package:flutter_native_splash/android.dart:335:5)
<asynchronous suspension>
#1      _applyMainActivityUpdate (package:flutter_native_splash/android.dart:308:33)
<asynchronous suspension>
#2      createSplash (package:flutter_native_splash/android.dart:42:9)
<asynchronous suspension>
#3      createSplash (package:flutter_native_splash/flutter_native_splash.dart:20:11)
<asynchronous suspension>
#4      main (file:///Users/bastiangobet/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-0.1.9/bin/create.dart:5:3)
#5      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)
#6      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
pub finished with exit code 255

Image size too big: add position and size settings

Thank you for making this plugin, It fills a void quite nicely! However, using the plugin, my launch image far exceeds the width (and height is huge too) of my devices. Is there a feature I missed to contain the image or pre-size the image so that it's 100% within the boundaries of the width (with some padding). Also, it would be great if we could specify image top center, or center center. For my use anyway.

my app become in fullscreen

Hello
First thanks for this awesome pub <3 but im facing a little problem here after using this pub , all my app become in full screen , is there any solution ?

flutter_native_splash: image: assets/images/splash.png color: "ffffff" fill: false android_disable_fullscreen: true ios_disable_fullscreen: true

Crash on API < 21 setStatusBarColor method not found

How to reproduce

  1. Run flutter native splash
  2. Start the app on an emulator with API < 21

The method android.view.Window.setStatusBarColor was introduced on API 21

[   +8 ms] E/AndroidRuntime( 1476): FATAL EXCEPTION: main
[        ] E/AndroidRuntime( 1476): java.lang.NoSuchMethodError: android.view.Window.setStatusBarColor
[        ] E/AndroidRuntime( 1476):     at com.example.tabela_fipe.MainActivity.onCreate(MainActivity.java:15)
[        ] E/AndroidRuntime( 1476):     at android.app.Activity.performCreate(Activity.java:5008)
[        ] E/AndroidRuntime( 1476):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
[        ] E/AndroidRuntime( 1476):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
[        ] E/AndroidRuntime( 1476):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
[        ] E/AndroidRuntime( 1476):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
[        ] E/AndroidRuntime( 1476):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
[        ] E/AndroidRuntime( 1476):     at android.os.Handler.dispatchMessage(Handler.java:99)
[        ] E/AndroidRuntime( 1476):     at android.os.Looper.loop(Looper.java:137)
[        ] E/AndroidRuntime( 1476):     at android.app.ActivityThread.main(ActivityThread.java:4745)
[        ] E/AndroidRuntime( 1476):     at java.lang.reflect.Method.invokeNative(Native Method)
[        ] E/AndroidRuntime( 1476):     at java.lang.reflect.Method.invoke(Method.java:511)
[        ] E/AndroidRuntime( 1476):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
[        ] E/AndroidRuntime( 1476):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
[        ] E/AndroidRuntime( 1476):     at dalvik.system.NativeStart.main(Native Method)

ERROR on creation

I don't know what your error codes mean

but after running what's indicated in the tutorial I get these errors
NOTE: that for some reason the splash screen still works on my Samsung Galaxy S10

flutter pub get
flutter pub pub run flutter_native_splash:create
[Android] Creating splash images
[Android] Updating launch_background.xml with splash image path
[Android] Updating colors.xml with color for splash screen background
[Android] Updating styles.xml with full screen mode setting
Unhandled exception:
FormatException: Invalid radix-10 number (at character 1)
20 //OLD 16
^

#0      int._throwFormatException (dart:core-patch/integers_patch.dart:131:5)
#1      int._parseRadix (dart:core-patch/integers_patch.dart:142:16)
#2      int._parse (dart:core-patch/integers_patch.dart:100:12)
#3      int.parse (dart:core-patch/integers_patch.dart:63:12)
#4      _supportStatusBarCode (package:flutter_native_splash/android.dart:469:15)
<asynchronous suspension>
#5      _addMainActivitySplashLines (package:flutter_native_splash/android.dart:399:39)
<asynchronous suspension>
#6      _applyMainActivityUpdate (package:flutter_native_splash/android.dart:278:11)
<asynchronous suspension>
#7      createSplash (package:flutter_native_splash/android.dart:33:9)
<asynchronous suspension>
#8      createSplash (package:flutter_native_splash/flutter_native_splash.dart:18:11)
<asynchronous suspension>
#9      main (file:///E:/CinE/Users/bryan/SOFTWARE/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-0.1.7+1/bin/create.dart:5:3)
#10     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#11     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
pub finished with exit code 255

androidMainActivityKotlinLines2WithStatusBar et al not applied in MainActivity.kt

The default MainActivity created by flutter create splash_test looks like this:

package com.example.splash_test

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterActivity() {
    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);
    }
}

The Kotlin reference line to include the code that shows the status bar after is was hidden for the splash screen expects the non-existant line super.onCreate(savedInstanceState)'.

Image stretched and status bar is hidden.

I use this package in an old project and it worked totally fine. But not working in a newly generated project, I didn't get any error and both projects are in Android X. The bug is showing in both emulators and physical device. I did add fill: true

Screenshot_20191228-183713
Screenshot_20191228-183717

[iOS] Status bar doesn't hide in landscape

This only happens on a physical devices.

I created a new flutter project and after installing this package the status bar doesn't hide in landscape mode.

In portrait the status bar appears (like it should).

Fails with new Flutter embedding system for v2 Android Embedding

With the latest update to Flutter (I am on 1.13.2) a new v2 of the Android embedding API was introduced.

Running:

flutter create --template app --description "Fluttering" --ios-language "swift" --android-language "kotlin" --org "xyz.flutter" app

Generates new an Android project with some subtle differences:

AndroidManiest.xml with

     <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />

MainActivity.kt with no onCreate and a new method:

    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);
    }

Adding

dev_dependencies:
  flutter_native_splash: 0.1.9

flutter_native_splash:
  image: assets/splash.png
  color: ffcc11
  fill: true

and then executing:

flutter pub pub run flutter_native_splash:create

updates the drawables/* and colors.xml, but fails to with MainActivity.kt
Sometimes you see the splash for a flicker of a second, followed by a black screen before the Flutter content shows

Conditional Splash Screen

Hey, since yaml files does'nt support if condition. How can I implement conditional splash screen to my app ? For example I want to display color on intro screen when application first run. Then I want to display image as splash screen.

Make image parameter optional

I only need to make native splash with color (without image):

flutter_native_splash:
  color: ffffff

But receive this error:

*** ERROR [flutter_native_splash] ***
InvalidConfigException
Your `flutter_native_splash` section does not contain a `image`.

I don't see any reason to require image in native splash - it could be optional. Could you fix it? Thanks.

Dark mode support

It would be great to be able to use different images and background colors based on whether the user enabled dark mode.

Support 'fill' property on iOS

Currently fill property for using an image on full screen only works in Android, we need to implement the functionality on iOS.

iOS @2x image wrong size

@2x images are currently being generated at 1.5x, due to the divider of '2' specified in lib/ios.dart.

Source width: 750
Generated:

  • 750
  • 375 (should be 500)
  • 250

The source image is 3x, so 2x requires a divider of 1.5, not 2

Creation fails due to code which is written multiple times in MainActivity.kt

Some initialization of variables are added even though they exist already.
Even if I delete those lines and resolve the build errors, the image appears too big on my emulator. Even after a clean and rebuild.

e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (8, 19): Conflicting import, imported name 'Build' is ambiguous
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (9, 21): Conflicting import, imported name 'ViewTreeObserver' is ambiguous
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (10, 21): Conflicting import, imported name 'WindowManager' is ambiguous
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (12, 19): Conflicting import, imported name 'Build' is ambiguous
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (13, 21): Conflicting import, imported name 'ViewTreeObserver' is ambiguous
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (14, 21): Conflicting import, imported name 'WindowManager' is ambiguous
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (19, 9): Conflicting declarations: val flutter_native_splash: Boolean, val flutter_native_splash: Boolean
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (20, 9): Conflicting declarations: var originalStatusBarColor: Int, var originalStatusBarColor: Int
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (25, 9): Conflicting declarations: val originalStatusBarColorFinal: Int, val originalStatusBarColorFinal: Int
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (27, 9): Conflicting declarations: val flutter_native_splash: Boolean, val flutter_native_splash: Boolean
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (28, 9): Conflicting declarations: var originalStatusBarColor: Int, var originalStatusBarColor: Int
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (33, 9): Conflicting declarations: val originalStatusBarColorFinal: Int, val originalStatusBarColorFinal: Int
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (36, 9): Conflicting declarations: val vto: ViewTreeObserver!, val vto: ViewTreeObserver!
e: C:\Users\Gaming PC\Desktop\LinkYouProjectfiles\LinkYou\android\app\src\main\kotlin\de\linkyouapp\linkyou\MainActivity.kt: (47, 9): Conflicting declarations: val vto: ViewTreeObserver!, val vto: ViewTreeObserver!

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.

Compilation error. See log for more details

Multiple UIStatusBarHidden keys added to Info.plist

Just tried out this package and noticed that after running it, I have 3 of the following entries in my Info.plist file:

<key>UIStatusBarHidden</key>
<true/>

The package seems to be adding one of these entries to every <dict> element it finds, instead of just the top-level <dict>. My Info.plist has a few <key> entries with values that are <dict> elements, so duplicates were created.

Is there a way to uninstall the splash

Is there a way to un-modify launch_background.xml, styles.xml and MainActivity files on Android and LaunchScreen.storyboard, Info.plist, and AppDelegate on iOS.

Strange error 'Uint32' not found

Strange Error when doing flutter pub pub run flutter_native_splash:create
I suspect is it because the dependancies in pub.flutter-io.cn are not updated?

Failed to precompile flutter_native_splash:create:
/Users/ZK/.pub-cache/hosted/pub.flutter-io.cn/image-2.1.4/lib/src/image.dart:534:31: Error: Type 'Uint32' not found.
void setPixel(int x, int y, Uint32 color) {
^^^^^^
/Users/ZK/.pub-cache/hosted/pub.flutter-io.cn/image-2.1.4/lib/src/image.dart:534:31: Error: 'Uint32' isn't a type.
void setPixel(int x, int y, Uint32 color) {
^^^^^^
pub finished with exit code 1

Here is my Flutter Doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v1.10.14, on Mac OS X 10.14.6 18G95, locale en-US)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.39.2)
[✓] Connected device (3 available)

• No issues found!

Missing imports from MainActivity

I did all the steps from the wee tutorial on pub.dev / readme.md but I got some big complaints from gradle (building for android obviously) that stopped the build. A tiny amount of googling later and I had to add two imports to MainActivity:

import android.view.ViewTreeObserver;
import android.view.WindowManager;

Shouldn't this have happened automatically? Is this some unique aspect of my build? I am doing some MultiDex shenanigans so I don't know if that has affected it. Sorry this bug report is absolute grabage in terms of detail, but I thought you should know.

Error when generation iOS splash screen

First, I want to say this package is great. Super useful and I love it!

About the error, it seems that my project doesn't have the AppDelegate.m file, instead I have AppDelegate.swift, since I'm using Swift instead of Objective-C.

Here is the output:

> flutter pub pub run flutter_native_splash:create
[Android] Creating splash images
[Android] Updating launch_background.xml with splash image path
[iOS] Creating splash images
[iOS] Updating LaunchScreen.storyboard with width, height and color
[Android] No colors.xml file found in your Android project
[Android] Creating colors.xml file and adding it to your Android project
[Android] Updating styles.xml with full screen mode setting
[iOS] Updating Info.plist and AppDelegate.m for status bar hidden/visible
Unhandled exception:
FileSystemException: Cannot open file, path = 'ios/Runner/AppDelegate.m' (OS Error: No such file or directory, errno = 2)
#0      _File.open.<anonymous closure> (dart:io/file_impl.dart:364:9)
#1      _RootZone.runUnary (dart:async/zone.dart:1379:54)
#2      _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#4      Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#5      Future._completeWithValue (dart:async/future_impl.dart:483:5)
#6      Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:513:7)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#9      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#10     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
pub finished with exit code 255

feature request: splash duration

Olá de novo, Henrique,

How are things?

On the app i'm working on right now the splash works fine and then it disappears and there's still a 3-4 second gap between the end of the splash and when my first page loads. I tried it on a generic app, one that doesn't have a lot of info on the 1st page, and the delay between the splash and the home page is only 1-2 seconds. My app seems to be taking longer to load and so I would like to be able to draw out the splash longer in time.

I wonder if it would be possible to increase the duration of the splash screen manually? Maybe using milliseconds? Something like:

flutter_native_splash:
    image: assets/splash.png
    color: "#000000"
    duration: 5000

I'mi hoping that this would make the app start directly after the splash disappears. There may be other technical reasons why this might now work but it might work for some programmers and apps.

Just wondering, Henrique. Anyway, glad to see you're up to 79% on pub.dev as you were only 50% a few days ago. Pretty cool.

Ciao,

lubi

Error in handling field overlay with the keyboard

This library stops the application from focusing on the fields if the keyboard overlaps it.

I did the test in several applications, several functional sources lost this functionality after including the flutter_native_splash.

Instagram-like layout

Hi, how can I accomplish an Instagram-like splash screen, which has two images, one at the bottom and one somewhere in center/top part?

image

Error when generation Android splash screen with MainActivity.kt

[Android] Creating splash images
[Android] Updating launch_background.xml with splash image path
[iOS] Creating splash images
[iOS] Updating LaunchScreen.storyboard with width, height and color
[Android] No colors.xml file found in your Android project
[Android] Creating colors.xml file and adding it to your Android project
[Android] Updating styles.xml with full screen mode setting
Unhandled exception:
FileSystemException: Cannot open file, path = 'android/app/src/main/java/com/example/MainActivity.java' (OS Error: System nie może odnaleźć określonej ścieżki.
, errno = 3)
#0      _File.open.<anonymous closure> (dart:io/file_impl.dart:364:9)
#1      _RootZone.runUnary (dart:async/zone.dart:1379:54)
#2      _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#4      Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#5      Future._completeWithValue (dart:async/future_impl.dart:483:5)
#6      Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:513:7)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#9      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#10     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
pub finished with exit code 255

pub finished with exit code 255 in version 0.1.8+2

Hello, i've followed the guide and i met this problem !!
tried many different versions and the same problem too

flutter pub pub run flutter_native_splash:create [Android] Creating splash images [Android] Updating launch_background.xml with splash image path [Android] Updating colors.xml with color for splash screen background [Android] Updating styles.xml with full screen mode setting Unhandled exception: *** ERROR [flutter_native_splash] *** CantFindMainActivityPath Not able to determinate MainActivity path. Maybe the problem is your package path OR your AndroidManifest.xml 'package' attribute on manifest. #0 _javaOrKotlin (package:flutter_native_splash/android.dart:315:5) <asynchronous suspension> #1 _applyMainActivityUpdate (package:flutter_native_splash/android.dart:288:33) <asynchronous suspension> #2 createSplash (package:flutter_native_splash/android.dart:39:9) <asynchronous suspension> #3 createSplash (package:flutter_native_splash/flutter_native_splash.dart:20:11) <asynchronous suspension> #4 main (file:///C:/Users/midos/AppData/Local/flutter/.pub-cache/bin/hosted/pub.dartlang.org/flutter_native_splash-0.1.8+2/bin/create.dart:5:3) #5 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32) #6 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12) pub finished with exit code 255

pub finished with exit code 255

Hi,

Just saw your link on reddit and wanted to give it a try.

Here's the error code:
flutter pub pub run flutter_native_splash:create [Android] Creating splash images [Android] Updating launch_background.xml with splash image path [iOS] Creating splash images [iOS] Updating LaunchScreen.storyboard with width, height and color Unhandled exception: RangeError: Invalid value: Only valid value is 0: -1 #0 List.insert (dart:core-patch/growable_array.dart:11:7) #1 _updateLaunchBackgroundFileWithImagePath (package:flutter_native_splash/android.dart:104:11) <asynchronous suspension> #2 _applyLaunchBackgroundXml (package:flutter_native_splash/android.dart:77:12) #3 createSplash (package:flutter_native_splash/android.dart:26:9) <asynchronous suspension> #4 createSplash (package:flutter_native_splash/flutter_native_splash.dart:18:5) #5 main (file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-0.1.4/bin/create.dart:5:3) #6 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32) #7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12) pub finished with exit code 255

Is it possible to add web support?

Every time I load my flutter web website, it shows a blank page for a few seconds until the dart code runs, any possibility for an animation?

Add more informations to README

It would be awesome if the README would provide more information about possible inputs.

For example, it is not clear what fill means and how it is different from android_disable_fullscreen.

Also, if the fill is used, it seems (Android) that it switches the whole app to full screen. (<item name="android:windowFullscreen">true</item>), not only the splash screen. Is this desired?

support fit image as splash

on iOS native development I usually use a single square image that fit (cropped) the device screen, like this one. as this it works on every device in every orientation
splash

iOS - White screen before splash screen

Hi, thanks for the wonderful package. It saved me a lot of time. I have a small issue with the iOS splash screen. It works fine, but there's a white screen right before the splash screen that I specified. Have you seen this before or would you know of a way to get rid of that initial white screen? Thanks

  • Edit: device is iPhone 6

CantFindMainActivityPath

Not able to determinate MainActivity path. Maybe the problem is your package path OR your AndroidManifest.xml 'package' attribute on manifest.

android\app\src\main\kotlin\drodriguez\apps\Words\party_words\MainActivity.kt:

package drodriguez.apps.Words

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterActivity() {
    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);
    }
}

error 255 when 'black' #000000 background tried. all other colours including white #ffffff fine.

Hi again, @henriquearthur ,

I tried a black background and got this error.

flutter pub pub run flutter_native_splash:create
Unhandled exception:
type 'int' is not a subtype of type 'String'
#0      createSplash (package:flutter_native_splash/flutter_native_splash.dart:15:10)
<asynchronous suspension>
#1      main (file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-0.1.6/bin/create.dart:5:3)
#2      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#3      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
pub finished with exit code 255

Every other colour, including 'white' #ffffff works fine for me.

Is black a colour or an absence of colour and light?! That's possibly a physics question.

Index out of range: no indices are valid: 0

Unhandled exception:
RangeError (index): Index out of range: no indices are valid: 0
#0 Iterable.elementAt (dart:core/iterable.dart:648:5)
#1 _getMainActivityJavaPath (package:flutter_native_splash/android.dart:335:27)

#2 _javaOrKotlin (package:flutter_native_splash/android.dart:307:36)

#3 _applyMainActivityUpdate (package:flutter_native_splash/android.dart:288:33)

#4 createSplash (package:flutter_native_splash/android.dart:39:9)

#5 createSplash (package:flutter_native_splash/flutter_native_splash.dart:20:11)

#6 main (file:///C:/Flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-0.1.8+3/bin/create.dart:5:3)
#7 _startIsolate. (dart:isolate-patch/isolate_patch.dart:303:32)
#8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
pub finished with exit code 255

App is Kotlin.

Message appears after splash ends

Hello all right, congratulations on the library, it really makes it easier, after the splash is over, a message pops up on my terminal several times

"Failed to send request: {" jsonrpc ":" 2.0 "," id ":" 20016 ", "method": "getVM", "params": {}} "

what could it be? The splash works, but this message appears repeatedly.

I am using the version:

dependencies:
flutter_native_splash: ^0.1.8+2

The message happens on iOS and Android.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.