-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo_screen.dart
73 lines (65 loc) · 2.29 KB
/
demo_screen.dart
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:cube_transition/cube_transition.dart';
import 'package:flutter_native_text_input_example/demo_page.dart';
import 'package:flutter_native_label/flutter_native_label.dart';
class DemoScreen extends StatefulWidget {
const DemoScreen({Key? key}) : super(key: key);
@override
State<DemoScreen> createState() => _DemoScreenState();
}
class _DemoScreenState extends State<DemoScreen> with TickerProviderStateMixin {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Chat screen'),
),
body: SafeArea(
child: Column(
children: [
const Spacer(),
Center(
child:Container(
padding: EdgeInsets.all(20),
color: Colors.grey,
child: const NativeLabel(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 👍👍👍👍 👍👍👍👍 ',
),
),
),
Center(
child:ElevatedButton(
child: Text('Rotate'),
onPressed: () {
FocusScope.of(context).unfocus();
Navigator.of(context).push(
CubePageRoute(
enterPage: DemoPage(),
exitPage: context.widget,
duration: const Duration(milliseconds: 500),
),
);
},
),
),
],
),
),
);
}
}
extension StringUtils on String {
double get va {
final values = split('@');
final num psValue =
int.tryParse(values.first) ?? double.tryParse(values.first) ?? 0;
final num fontSize =
int.tryParse(values.last) ?? double.tryParse(values.last) ?? 0;
return psValue * fontSize / 1000;
}
}