Skip to content

Commit f6bf3fe

Browse files
committed
Added splashscreen, icon and name for android
1 parent 564e2a6 commit f6bf3fe

38 files changed

+75
-32
lines changed

Diff for: android/app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
FlutterApplication and put your custom class here. -->
88
<application
99
android:name="io.flutter.app.FlutterApplication"
10-
android:label="radlet_composer"
10+
android:label="Radlet Composer"
1111
android:icon="@mipmap/ic_launcher">
1212
<activity
1313
android:name=".MainActivity"

Diff for: android/app/src/main/res/mipmap-hdpi/ic_launcher.png

2.89 KB
Loading

Diff for: android/app/src/main/res/mipmap-mdpi/ic_launcher.png

2.01 KB
Loading
3.85 KB
Loading
5.4 KB
Loading
6.83 KB
Loading

Diff for: assets/icons/icon.png

11.7 KB
Loading

Diff for: assets/icons/logo.png

8.21 KB
Loading

Diff for: assets/icons/net.png

-10.3 KB
Binary file not shown.

Diff for: assets/icons/splash.png

-25.9 KB
Binary file not shown.
Loading
604 Bytes
Loading
754 Bytes
Loading
Loading
569 Bytes
Loading
969 Bytes
Loading
Loading
754 Bytes
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

Diff for: lib/routes.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Routes {
2929
body1: TextStyle(fontSize: 14.0, fontFamily: 'Hind'),
3030
),
3131
),
32-
initialRoute: '/discovery',
32+
initialRoute: '/',
3333
routes: routes));
3434
}
3535
}

Diff for: lib/screens/Discovery/Discovery.dart

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ class Discovery extends StatefulWidget {
1414
final Widget child;
1515

1616
@override
17-
State createState() => new DiscoveryState();
17+
State createState(){
18+
return new _DiscoveryState();
19+
}
1820
}
1921

20-
class DiscoveryState extends State<Discovery> {
22+
class _DiscoveryState extends State<Discovery> {
2123
List<Device> devices;
2224
var timer;
2325

@@ -37,8 +39,8 @@ class DiscoveryState extends State<Discovery> {
3739

3840
@override
3941
void dispose() {
40-
super.dispose();
4142
timer.cancel();
43+
super.dispose();
4244
}
4345

4446
void updateDeviceList(List<Device> newDeviceList) {

Diff for: lib/screens/SplashScreen/SplashScreen.dart

+47-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,62 @@
1+
import 'dart:async';
2+
13
import 'package:flutter/material.dart';
24
import './widgets/IconContainer.dart';
3-
import './widgets/NetAnimation.dart';
45

5-
class SplashScreen extends StatelessWidget {
6+
class SplashScreen extends StatefulWidget {
7+
const SplashScreen({
8+
Key key,
9+
this.child,
10+
}) : super(key: key);
11+
12+
final Widget child;
13+
14+
@override
15+
State<StatefulWidget> createState() {
16+
return new _SplashScreenState();
17+
}
18+
}
19+
20+
class _SplashScreenState extends State<SplashScreen>
21+
with SingleTickerProviderStateMixin {
22+
AnimationController _controller;
23+
Animation _animation;
24+
25+
@override
26+
void initState() {
27+
_controller =
28+
AnimationController(vsync: this, duration: Duration(seconds: 3));
29+
_animation = Tween(begin: 0.0, end: 1.0).animate(_controller);
30+
super.initState();
31+
32+
startTime();
33+
}
34+
35+
@override
36+
void dispose() {
37+
_controller.dispose();
38+
super.dispose();
39+
}
40+
41+
startTime() async {
42+
return new Timer(new Duration(seconds: 4), ( ) => Navigator.of(context).pushReplacementNamed('/home'));
43+
}
44+
645
@override
746
Widget build(BuildContext context) {
47+
_controller.forward();
848
return Scaffold(
949
body: Stack(
1050
children: <Widget>[
1151
new Container(
1252
decoration: BoxDecoration(color: Colors.black38),
1353
),
1454
new Container(
15-
alignment: Alignment.center,
16-
child: new NetAnimation(),
17-
),
18-
new Container(
19-
alignment: Alignment.center,
20-
child: new IconContainer(),
21-
),
55+
alignment: Alignment.center,
56+
child: FadeTransition(
57+
opacity: _animation,
58+
child: new IconContainer(),
59+
)),
2260
],
2361
),
2462
);

Diff for: lib/screens/SplashScreen/widgets/IconContainer.dart

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import 'package:flutter/material.dart';
33
class IconContainer extends StatelessWidget {
44
@override
55
Widget build(BuildContext context) {
6-
// return Image(image: AssetImage('assets/icons/splash.svg'));
7-
return CircleAvatar(
8-
backgroundColor: Colors.blueGrey[900],
9-
radius: 52,
10-
backgroundImage: AssetImage('assets/icons/splash.png'),
11-
);
6+
return Image.asset('assets/icons/logo.png', height: 200, width: 200,);
127
}
138
}

Diff for: lib/screens/SplashScreen/widgets/NetAnimation.dart

-12
This file was deleted.

Diff for: pubspec.lock

+14
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ packages:
6969
description: flutter
7070
source: sdk
7171
version: "0.0.0"
72+
flutter_launcher_icons:
73+
dependency: "direct dev"
74+
description:
75+
name: flutter_launcher_icons
76+
url: "https://pub.dartlang.org"
77+
source: hosted
78+
version: "0.7.4"
7279
flutter_test:
7380
dependency: "direct dev"
7481
description: flutter
@@ -205,5 +212,12 @@ packages:
205212
url: "https://pub.dartlang.org"
206213
source: hosted
207214
version: "3.5.0"
215+
yaml:
216+
dependency: transitive
217+
description:
218+
name: yaml
219+
url: "https://pub.dartlang.org"
220+
source: hosted
221+
version: "2.2.0"
208222
sdks:
209223
dart: ">=2.4.0 <3.0.0"

Diff for: pubspec.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ dependencies:
2626
cupertino_icons: ^0.1.2
2727

2828
dev_dependencies:
29+
flutter_launcher_icons: ^0.7.4
2930
flutter_test:
3031
sdk: flutter
3132

33+
flutter_icons:
34+
image_path: "assets/icons/icon.png"
35+
android: true
36+
ios: true
37+
3238

3339
# For information on the generic Dart part of this file, see the
3440
# following page: https://dart.dev/tools/pub/pubspec

0 commit comments

Comments
 (0)