xiao_pet_tracker/lib/xiao_connector/view/connected_view.dart
baldeau 003e982ff8
Some checks failed
xiao_pet_tracker / semantic-pull-request (push) Failing after 2s
xiao_pet_tracker / build (push) Failing after 2s
xiao_pet_tracker / spell-check (push) Failing after 1s
add some ui improvements
2024-11-14 10:36:22 +01:00

52 lines
1.5 KiB
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:xiao_pet_tracker/xiao_connector/cubit/xiao_connector_cubit.dart';
class ConnectedView extends StatelessWidget {
const ConnectedView({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Xiao Connector'),
),
body: Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'''
You are connected to the Xiao Sense.
Now you can open the live feed.''',
textAlign: TextAlign.center,
),
const SizedBox(
height: 48,
),
ElevatedButton(
onPressed: () {
context.read<XiaoConnectorCubit>().startCapturing();
},
child: const Text('Open Live Feed'),
),
const SizedBox(
height: 48,
),
ElevatedButton(
onPressed: () {
context.read<XiaoConnectorCubit>().disconnectDevice();
},
child: const Text('Disconnect'),
),
],
),
),
),
);
}
}