일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- c언어
- gitlab
- Algorithm
- git
- C언어 포인터
- github
- c# winform
- 깃
- dart 언어
- Data Structure
- c#
- 구조체
- Python
- 도커
- Unity
- C# delegate
- Houdini
- Flutter
- vim
- HTML
- docker
- c# 추상 클래스
- jupyter lab
- c# 윈폼
- 플러터
- jupyter
- 포인터
- C++
- 유니티
- 다트 언어
Archives
- Today
- Total
nomad-programmer
[Programming/Flutter] AppBar에 Gradient Color 적용 본문
AppBar에 Gradient 색상을 적용시켜보았다.
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: AppBar(
toolbarHeight: 70,
title: new Text(
'Gradient',
style: new TextStyle(
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 36.0,
),
),
centerTitle: true,
flexibleSpace: new Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: <Color>[
Colors.red,
Colors.blue,
],
),
),
),
),
);
}
}
다음은 FractionalOffet 메소드와 stops, tileModel로 그레디언트 색상을 조절하는 다른 코드이다.
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: AppBar(
toolbarHeight: 70,
title: new Text(
'Gradient',
style: new TextStyle(
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 36.0,
),
),
centerTitle: true,
flexibleSpace: new Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: const FractionalOffset(0.0, 0.0),
end: const FractionalOffset(1.0, 1.0),
colors: <Color>[
const Color(0xFf3366FF),
const Color(0xFF00CCff),
],
stops: <double>[0.0, 1.0],
tileMode: TileMode.clamp,
),
),
),
),
);
}
}
'Programming > Flutter' 카테고리의 다른 글
[Flutter] Reactive Programming (0) | 2020.10.17 |
---|---|
[Flutter] 성능 개선을 위한 작은 실천 (0) | 2020.10.15 |
[Programming/Flutter] Provider Pattern (0) | 2020.10.12 |
[Programming/Flutter] Provider 패턴으로 만든 StopWatch APP (0) | 2020.10.11 |
[Programming/Flutter] TextFormField 위젯 (0) | 2020.10.11 |
Comments