Skip to content

Commit ff707e9

Browse files
author
Jack
committed
Added Background Gradient for Signup Page
1 parent e33dd30 commit ff707e9

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

lib/const/gradient_const.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import 'package:flutter/material.dart';
2+
import 'color_const.dart';
3+
4+
const LinearGradient SIGNUP_BACKGROUND = LinearGradient(
5+
begin: FractionalOffset(0.0, 0.4),
6+
end: FractionalOffset(0.9, 0.7),
7+
// Add one stop for each color. Stops should increase from 0 to 1
8+
stops: [0.1, 0.9],
9+
colors: [
10+
YELLOW,
11+
BLUE
12+
]
13+
);

lib/page/signup/SignPageOne.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
/// Email: niebin312@gmail.com
55
///
66
import "package:flutter/material.dart";
7+
import '../../const/color_const.dart';
8+
import '../../const/gradient_const.dart';
79

810
class SignPageOne extends StatefulWidget {
911
@override
@@ -14,10 +16,14 @@ class _SignOneState extends State<SignPageOne> {
1416
@override
1517
Widget build(BuildContext context) {
1618
return Scaffold(
17-
appBar: AppBar(
18-
title: Text("Sign up one"),
19+
body: Container(
20+
decoration: BoxDecoration(
21+
gradient: SIGNUP_BACKGROUND
22+
),
23+
child: Center(
24+
child: Text("Start"),
25+
),
1926
),
20-
body: Text("Sign up page one"),
2127
);
2228
}
2329
}

0 commit comments

Comments
 (0)