반응형
- 코드 예시
import 'package:flutter/material.dart';
class MyWidget extends StatefulWidget {
const MyWidget({Key? key}) : super(key: key);
@override
_MyWidgetState createState() => _MyWidgetState();
}
class _MyWidgetState extends State<MyWidget> {
double _progressValue = 0.0;
void _updateProgress() {
setState(() {
_progressValue += 0.1;
if (_progressValue >= 1.0) {
_progressValue = 0.0;
}
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Linear Progress Indicator Example'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
LinearProgressIndicator(
value: _progressValue,
),
SizedBox(height: 20),
ElevatedButton(
child: Text('Update Progress'),
onPressed: _updateProgress,
),
],
),
),
);
}
}
반응형
'개발 > Flutter' 카테고리의 다른 글
플러터 Flutter 콘솔 유용한 명령어 모음 VSCode Console (0) | 2023.03.31 |
---|---|
플러터 Flutter 테마 Theme 변경하기 간단 구현 (0) | 2023.03.31 |
플러터 Flutter 구글 애드몹 Google Admob 전면 광고 간단 구현 (0) | 2023.03.31 |
플러터 Flutter 뒤로가기 2번 앱 종료 간단 구현 (0) | 2023.03.28 |
플러터 Flutter For문 Switch문 간단 구현 (0) | 2023.02.18 |
플러터 Flutter if else문 간단 구현법 (0) | 2023.02.18 |
플러터 Flutter 메모장 구현하기 Notepad (0) | 2023.01.29 |
플러터 Flutter ToDo List 구현하기 (0) | 2023.01.29 |
댓글