flutter_spacer
spacer는 화면 너비 또는 높이의 백분율 기준으로 위젯을 쉽게 간격 조절할 수 있도록 해주는 Flutter용 Dart 패키지입니다.
mstafamajid/Spacer open-source repository details.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
flutter_spacer is a Dart package that simplifies the creation of responsive layouts by providing utilities for easily spacing between widgets in terms of percentage of screen width or height.
To use this package, add flutter_spacer to your pubspec.yaml file
dependencies:
flutter_spacer: ^1.0.2 # use the latest version
or
dart pub add flutter_spacer
import 'package:flutter/material.dart';
import 'package:flutter_spacer/flutter_spacer.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlutterSpacer(
builder: (context) {
return MaterialApp(
title: 'My App',
home: MyHomePage(),
);
},
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('My App'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 20,
width: 50,
color: Colors.blue,
child: Center(
child: Text(
'first Container',
style: TextStyle(color: Colors.white),
),
),
),
20.hs // give you space of 20%
Container(
height: 20,
width: 50,
color: Colors.blue,
child: Center(
child: Text(
'Second Container',
style: TextStyle(color: Colors.white),
),
),
),
],
),
),
);
}
}
Thank you for using the flutter_spacer package! Here's some additional information to help you make the most out of this package:
If you encounter any issues with the package or have suggestions for improvements, feel free to open an issue on the GitHub repository. Contributions are welcome, and we appreciate any help to make this package better.
This project is licensed under the MIT License. Feel free to review the terms and conditions.
For any further inquiries or communication, you can reach out to the package maintainer:
If you find this package helpful, consider giving it a star on GitHub and spreading the word. Your support is greatly appreciated!
Happy coding! 🚀
사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗