diff --git a/example/lib/main.dart b/example/lib/main.dart index e4a55a1a..46ced081 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -54,7 +54,7 @@ class BluetoothOffScreen extends StatelessWidget { 'Bluetooth Adapter is ${state != null ? state.toString().substring(15) : 'not available'}.', style: Theme.of(context) .primaryTextTheme - .subhead + .subtitle1 ?.copyWith(color: Colors.white), ), ], @@ -92,7 +92,7 @@ class FindDevicesScreen extends StatelessWidget { builder: (c, snapshot) { if (snapshot.data == BluetoothDeviceState.connected) { - return RaisedButton( + return ElevatedButton( child: Text('OPEN'), onPressed: () => Navigator.of(context).push( MaterialPageRoute( @@ -227,7 +227,7 @@ class DeviceScreen extends StatelessWidget { text = snapshot.data.toString().substring(21).toUpperCase(); break; } - return FlatButton( + return TextButton( onPressed: onPressed, child: Text( text, diff --git a/example/lib/widgets.dart b/example/lib/widgets.dart index aefdf262..7d9a1063 100644 --- a/example/lib/widgets.dart +++ b/example/lib/widgets.dart @@ -91,10 +91,12 @@ class ScanResultTile extends StatelessWidget { return ExpansionTile( title: _buildTitle(context), leading: Text(result.rssi.toString()), - trailing: RaisedButton( + trailing: ElevatedButton( child: Text('CONNECT'), - color: Colors.black, - textColor: Colors.white, + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.black), + foregroundColor: MaterialStateProperty.all(Colors.white) + ), onPressed: (result.advertisementData.connectable) ? onTap : null, ), children: [ @@ -135,7 +137,7 @@ class ServiceTile extends StatelessWidget { children: [ Text('Service'), Text('0x${service.uuid.toString().toUpperCase().substring(4, 8)}', - style: Theme.of(context).textTheme.body1?.copyWith( + style: Theme.of(context).textTheme.bodyText1?.copyWith( color: Theme.of(context).textTheme.caption?.color)) ], ), @@ -183,7 +185,7 @@ class CharacteristicTile extends StatelessWidget { Text('Characteristic'), Text( '0x${characteristic.uuid.toString().toUpperCase().substring(4, 8)}', - style: Theme.of(context).textTheme.body1?.copyWith( + style: Theme.of(context).textTheme.bodyText1?.copyWith( color: Theme.of(context).textTheme.caption?.color)) ], ), @@ -245,7 +247,7 @@ class DescriptorTile extends StatelessWidget { Text('0x${descriptor.uuid.toString().toUpperCase().substring(4, 8)}', style: Theme.of(context) .textTheme - .body1 + .bodyText1 ?.copyWith(color: Theme.of(context).textTheme.caption?.color)) ], ), @@ -289,11 +291,11 @@ class AdapterStateTile extends StatelessWidget { child: ListTile( title: Text( 'Bluetooth adapter is ${state.toString().substring(15)}', - style: Theme.of(context).primaryTextTheme.subhead, + style: Theme.of(context).primaryTextTheme.subtitle1, ), trailing: Icon( Icons.error, - color: Theme.of(context).primaryTextTheme.subhead?.color, + color: Theme.of(context).primaryTextTheme.subtitle1?.color, ), ), );