Hello developers...
මොකක්ද මේ Flutter Center Widget එක කියන්නේ ?
Flutter Center Widget එක යනු විජට් මධ්යස්ථානය එහි ළමා විජට් එක සිරස් සහ තිරස් අක්ෂ ඔස්සේ පෙළගස්වයි.
Syntax
The syntax of a Center widget to center other widget is
Center( child: someWidget,
),
උදාහරණ
main.dart File
import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); static const String _title = 'Apps Lanka Dev'; @override Widget build(BuildContext context) { return MaterialApp( title: _title, home: Scaffold( appBar: AppBar(title: const Text(_title)), body: const MyStatefulWidget(), ), ); } } class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @override State createState() => _MyStatefulWidgetState(); } class _MyStatefulWidgetState extends State { @override Widget build(BuildContext context) { return const Center( child: Text('Apps Lanka Flutter Tutorial', style: TextStyle(fontSize: 30),), ); } }
We are developing Mobile application and Web application for more details visit our web site www.appslanka.lk
0 Comments