Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add splash screen on example app
Add splash screen on example app. Signed-off-by: Alex Manoel Ferreira Silva <alex@legytma.com.br>
- Loading branch information
Alex Manoel Ferreira Silva
committed
Jul 22, 2020
1 parent
5fc367d
commit 3d0d35a
Showing
13 changed files
with
137 additions
and
3 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
example/android/app/src/main/res/drawable/normal_background.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?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="@android:color/white" /> | ||
|
||
<!-- You can insert your own image assets here --> | ||
<item> | ||
<bitmap | ||
android:gravity="center" | ||
android:src="@mipmap/launch_image" /> | ||
</item> | ||
</layer-list> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// Copyright (c) 2020 Legytma Soluções Inteligentes (https://legytma.com.br). | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:schema_widget/json_schema_resolver.dart'; | ||
|
||
import '../schema_widget.dart'; | ||
|
||
class SchemaWidgetSplashScreen extends StatefulWidget { | ||
final Widget child; | ||
|
||
const SchemaWidgetSplashScreen({Key key, this.child}) : super(key: key); | ||
|
||
@override | ||
_SchemaWidgetSplashScreenState createState() => | ||
_SchemaWidgetSplashScreenState(); | ||
} | ||
|
||
class _SchemaWidgetSplashScreenState extends State<SchemaWidgetSplashScreen> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Image( | ||
image: AssetImage( | ||
"assets/LegytmaSolucoesInteligentes.png", | ||
package: "schema_widget", | ||
), | ||
), | ||
StreamBuilder<FactoryStatistics>( | ||
stream: SchemaWidget.factoryStream, | ||
builder: (buildContext, snapshot) { | ||
if (snapshot.hasData) { | ||
var factoryStatistics = snapshot.data; | ||
|
||
return Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Text( | ||
factoryStatistics.toString(), | ||
style: TextStyle( | ||
fontSize: 7, | ||
color: Colors.black54, | ||
), | ||
), | ||
LinearProgressIndicator( | ||
value: factoryStatistics.value, | ||
), | ||
], | ||
); | ||
} | ||
|
||
return CircularProgressIndicator(); | ||
}, | ||
), | ||
StreamBuilder<JsonSchemaResolverStatistics>( | ||
stream: SchemaWidget.jsonSchemaResolverStream, | ||
builder: (buildContext, snapshot) { | ||
if (snapshot.hasData) { | ||
var jsonSchemaResolverStatistics = snapshot.data; | ||
|
||
return Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Text( | ||
jsonSchemaResolverStatistics.toString(), | ||
style: TextStyle( | ||
fontSize: 7, | ||
color: Colors.black54, | ||
), | ||
), | ||
LinearProgressIndicator( | ||
value: jsonSchemaResolverStatistics.requestValue, | ||
), | ||
], | ||
); | ||
} | ||
|
||
return CircularProgressIndicator(); | ||
}, | ||
), | ||
widget.child ?? | ||
StreamBuilder<FactoryStatistics>( | ||
stream: SchemaWidget.factoryStream, | ||
builder: (buildContext, snapshot) { | ||
if (snapshot.hasError) { | ||
return Text('${snapshot.error}'); | ||
} | ||
|
||
return Container(); | ||
}, | ||
), | ||
], | ||
); | ||
} | ||
} |