flutter demo1 step 2

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2022-12-16 05:31:33 -06:00
parent cd2e5caed9
commit 2c2ef644a7
4 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,7 @@
prep: prep:
flutter create flutter_test1 flutter create flutter_test1
flutter bin flutter bin
words:
flutter pub add english_words
flutter pub get

View File

@ -1,7 +1,7 @@
// Copyright 2018 The Flutter team. All rights reserved. // Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:english_words/english_words.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
void main() { void main() {
@ -13,14 +13,15 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final wordPair = WordPair.random();
return MaterialApp( return MaterialApp(
title: 'Welcome to Flutter', title: 'Welcome to Flutter',
home: Scaffold( home: Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('Welcome to Flutter'), title: const Text('Welcome to Flutter'),
), ),
body: const Center( body: Center(
child: Text('Hello World'), child: Text(wordPair.asPascalCase),
), ),
), ),
); );

View File

@ -43,6 +43,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.5" version: "1.0.5"
english_words:
dependency: "direct main"
description:
name: english_words
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:

View File

@ -36,6 +36,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
english_words: ^4.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: