Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 11e5ea2

Browse files
authored
Merge pull request #4 from nb312/dev
Dev
2 parents 3bb02af + 8f993c2 commit 11e5ea2

File tree

14 files changed

+258
-9
lines changed

14 files changed

+258
-9
lines changed

‎assets/images/man.flr‎

-296 KB
Binary file not shown.

‎assets/images/solar.flr‎

5.61 KB
Binary file not shown.

‎assets/images/solar_flare.png‎

37.8 KB
Loading[フレーム]

‎doc/animation_flare.gif‎

870 KB
Loading[フレーム]

‎lib/constant/_constant.dart‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
///
2+
/// Created by NieBin on 2019年1月9日
3+
/// Github: https://github.com/nb312
4+
/// Email: niebin312@gmail.com
5+
///
6+
export "color_const.dart";
7+
export 'image_const.dart';
8+
export 'page_const.dart';
9+
export 'size_const.dart';

‎lib/constant/color_const.dart‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,14 @@ import "package:flutter/material.dart";
88
const BOTTOM_COLORS = Colors.grey;
99
const COLOR_LIGHT_INDEX = 900;
1010
const COLOR_DARK_INDEX = 500;
11+
12+
const BLUE_NORMAL = Color(0xff54c5f8);
13+
const GREEN_NORMAL = Color(0xff6bde54);
14+
const BLUE_DARK2 = Color(0xff01579b);
15+
const BLUE_DARK1 = Color(0xff29b6f6);
16+
const RED_DARK1 = Color(0xfff26388);
17+
const RED_DARK2 = Color(0xfff782a0);
18+
const RED_DARK3 = Color(0xfffb8ba8);
19+
const RED_DARK4 = Color(0xfffb89a6);
20+
const RED_DARK5 = Color(0xfffd86a5);
21+
const YELLOW_NORMAL = Color(0xfffcce89);

‎lib/constant/image_const.dart‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66
class ImagePath {
77
static const _PATH = "assets/images";
88
static const FLUTTER_OPEN = "$_PATH/flutteropen.png";
9+
static const PAGE_ANIMATION_01 = "$_PATH/flutteropen.png";
10+
static const PAGE_ANIMATION_02 = "$_PATH/solar_flare.png";
11+
static const SOLAR_FLARE = "$_PATH/solar.flr";
912
}

‎lib/constant/page_const.dart‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
///
2+
/// Created by NieBin on 2019年1月9日
3+
/// Github: https://github.com/nb312
4+
/// Email: niebin312@gmail.com
5+
///
6+
class PageConst {
7+
static const HOME_PAGE = "/Home page";
8+
static const ANIMATION_01 = "Animation 01 page";
9+
static const ANIMATION_02 = "Animation 02 page";
10+
}

‎lib/main.dart‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
2-
import 'page/WelcomePage.dart';
2+
import 'package:flutter_animation/constant/_constant.dart';
3+
import 'package:flutter_animation/page/_page.dart';
34

45
void main() => runApp(MyApp());
56

@@ -9,7 +10,11 @@ class MyApp extends StatelessWidget {
910
return MaterialApp(
1011
title: 'Layout Animation',
1112
home: WelcomePage(),
12-
routes: {},
13+
routes: {
14+
PageConst.HOME_PAGE: (context) => HomePage(),
15+
PageConst.ANIMATION_01: (context) => AnimationOnePage(),
16+
PageConst.ANIMATION_02: (context) => FlarePage(),
17+
},
1318
);
1419
}
1520
}

‎lib/page/HomePage.dart‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
///
2+
/// Created by NieBin on 2019年1月9日
3+
/// Github: https://github.com/nb312
4+
/// Email: niebin312@gmail.com
5+
///
6+
import "package:flutter/material.dart";
7+
import 'package:flutter_animation/constant/_constant.dart';
8+
9+
class HomePage extends StatefulWidget {
10+
@override
11+
_HomeState createState() => _HomeState();
12+
}
13+
14+
const PAGES = [
15+
{
16+
"title": PageConst.ANIMATION_01,
17+
"img": ImagePath.PAGE_ANIMATION_01,
18+
"click": PageConst.ANIMATION_01
19+
},
20+
{
21+
"title": PageConst.ANIMATION_02,
22+
"img": ImagePath.PAGE_ANIMATION_02,
23+
"click": PageConst.ANIMATION_02
24+
},
25+
];
26+
const ITEM_COLORS = [
27+
BLUE_DARK2,
28+
RED_DARK5,
29+
BLUE_NORMAL,
30+
RED_DARK2,
31+
YELLOW_NORMAL,
32+
BLUE_DARK1,
33+
GREEN_NORMAL,
34+
RED_DARK3
35+
];
36+
37+
class _HomeState extends State<HomePage> {
38+
Widget _listItem(index) => InkWell(
39+
child: Card(
40+
elevation: 10.0,
41+
child: Container(
42+
color: ITEM_COLORS[index % ITEM_COLORS.length].withOpacity(0.9),
43+
child: Stack(
44+
children: <Widget>[
45+
Container(
46+
child: Center(
47+
child: Image.asset(
48+
PAGES[index % PAGES.length]["img"],
49+
fit: BoxFit.fitWidth,
50+
),
51+
),
52+
)
53+
],
54+
),
55+
),
56+
),
57+
onTap: () {
58+
Navigator.of(context).pushNamed(PAGES[index % PAGES.length]["click"]);
59+
},
60+
);
61+
62+
@override
63+
Widget build(BuildContext context) {
64+
return Scaffold(
65+
appBar: AppBar(
66+
title: Text("Flutter Open"),
67+
),
68+
body: GridView.builder(
69+
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
70+
crossAxisCount: 1,
71+
childAspectRatio: 1,
72+
crossAxisSpacing: 10,
73+
mainAxisSpacing: 10),
74+
itemBuilder: (context, index) {
75+
return _listItem(index);
76+
},
77+
itemCount: PAGES.length,
78+
),
79+
);
80+
}
81+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /