Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

New implementation #2

Merged
merged 8 commits into from Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions .gitignore
@@ -0,0 +1,36 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
build/

# Android related
android

# iOS/XCode related
ios
10 changes: 10 additions & 0 deletions .metadata
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 68841bdab9840b5d72499f9cdd80b69894046ed0
channel: master

project_type: package
27 changes: 27 additions & 0 deletions .travis.yml
@@ -0,0 +1,27 @@
os:
- linux
sudo: required
dist: xenial
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libstdc++6

cache:
directories:
- $HOME/.pub-cache

before_script:
- git clone https://github.com/flutter/flutter.git -b stable --depth 1
- mv flutter $HOME/flutter
- export PATH=$HOME/flutter/bin:$PATH
- flutter doctor -v

script:
- set -e
- "./format.sh"
- set +e
- flutter test

4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,4 @@
## [0.0.1] - Initial release

Added:
- Everything
renancaraujo marked this conversation as resolved.
Show resolved Hide resolved
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Fireslime Games

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
116 changes: 116 additions & 0 deletions README.md
@@ -0,0 +1,116 @@
# Flame Splash Screen


![](demogif.gif)


Stylish your flame game with a beautiful splash screen.
renancaraujo marked this conversation as resolved.
Show resolved Hide resolved

This package includes a `FlameSplashScreen` widget.

## Install

Add `flame_splash_screen` as a dependency in your pubspec.yaml file ([what?](https://flutter.io/using-packages/)).

Import the widget:
```dart
import 'package:flame_splash_screen/flame_splash_screen.dart';
```

## Usage

The splash screen is a widget that can be used to show the splash screen.

### Simple usage

There is just two required params:
- `onFinish`, a callback that is executed when all animations from the splash screen is over.
- `theme`, than can be either `FlameSplashTheme.dark` or `FlameSplashTheme.white`.

```dart
FlameSplashScreen(
theme: FlameSplashTheme.dark,
onFinish: (BuildContext context) => Navigator.pushNamed(context, '/your-game-initial-screen')
)
```

#### Adding your own content

You can pass your own logo (or anything else) to be shown before or after the flame's logo.
renancaraujo marked this conversation as resolved.
Show resolved Hide resolved

```dart
FlameSplashScreen(
showBefore: (BuildContext context) {
return Text("To be shown before flame animation");
},
onFinish: (BuildContext context) => Navigator.pushNamed(context, '/your-game-initial-screen'),
)
```

```dart
FlameSplashScreen(
showAfter: (BuildContext context) {
return Text("To be shown after flame animation");
},
onFinish: (BuildContext context) => Navigator.pushNamed(context, '/your-game-initial-screen'),
)
```
Remember: you can also specify both `showBefore` and `showAfter`.

#### Changing theme

By default the splash screen has a dark background. You can Change it by specifying the `white` theme.
renancaraujo marked this conversation as resolved.
Show resolved Hide resolved

```dart
FlameSplashScreen(
theme: FlameSplashTheme.white,
onFinish: (BuildContext context) => Navigator.pushNamed(context, '/your-game-initial-screen'),
)
```


### Usage with controller

Controller enables `FlameSplashScreen` to be customized regarding animation duration and when it starts.

There is duration params and `autoStart` (which is true by default).

To use it, make the controller lives as much as a widget state:
```dart
class SplashScreenGameState extends State<SplashScreenGame> {
FlameSplashController controller;
@override
void initState() {
super.initState();
controller = FlameSplashController(
fadeInDuration: Duration(seconds: 1),
fadeOutDuration: Duration(milliseconds: 250),
waitDuration: Duration(seconds: 2),
autoStart: false
);
}

@override
void dispose() {
controller.dispose(); // dispose it when necessary
super.dispose();
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: FlameSplashScreen(
showBefore: (BuildContext context) {
return Text("Before the logo");
},
showAfter: (BuildContext context) {
return Text("After the logo");
},
theme: FlameSplashTheme.white,
onFinish: (context) => Navigator.pushNamed(context, '/the-game-initial-screen'),
controller: controller,
),
);
}
}
```
75 changes: 75 additions & 0 deletions analysis_options.yaml
@@ -0,0 +1,75 @@
analyzer:
errors:
mixin_inherits_from_not_object: ignore
linter:
rules:
- always_declare_return_types
- always_put_control_body_on_new_line
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_as
- avoid_classes_with_only_static_members
- avoid_empty_else
- avoid_field_initializers_in_const_classes
- avoid_function_literals_in_foreach_calls
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_slow_async_io
- await_only_futures
- camel_case_types
- cancel_subscriptions
- control_flow_in_finally
- directives_ordering
- empty_catches
- empty_constructor_bodies
- empty_statements
- hash_and_equals
- implementation_imports
- iterable_contains_unrelated_type
- library_names
- library_prefixes
- list_remove_unrelated_type
- no_adjacent_strings_in_list
- no_duplicate_case_values
- non_constant_identifier_names
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_adjacent_string_concatenation
- prefer_asserts_in_initializer_lists
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_final_locals
- prefer_foreach
- prefer_initializing_formals
- prefer_is_empty
- prefer_is_not_empty
- prefer_typing_uninitialized_variables
- recursive_getters
- slash_for_doc_comments
- sort_constructors_first
- sort_unnamed_constructors_first
- test_types_in_equals
- throw_in_finally
- type_init_formals
- unnecessary_brace_in_string_interps
- unnecessary_getters_setters
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_this
- unrelated_type_equality_checks
- use_rethrow_when_possible
- unnecessary_new

Binary file added assets/flame-logo-black.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/flame-logo-white.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demogif.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions example/.gitignore
@@ -0,0 +1,36 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
10 changes: 10 additions & 0 deletions example/.metadata
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 68841bdab9840b5d72499f9cdd80b69894046ed0
channel: master

project_type: app
16 changes: 16 additions & 0 deletions example/README.md
@@ -0,0 +1,16 @@
# example

A new Flutter project.
renancaraujo marked this conversation as resolved.
Show resolved Hide resolved

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.