Skip to content

Instantly share code, notes, and snippets.

@Billion101
Billion101 / main.dart
Created October 2, 2025 08:46
backet list
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@Billion101
Billion101 / main.dart
Created October 2, 2025 08:45
create and on boarding screen
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved.
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:introduction_screen/introduction_screen.dart';
import 'package:shared_preferences/shared_preferences.dart';
late SharedPreferences prefs;
void main() async {
// Required to use async in the main() function
@Billion101
Billion101 / main.dart
Last active October 2, 2025 08:27
using network image
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved.
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
@Billion101
Billion101 / main.dart
Created October 2, 2025 08:00
list items with images
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved.
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.grey[200],
body: Center(
child: ListTile(
leading: CircleAvatar(
radius: 36,
backgroundColor: Colors.white,
@Billion101
Billion101 / main.dart
Created October 2, 2025 07:56
SingleChildScrollView
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved.
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(height: 150, width: 100, color: Colors.amber[100]),
Container(height: 150, width: 100, color: Colors.amber[200]),
Container(height: 150, width: 100, color: Colors.amber[300]),
Container(height: 150, width: 100, color: Colors.amber[400]),
Container(height: 150, width: 100, color: Colors.amber[500]),
@Billion101
Billion101 / main.dart
Created October 2, 2025 07:50
gridview.layout
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved.
body: GridView.count(
// The number of columns in the grid.
crossAxisCount: 2,
// Spacing between items.
mainAxisSpacing: 8.0,
crossAxisSpacing: 8.0,
// Generating a list of widgets to display in the grid.
@Billion101
Billion101 / main.dart
Last active October 2, 2025 08:13
listview.builder
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved.
body: ListView.builder(
// Tells the ListView the total number of items in our list.
itemCount: 10,
// The builder function is called for each item. 'index' is the current
itemBuilder: (context, index) {
// Return the widget for the item at the given index.
return ListTile(title: Text('Item at index: $index'));
},
@Billion101
Billion101 / main.dart
Created October 2, 2025 07:36
list view
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved.
body: ListView(
padding: EdgeInsets.all(8),
children: [
ListTile(
leading: Icon(Icons.map),
title: Text('Map'),
), // ListTile
ListTile(
leading: Icon(Icons.photo_album),
@Billion101
Billion101 / main.dart
Created October 2, 2025 07:32
drawer
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@Billion101
Billion101 / main.dart
Last active October 2, 2025 08:12
create body
/// Copyright 2025. ⓒ github.com/Touy2004 All rights reserved.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});