Skip to content

Instantly share code, notes, and snippets.

@Ahmadre
Created April 9, 2020 00:56
Show Gist options
  • Save Ahmadre/1734fbb2000819e3c70cc3d091138b09 to your computer and use it in GitHub Desktop.
Save Ahmadre/1734fbb2000819e3c70cc3d091138b09 to your computer and use it in GitHub Desktop.
Slow Web example
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:ui';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Slow Web Demo'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final double backgroundBlurFactor = 3.0;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
fit: StackFit.expand,
children: [
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(
'https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260'),
fit: BoxFit.cover,
),
),
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: backgroundBlurFactor,
sigmaY: backgroundBlurFactor,
),
child: Container(
decoration: BoxDecoration(color: Colors.white.withOpacity(0.0)),
),
),
),
Center(
child: Container(
child: RaisedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ForgotPasswordScreen()));
},
child: Text(
"Forgot password?",
textScaleFactor: .9,
),
),
),
),
],
),
);
}
}
class ForgotPasswordScreen extends StatefulWidget {
ForgotPasswordScreen({Key key}) : super(key: key);
@override
_ForgotPasswordScreenState createState() => _ForgotPasswordScreenState();
}
class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Forgot password'),
),
body: Container(),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment