Skip to content

Instantly share code, notes, and snippets.

Avatar

Luiz Marcus luizmarcus

View GitHub Profile
View exemplo_flutter_connectivity_initstate_change.dart
import 'package:connectivity/connectivity.dart';
String _connection = "";
final Connectivity _connectivity = Connectivity();
StreamSubscription<ConnectivityResult> _connectivitySubscription;
@override
void initState() {
super.initState();
View exemplo_flutter_connectivity_initstate.dart
import 'package:connectivity/connectivity.dart';
String _connection = "";
final Connectivity _connectivity = Connectivity();
@override
void initState() {
super.initState();
_connectivity.checkConnectivity().then((connectivityResult){_updateStatus(connectivityResult);});
View exemplo_flutter_drawer_mediaquery.dart
import 'package:flutter/material.dart';
import 'fragment.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
View exemplo_flutter_drawer_background.dart
import 'package:flutter/material.dart';
import 'fragment.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
View exemplo_flutter_dio_request.dart
void getProfile() async {
Response response = await _dio.get("/users/$_count");
var profile = response.data["data"];
setState(() {
_nome = profile['first_name'] + " " + profile['last_name'];
_email = profile['email'];
_avatar = NetworkImage(profile['avatar']);
});
}
View exemplo_flutter_dio_initstate.dart
@override
void initState() {
super.initState();
BaseOptions options = new BaseOptions(
baseUrl: "https://reqres.in/api",
connectTimeout: 5000,
);
dio = new Dio(options);
View exemplo_flutter_drawer_main.dart
import 'package:flutter/material.dart';
import 'fragment.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
View exemplo_flutter_drawer_fragment.dart
import 'package:flutter/material.dart';
class Fragment extends StatelessWidget {
final String title;
const Fragment(this.title);
@override
Widget build(BuildContext context) {
You can’t perform that action at this time.