diff --git a/app/assets/sample_data.json b/app/assets/sample_data.json index 15cc2f2a..e637ff09 100644 --- a/app/assets/sample_data.json +++ b/app/assets/sample_data.json @@ -451,7 +451,7 @@ }, { "attributes": { - "size": "small" + "size": 12.0 }, "insert": "Small" }, @@ -460,7 +460,7 @@ }, { "attributes": { - "size": "large" + "size": 35.0 }, "insert": "Large" }, @@ -469,7 +469,7 @@ }, { "attributes": { - "size": "huge" + "size": 60.0 }, "insert": "Huge" }, diff --git a/app/lib/pages/home_page.dart b/app/lib/pages/home_page.dart index 3663543f..ecabcd4b 100644 --- a/app/lib/pages/home_page.dart +++ b/app/lib/pages/home_page.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; +import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -66,6 +67,13 @@ class _HomePageState extends State { color: Colors.grey.shade800, child: _buildMenuBar(context), ), + floatingActionButton: FloatingActionButton( + onPressed: (){ + int option = Random().nextInt(30); + print(option); + _controller.formatSelection(SizeAttribute(option.toDouble())); + }, + ), body: RawKeyboardListener( focusNode: FocusNode(), onKey: (RawKeyEvent event) { @@ -111,13 +119,15 @@ class _HomePageState extends State { TextStyle( fontSize: 32.0, color: Colors.black, - height: 1.15, + height:1.15, fontWeight: FontWeight.w300, ), Tuple2(16.0, 0.0), Tuple2(0.0, 0.0), null), - sizeSmall: TextStyle(fontSize: 9.0)), + sizeSmall: TextStyle(fontSize: 9.0), + sizeHuge: TextStyle(fontSize:64.0) + ), ), ), ), diff --git a/lib/models/documents/attribute.dart b/lib/models/documents/attribute.dart index 2e3dd05d..5f55e035 100644 --- a/lib/models/documents/attribute.dart +++ b/lib/models/documents/attribute.dart @@ -205,8 +205,8 @@ class FontAttribute extends Attribute { FontAttribute(double val) : super('font', AttributeScope.INLINE, val); } -class SizeAttribute extends Attribute { - SizeAttribute(String val) : super('size', AttributeScope.INLINE, val); +class SizeAttribute extends Attribute { + SizeAttribute(double val) : super('size', AttributeScope.INLINE, val); } class LinkAttribute extends Attribute {