Skip to content

Instantly share code, notes, and snippets.

@simoales
Created August 5, 2020 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simoales/860ac36e234d254c41e82fe01441716e to your computer and use it in GitHub Desktop.
Save simoales/860ac36e234d254c41e82fe01441716e to your computer and use it in GitHub Desktop.
Beginning code for the SharedPreferences recipe
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter shared_preferences Demo',
theme: ThemeData(
primarySwatch: Colors.orange,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Shared Preferences')),
body: Container(
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment