Skip to content

Instantly share code, notes, and snippets.

@CaiJingLong
Created April 29, 2020 03:16
Show Gist options
  • Save CaiJingLong/67de5cb98ec49b430ac235c8513c1ee8 to your computer and use it in GitHub Desktop.
Save CaiJingLong/67de5cb98ec49b430ac235c8513c1ee8 to your computer and use it in GitHub Desktop.
给2法看看
// 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 '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: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Container(
padding: const EdgeInsets.all(10),
child: Column(
children: [
Row(
children: [
Text(
'你好',
style: TextStyle(textBaseline: TextBaseline.alphabetic, height:1 , fontSize: 100),
// style: TextStyle(textBaseline: TextBaseline.ideographic),
),
Image.network(
'https://cdn.jsdelivr.net/gh/kikt-blog/test_images@master/test-header.jpg'),
],
crossAxisAlignment: CrossAxisAlignment.start,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment