Skip to content

Instantly share code, notes, and snippets.

@datvtwkm
Created August 30, 2019 03:21
Show Gist options
  • Save datvtwkm/75067529a0f7bea555e48c6e8d35d8e7 to your computer and use it in GitHub Desktop.
Save datvtwkm/75067529a0f7bea555e48c6e8d35d8e7 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'package:flutter_demo_setup/env.dart';
class MyApp extends StatelessWidget {
final Env env;
const MyApp({Key key, @required this.env}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(env: env),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.env}) : super(key: key);
final Env env;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Welcome'),
),
body: Center(
child: Text(
'You are reading ${widget.env.secret}',
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment