├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── .idea
├── libraries
│ ├── Dart_Packages.xml
│ ├── Dart_SDK.xml
│ └── Flutter_Plugins.xml
├── misc.xml
├── modules.xml
├── vcs.xml
└── workspace.xml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── example
└── example.dart
├── lib
└── splashscreen.dart
├── pubspec.lock
├── pubspec.yaml
├── screenshot.png
└── splashscreen.iml
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .DS_Store
3 | .dart_tool/
4 |
5 | .packages
6 | .pub/
7 | *.iml
8 |
9 | build/
10 | ios/.generated/
11 | ios/Flutter/Generated.xcconfig
12 | ios/Runner/GeneratedPluginRegistrant.*
13 | !/splashscreen.iml
14 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_Packages.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/libraries/Flutter_Plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 | 1530349680560
519 |
520 |
521 | 1530349680560
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## [1.4.0] - Null Safety Support
4 |
5 | * Implement null safety support
6 |
7 | ## [1.3.4] - Fix Route Name
8 |
9 | * Fix routeName issue
10 |
11 | ## [1.3.3] - Edit README.md
12 |
13 | * Add DPLYR Credits to README.md
14 |
15 | ## [1.3.2] - Raise pubscore
16 |
17 | * Change pubspec description and format files
18 |
19 | ## [1.3.1] - Edit README.md
20 |
21 | * Add similar packages
22 |
23 | ## [1.3.0] - Reopening the package
24 |
25 | * Add More Features
26 |
27 | ## [0.0.9] - Edit Readme.md
28 |
29 | * Editing
30 |
31 | ## [0.0.8] - Change Some Things
32 |
33 | * Change Image Network To Image Widget
34 |
35 | ## [0.0.7] - Add A ScreenShot in README.md
36 |
37 | * Only Edit in README.md
38 |
39 | ## [0.0.6] - Fix Some Issues & Final Release
40 |
41 | * Fix Some Issues
42 |
43 | ## [0.0.5] - Loader Color
44 |
45 | * Add Color Feature To Loader (CircularProgressIndicator)
46 |
47 | ## [0.0.4] - Release Preview
48 |
49 | * Add onClick And Fix Some Errors
50 |
51 | ## [0.0.3] - Beta 2
52 |
53 | * Add Some Features (photoRadius)
54 |
55 | ## [0.0.2] - Fix Issues
56 |
57 | * Fix Big Issues , Infinite Navigation
58 |
59 | ## [0.0.1] - Beta 1
60 |
61 | * SplashScreen Library First Release
62 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at karim@dplyr.dev. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) [year] [fullname]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [Splash Screen](https://pub.dev/packages/splashscreen)
2 |
3 | * A splashscreen package to be used for an intro for any flutter application easily with a lot of customization
4 |
5 | ## Currently Supported by awesome [DPLYR](https://dplyr.dev)
6 |
7 | 
8 |
9 | * [DPLYR](https://dplyr.dev) is a new generation of cloud platforms and aims to help developers in their road with open source contributions, and at the end we can say thanks.
10 |
11 | ## Screenshots
12 |
13 | 
14 |
15 | ## Usage
16 |
17 | [Example](https://github.com/KarimMohamed2005/SplashScreenFlutterPackage/blob/master/example/example.dart)
18 |
19 | To use this package :
20 |
21 | * add the dependency to your [pubspec.yaml](https://github.com/KarimMohamed2005/SplashScreenFlutterPackage/blob/master/pubspec.yaml) file.
22 |
23 | ```yaml
24 | dependencies:
25 | flutter:
26 | sdk: flutter
27 | splashscreen:
28 | ```
29 |
30 | ### How to use
31 |
32 | ``` dart
33 | new SplashScreen.timer(
34 | seconds: 14,
35 | navigateAfterSeconds: new AfterSplash(),
36 | title: new Text('Welcome In SplashScreen'),
37 | image: new Image.asset('screenshot.png'),
38 | backgroundColor: Colors.white,
39 | styleTextUnderTheLoader: new TextStyle(),
40 | photoSize: 100.0,
41 | loaderColor: Colors.red
42 | );
43 | ```
44 |
45 | ## Example
46 |
47 | As time based...
48 |
49 | ``` dart
50 | import 'package:flutter/material.dart';
51 | import 'package:splashscreen/splashscreen.dart';
52 |
53 | void main() {
54 | runApp(MaterialApp(home: MyApp()));
55 | }
56 |
57 | class MyApp extends StatelessWidget {
58 | @override
59 | Widget build(BuildContext context) {
60 | return SplashScreen.timer(
61 | seconds: 14,
62 | navigateAfterSeconds: AfterSplash(),
63 | title: Text(
64 | 'Welcome In SplashScreen',
65 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0),
66 | ),
67 | image: Image.network(
68 | 'https://flutter.io/images/catalog-widget-placeholder.png',
69 | ),
70 | backgroundColor: Colors.white,
71 | loaderColor: Colors.red,
72 | );
73 | }
74 | }
75 |
76 | class AfterSplash extends StatelessWidget {
77 | @override
78 | Widget build(BuildContext context) {
79 | return Scaffold(
80 | appBar: AppBar(
81 | title: Text('Welcome In SplashScreen Package'),
82 | automaticallyImplyLeading: false,
83 | ),
84 | body: Center(
85 | child: Text(
86 | 'Succeeded!',
87 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30.0),
88 | ),
89 | ),
90 | );
91 | }
92 | }
93 | ```
94 |
95 | As future based...
96 |
97 | ``` dart
98 | import 'package:flutter/material.dart';
99 | import 'package:splashscreen/splashscreen.dart';
100 |
101 | void main() {
102 | runApp(MaterialApp(home: MyApp()));
103 | }
104 |
105 | Future loadFromFuture() async {
106 | //
107 | return AfterSplash();
108 | }
109 |
110 | class MyApp extends StatelessWidget {
111 | @override
112 | Widget build(BuildContext context) {
113 | return SplashScreen.future(
114 | navigateAfterFuture: loadFromFuture(),
115 | navigateAfterSeconds: AfterSplash(),
116 | title: Text(
117 | 'Welcome In SplashScreen',
118 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0),
119 | ),
120 | image: Image.network(
121 | 'https://flutter.io/images/catalog-widget-placeholder.png',
122 | ),
123 | backgroundColor: Colors.white,
124 | loaderColor: Colors.red,
125 | );
126 | }
127 | }
128 |
129 | class AfterSplash extends StatelessWidget {
130 | @override
131 | Widget build(BuildContext context) {
132 | return Scaffold(
133 | appBar: AppBar(
134 | title: Text('Welcome In SplashScreen Package'),
135 | automaticallyImplyLeading: false,
136 | ),
137 | body: Center(
138 | child: Text(
139 | 'Succeeded!',
140 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30.0),
141 | ),
142 | ),
143 | );
144 | }
145 | }
146 | ```
147 |
148 | ### Animate the main image with the hero animation
149 |
150 | The main image has this tag attached to it `splashscreenImage`. Add it to whatever page you'll navigate to. This will animate the main Image to the same image you put in another page
151 |
152 | ### Adding a custom page tranistion
153 |
154 | You can use the `pageRoute` to do just this. Here's an example
155 |
156 | ```dart
157 | import 'package:flutter/material.dart';
158 | import 'package:splashscreen/splashscreen.dart';
159 |
160 | void main() {
161 | runApp(MaterialApp(home: MyApp()));
162 | }
163 |
164 | Route _createRoute() {
165 | return PageRouteBuilder(
166 | pageBuilder: (context, animation, secondaryAnimation) => AfterSplash(),
167 | transitionsBuilder: (context, animation, secondaryAnimation, child) {
168 | var begin = Offset(0.0, 1.0);
169 | var end = Offset.zero;
170 | var curve = Curves.ease;
171 | var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
172 | return SlideTransition(
173 | position: animation.drive(tween),
174 | child: child,
175 | );
176 | },
177 | );
178 | }
179 |
180 | class MyApp extends StatelessWidget {
181 | @override
182 | Widget build(BuildContext context) {
183 | return SplashScreen.timer(
184 | seconds: 14,
185 | navigateAfterSeconds: AfterSplash(),
186 | title: Text(
187 | 'Welcome In SplashScreen',
188 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0),
189 | ),
190 | image: Image.network(
191 | 'https://flutter.io/images/catalog-widget-placeholder.png',
192 | ),
193 | backgroundColor: Colors.white,
194 | loaderColor: Colors.red,
195 | pageRoute: _createRoute(),
196 | );
197 | }
198 | }
199 |
200 | class AfterSplash extends StatelessWidget {
201 | @override
202 | Widget build(BuildContext context) {
203 | return Scaffold(
204 | appBar: AppBar(
205 | title: Text('Welcome In SplashScreen Package'),
206 | automaticallyImplyLeading: false,
207 | ),
208 | body: Center(
209 | child: Text(
210 | 'Succeeded!',
211 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30.0),
212 | ),
213 | ),
214 | );
215 | }
216 | }
217 | ```
218 |
219 | ### All Supported Projects by [DPLYR](https://dplyr.dev)
220 |
221 | * [Splash Screen - Flutter](https://github.com/DPLYR-dev/SplashScreenFlutterPackage)
222 |
a flutter package created to show simple splashscreen
223 |
224 | * [In App Call Alert - Flutter](https://github.com/DPLYR-dev/InAppCallAlert)
225 |
a flutter package created to show call alert with sound
226 |
227 | * [File Manager](https://github.com/DPLYR-dev/file-manager)
228 |
a php project created to manage machines/servers through ftp servers
229 |
230 | * [Countries Js](https://github.com/DPLYR-dev/file-manager)
231 |
a javascript project created for retrieving country details with flexibility.
232 |
233 | * [Block temp mails](https://github.com/DPLYR-dev/block-temp-emails)
234 |
a javascript api to prevent temporary emails from signing up on your website. Super easy to use
235 |
236 | * [Disposable Emails List](https://github.com/DPLYR-dev/disposable-emails-list-domains-spam)
237 |
a python script to generate the temporary and spam doamins to prevent them and you can block them through this API [Block temp mails](https://github.com/DPLYR-dev/block-temp-emails)
238 |
239 | * [Basic CRM](https://github.com/DPLYR-dev/basic-crm)
240 |
A crm that is developed with Node Js for entreprenurs who need a basic CRM with text replacment feature
241 |
242 | * [Basic Finance](https://github.com/DPLYR-dev/basic-finance)
243 |
A finance that is developed with Node Js
244 |
245 | ### About DPLYR
246 |
247 | [DPLYR](https://www.dplyr.dev) is a SaaS tool that helps developers just like you to deploy their web apps more easily. It supports deploying Node.js apps with MongoDB, MySQL or PostgreSQL databases all for free. Go now to [www.dplyr.dev](https://www.dplyr.dev) and create a free account.
248 |
249 | ### Created by [Karim Mohamed](https://github.com/KarimMohamed20)
250 |
--------------------------------------------------------------------------------
/example/example.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:splashscreen/splashscreen.dart';
3 |
4 | void main() {
5 | runApp(MaterialApp(home: MyApp()));
6 | }
7 |
8 | class MyApp extends StatelessWidget {
9 | @override
10 | Widget build(BuildContext context) {
11 | return SplashScreen.timer(
12 | seconds: 14,
13 | navigateAfterSeconds: AfterSplash(),
14 | title: Text(
15 | 'Welcome In SplashScreen',
16 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0),
17 | ),
18 | image: Image.network(
19 | 'https://flutter.io/images/catalog-widget-placeholder.png',
20 | ),
21 | backgroundColor: Colors.white,
22 | loaderColor: Colors.red,
23 | );
24 | }
25 | }
26 |
27 | class AfterSplash extends StatelessWidget {
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: Text('Welcome In SplashScreen Package'),
33 | automaticallyImplyLeading: false,
34 | ),
35 | body: Center(
36 | child: Text(
37 | 'Succeeded!',
38 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30.0),
39 | ),
40 | ),
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/splashscreen.dart:
--------------------------------------------------------------------------------
1 | library splashscreen;
2 |
3 | import 'dart:async';
4 | import 'dart:core';
5 |
6 | import 'package:flutter/material.dart';
7 |
8 | class SplashScreen extends StatefulWidget {
9 | /// Seconds to navigate after for time based navigation
10 | final int? seconds;
11 |
12 | /// App title, shown in the middle of screen in case of no image available
13 | final Text title;
14 |
15 | /// Page background color
16 | final Color backgroundColor;
17 |
18 | /// Style for the laodertext
19 | final TextStyle styleTextUnderTheLoader;
20 |
21 | /// The page where you want to navigate if you have chosen time based navigation
22 | /// String or Widget
23 | final Object? navigateAfterSeconds;
24 |
25 | /// Main image size
26 | final double? photoSize;
27 |
28 | /// Triggered if the user clicks the screen
29 | final GestureTapCallback? onClick;
30 |
31 | /// Loader color
32 | final Color? loaderColor;
33 |
34 | /// Main image mainly used for logos and like that
35 | final Image? image;
36 |
37 | /// Loading text, default: 'Loading'
38 | final Text loadingText;
39 |
40 | /// Padding for long Loading text, default: EdgeInsets.all(0)
41 | final EdgeInsets loadingTextPadding;
42 |
43 | /// Background image for the entire screen
44 | final ImageProvider? imageBackground;
45 |
46 | /// Background gradient for the entire screen
47 | final Gradient? gradientBackground;
48 |
49 | /// Whether to display a loader or not
50 | final bool useLoader;
51 |
52 | /// Custom page route if you have a custom transition you want to play
53 | final Route? pageRoute;
54 |
55 | /// RouteSettings name for pushing a route with custom name (if left out in MaterialApp route names) to navigator stack (Contribution by Ramis Mustafa)
56 | final String? routeName;
57 |
58 | /// expects a function that returns a future, when this future is returned it will navigate
59 | /// Future or Future
60 | final Future