Skip to content

Instantly share code, notes, and snippets.

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
initialRoute: '/',
routes: {
import 'package:flutter/material.dart';
class DetailedProfile extends StatelessWidget {
final String name;
final String email;
DetailedProfile({this.name, this.email});
@override
Widget build(BuildContext context) {
class ProfileArguments {
final String name;
final String email;
ProfileArguments({this.name, this.email});
}
MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
initialRoute: '/',
routes: {
'/': (context) => MyHomePage(),
'/profile': (context) => Profile(),
},
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
class UserList extends StatelessWidget{
final String apiUrl = "https://randomuser.me/api/?results=10";
Future<List<dynamic>> fetchUsers() async {
import 'package:flutter/material.dart';
import 'package:rest_api/user-list.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
@maffan91
maffan91 / main.dart
Created January 18, 2020 19:51
Pull to refresh in Flutter
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {