Skip to content

Instantly share code, notes, and snippets.

@benznest
benznest / main.dart
Last active Jun 16, 2021
example routing using Navigator v1
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@benznest
benznest / main.dart
Created Aug 21, 2020
Page Tab Indicator with Custom Painter
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@benznest
benznest / main.dart
Last active Aug 20, 2020
Segmented Control with Page View
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
View main.dart
class Product{
String title;
bool isSale;
int price;
Product({this.title,this.isSale,this.price});
toString(){
return "title = $title, isSale = $isSale, price = $price";
}
}
@benznest
benznest / main.dart
Created Jul 20, 2020
drawing watermelon with Flutter Painter.
View main.dart
import 'dart:ui';
import 'package:flutter/material.dart';
import 'dart:math' as math;
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@benznest
benznest / main.dart
Last active Jul 16, 2020
Draw human shape.
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@benznest
benznest / main.dart
Created Sep 17, 2019
AnimatedListexample fade transition items.
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Animation Practice',
theme: ThemeData(
@benznest
benznest / main.dart
Created Sep 16, 2019
Basic Animation Practice
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Animation Practice',
theme: ThemeData(
View detail_screen.dart
import 'package:flutter/material.dart';
import 'package:flutter_app_3/email.dart';
import 'package:flutter_animation_progress_bar/flutter_animation_progress_bar.dart';
class DetailScreen extends StatelessWidget {
final Email email;
final GlobalKey<ScaffoldState> keyScaffold = GlobalKey();
DetailScreen({@required this.email});
@benznest
benznest / detail_page.dart
Last active Jun 9, 2019
Flutter Fundamental 2 Workshop
View detail_page.dart
import 'package:flutter/material.dart';
import 'package:flutter_app_2/email.dart';
class DetailPage extends StatelessWidget {
final Email email;
DetailPage({this.email});
@override