Author archive: ZERIN

Coding Flutter Model
Flutter::Models
November 26, 2019
0
,
Sample Model class User { final int id; final String name; final String imageUrl; User({ this.id, this.name, this.imageUrl, }); } class Message { final User sender; final String time; // Would usually be type DateTime or Firebase Timestamp in production apps final String text; final bool isLiked; final bool unread; Message({ this.sender, this.time, this.text, this.isLiked, […]
Flutter Navigation / Route
Flutter: Page Controller
November 24, 2019
0
,
lib/main.dart import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; void main() { runApp(MaterialApp( home: MyPageView(), )); } class MyPageView extends StatefulWidget { MyPageView({Key key}) : super(key: key); _MyPageViewState createState() => _MyPageViewState(); } class _MyPageViewState extends State { PageController _pageController; @override void initState() { super.initState(); _pageController = PageController(); } @override void dispose() { _pageController.dispose(); super.dispose(); } @override Widget […]
Programmer
Videos You Should Watch at least Once
November 22, 2019
0
Coding Flutter List View
Flutter:: Horizontal List View
November 21, 2019
0
,
lib/main.dart import 'package:flutter/material.dart'; void main() { runApp(MyHorizontalSample1()); } class MyHorizontalSample1 extends StatelessWidget{ Container MyArticles(String imageVal, String heading, String subHeading){ return Container( width: 160.0, child: Card( child: Wrap( children: [ Image.asset( 'images/pavlova.jpg' ), ListTile( title: Text(heading), subtitle: Text(subHeading), ), ], ), ), ); } @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, title: 'Flutter Horizontal […]
Flutter Flutter Layout Sample
Flutter:: Positioned
November 20, 2019
0
import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; void main() { runApp(ListViewApp()); } class ListViewApp extends StatelessWidget { @override Widget build(BuildContext context) { final title = 'Basic List'; return MaterialApp( title: title, home: Scaffold( appBar: AppBar( title: Text(title), ), body: ConstrainedBox( constraints: BoxConstraints.tight(Size(double.infinity, 256)), child: Stack( alignment: AlignmentDirectional.center, children: [ Positioned( top: 0.0, child: Icon(Icons.calendar_today, size: 128.0, color: Colors.lightBlueAccent), […]
Coding Flutter Flutter Layout Sample
Flutter:: Column
November 20, 2019
0
, , ,
MainAxisAlignment CrossAxisAlignment Column( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( padding: const EdgeInsets.all(0.0), color: Colors.cyanAccent, width: 80.0, height: 80.0, ), Container( padding: const EdgeInsets.all(0.0), color: Colors.blueAccent, width: 80.0, height: 80.0, ), Container( padding: const EdgeInsets.all(0.0), color: Colors.orangeAccent, width: 80.0, height: 80.0, ), ], Reference:http://flutterexamples.com/
Coding Flutter Flutter Layout Sample
Flutter:: Column
November 20, 2019
0
, , ,
MainAxisAlignment CrossAxisAlignment Column( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( padding: const EdgeInsets.all(0.0), color: Colors.cyanAccent, width: 80.0, height: 80.0, ), Container( padding: const EdgeInsets.all(0.0), color: Colors.blueAccent, width: 80.0, height: 80.0, ), Container( padding: const EdgeInsets.all(0.0), color: Colors.orangeAccent, width: 80.0, height: 80.0, ), ], Reference:http://flutterexamples.com/
Flutter Flutter Layout Sample
Flutter: Row
November 20, 2019
0
, ,
MainAxisAlignment CrossAxisAlignment Row( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( padding: const EdgeInsets.all(0.0), color: Colors.cyanAccent, width: 80.0, height: 80.0, ), Container( padding: const EdgeInsets.all(0.0), color: Colors.blueAccent, width: 80.0, height: 80.0, ), Container( padding: const EdgeInsets.all(0.0), color: Colors.orangeAccent, width: 80.0, height: 80.0, ), ], ),
Coding Data Passing Flutter
Flutter: Data Passing – First Screen To Second Screen and vice-versa
November 20, 2019
0
import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( title: 'Flutter', home: FirstScreen(), )); } class FirstScreen extends StatefulWidget { @override _FirstScreenState createState() { return _FirstScreenState(); } } class _FirstScreenState extends State { // this allows us to access the TextField text TextEditingController textFieldController = TextEditingController(); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('First Screen')), body: […]
Coding Flutter Navigation / Route
Flutter:: Navigate with named routes
November 20, 2019
0
,
Why Use It Compare to Normal Route using this route has additional advantage, if you need to navigate to the same screen in many parts of your app, this approach can result in code duplication. The solution is to define a named route, and use the named route for navigation. import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( […]