This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
import 'package:flutter_voice_chat_using_agora/app/onboarding/onboarding_view_model.dart'; | |
class OnboardingScreen extends StatelessWidget { | |
Future<void> onGetStarted(BuildContext context) async { | |
final onboardingViewModel = context.read(onboardingViewModelProvider.notifier); | |
await onboardingViewModel.completeOnboarding(); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.stretch, | |
children: [ | |
Text( | |
'Voice chat app\nOnboarding contents come here.', | |
style: Theme.of(context).textTheme.headline4, | |
textAlign: TextAlign.center, | |
), | |
SizedBox(height: 16.0,), | |
ElevatedButton( | |
onPressed: () => onGetStarted(context), | |
style: ElevatedButton.styleFrom( | |
primary: Colors.indigo, | |
shape: RoundedRectangleBorder( | |
borderRadius: BorderRadius.all( | |
Radius.circular(30.0), | |
), | |
) | |
), // hei | |
child: Text( | |
'Get Started', | |
style: Theme.of(context) | |
.textTheme | |
.headline5 | |
.copyWith(color: Colors.white), | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment