Skip to content

Instantly share code, notes, and snippets.

@plotsklapps
Last active September 18, 2023 10:44
Show Gist options
  • Select an option

  • Save plotsklapps/e54f3205a811d8c23a625aacc36bf21e to your computer and use it in GitHub Desktop.

Select an option

Save plotsklapps/e54f3205a811d8c23a625aacc36bf21e to your computer and use it in GitHub Desktop.
Flutter Fullstack #1

Flutter Fullstack #1

Created with <3 with dartpad.dev.

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(const FlutterBankApp());
}
class FlutterBankApp extends StatelessWidget {
const FlutterBankApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
textTheme: GoogleFonts.poppinsTextTheme(
Theme.of(context).textTheme,
),
),
home: const FlutterBankSplash(),
);
}
}
class FlutterBankSplash extends StatelessWidget {
const FlutterBankSplash({super.key});
@override
Widget build(BuildContext context) {
// Future.delayed takes two parameters: a Duration object with is seconds
// property set to 2, and a callback. When the 2 seconds have ellapsed, it will call the callback. The callback has inside a trigger to perform a navigation
Future.delayed(const Duration(seconds: 2), () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return const FlutterBankLogin();
}),
);
});
return const Scaffold(
backgroundColor: Utils.mainThemeColor,
body: Stack(
children: [
Center(
child: Icon(
Icons.savings,
size: 60.0,
color: Colors.white,
),
),
Center(
child: SizedBox(
height: 100.0,
width: 100.0,
child: CircularProgressIndicator(
strokeWidth: 8.0,
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
),
)),
],
),
);
}
}
class FlutterBankLogin extends StatefulWidget {
const FlutterBankLogin({super.key});
@override
State<FlutterBankLogin> createState() {
return _FlutterBankLoginState();
}
}
class _FlutterBankLoginState extends State<FlutterBankLogin> {
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Text('Login'),
),
);
}
}
class Utils {
static const Color mainThemeColor = Color(0xFF8700C3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment