forked from ibhavikmakwana/FlutterPlayground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextExamples.dart
More file actions
59 lines (52 loc) · 1.46 KB
/
TextExamples.dart
File metadata and controls
59 lines (52 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2020 The Chromium Authors. 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';
import 'package:flutter_playground/utils/Strings.dart';
class TextExamples extends StatefulWidget {
final String title;
TextExamples({Key key, this.title}) : super(key: key);
@override
_TextExamplesState createState() => _TextExamplesState();
}
class _TextExamplesState extends State<TextExamples> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: textSpanPage());
}
Widget textSpanPage() {
return Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
textButtons(
Strings.textSpanExampleTitle,
Strings.textSpanExampleRoute,
),
textButtons(
Strings.textUnderlineExampleTitle,
Strings.textUnderlineExampleRoute,
),
],
),
);
}
textButtons(String text, String route) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: FlatButton(
child: Text(text),
shape: RoundedRectangleBorder(),
color: Colors.red,
textColor: Colors.white,
onPressed: () {
Navigator.pushNamed(context, route);
},
),
);
}
}